Skip to content

Instantly share code, notes, and snippets.

@olomix
Created November 24, 2025 12:02
Show Gist options
  • Select an option

  • Save olomix/a120486e9fc12b921fc41f7c02050c3a to your computer and use it in GitHub Desktop.

Select an option

Save olomix/a120486e9fc12b921fc41f7c02050c3a to your computer and use it in GitHub Desktop.
incomplete_assignments/correct/function_multiple2/function_multiple2.circom
;; Prime value
%%prime 21888242871839275222246405745257275088548364400416034343698204186575808495617
;; Memory of signals
%%signals 29
;; Heap of components
%%components_heap 15
;; Types (for each field we store name type offset size nDims dims)
;; Main template
%%start A_3
;; Component creation mode (implicit/explicit)
%%components implicit
;; Witness (signal list)
%%witness 0
;; Input signals
%%input 0
%%function multiple_sizes_0 [] [ i64 0 i64 0 ff 0 ]
x_0 = i64.9
x_1 = i64.load i64.0
x_2 = i64.load i64.1
;; branch bucket
;; compute bucket
;; load bucket
;;line 4
x_4 = ff.load i64.0
;; end of load bucket
;; OP(EQ(Single(1)))
x_3 = ff.eq x_4 ff.0
;; end of compute bucket
ff.if x_3
;; store bucket in function
;;line 5
;; getting dest
ff.store i64.1 ff.99
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.2 ff.99
;; end of store bucket
;; return bucket
x_5 = i64.le i64.2 x_2
i64.if x_5
x_6 = i64.2
else
x_6 = x_2
end
ff.mreturn x_1 i64.1 x_6
;;line 4
else
;; branch bucket
;; compute bucket
;; load bucket
;;line 6
x_8 = ff.load i64.0
;; end of load bucket
;; OP(EQ(Single(1)))
x_7 = ff.eq x_8 ff.1
;; end of compute bucket
ff.if x_7
;; store bucket in function
;;line 7
;; getting dest
ff.store i64.1 ff.1
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.2 ff.1
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.3 ff.1
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.4 ff.1
;; end of store bucket
;; return bucket
x_9 = i64.le i64.4 x_2
i64.if x_9
x_10 = i64.4
else
x_10 = x_2
end
ff.mreturn x_1 i64.1 x_10
;;line 6
else
;; store bucket in function
;;line 9
;; getting dest
ff.store i64.1 ff.2
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.2 ff.2
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.3 ff.2
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.4 ff.2
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.5 ff.2
;; end of store bucket
;; store bucket in function
;; getting dest
ff.store i64.6 ff.2
;; end of store bucket
;; return bucket
x_11 = i64.le i64.6 x_2
i64.if x_11
x_12 = i64.6
else
x_12 = x_2
end
ff.mreturn x_1 i64.1 x_12
end
;; end of branch bucket
end
;; end of branch bucket
%%template B_0 [ ff 1 2] [ ff 1 2] [4] [ ]
x_13 = i64.1
;;line 0
;; getting dest
ff.store i64.0 ff.2
;; end of store bucket
;;line 18
x_14 = i64.2
x_15 = i64.0
x_16 = i64.2
loop
i64.if x_16
x_17 = get_signal x_14
set_signal x_15 x_17
x_14 = i64.add x_14 i64.1
x_15 = i64.add x_15 i64.1
x_16 = i64.sub x_16 i64.1
continue
end
break
end
;; end of store bucket
%%template B_1 [ ff 1 4] [ ff 1 4] [8] [ ]
x_18 = i64.1
;;line 0
;; getting dest
ff.store i64.0 ff.4
;; end of store bucket
;;line 18
x_19 = i64.4
x_20 = i64.0
x_21 = i64.4
loop
i64.if x_21
x_22 = get_signal x_19
set_signal x_20 x_22
x_19 = i64.add x_19 i64.1
x_20 = i64.add x_20 i64.1
x_21 = i64.sub x_21 i64.1
continue
end
break
end
;; end of store bucket
%%template B_2 [ ff 1 6] [ ff 1 6] [12] [ ]
x_23 = i64.1
;;line 0
;; getting dest
ff.store i64.0 ff.6
;; end of store bucket
;;line 18
x_24 = i64.6
x_25 = i64.0
x_26 = i64.6
loop
i64.if x_26
x_27 = get_signal x_24
set_signal x_25 x_27
x_24 = i64.add x_24 i64.1
x_25 = i64.add x_25 i64.1
x_26 = i64.sub x_26 i64.1
continue
end
break
end
;; end of store bucket
%%template A_3 [] [] [4] [ 0 1 2 ]
x_28 = i64.115
;;line 24
;; getting dest
set_signal i64.0 ff.0
;; end of store bucket
;; getting dest
set_signal i64.1 ff.1
;; end of store bucket
;; getting dest
set_signal i64.2 ff.2
;; end of store bucket
;;line 29
;; getting dest
ff.store i64.0 ff.0
;; end of store bucket
;; getting dest
ff.store i64.1 ff.0
;; end of store bucket
;; getting dest
ff.store i64.2 ff.0
;; end of store bucket
;; getting dest
ff.store i64.0 ff.2
;; end of store bucket
;; getting dest
ff.store i64.1 ff.4
;; end of store bucket
;; getting dest
ff.store i64.2 ff.6
;; end of store bucket
;;line 34
;; getting dest
ff.store i64.33 ff.0
;; end of store bucket
;; getting dest
ff.store i64.34 ff.0
;; end of store bucket
;; getting dest
ff.store i64.35 ff.0
;; end of store bucket
;; getting dest
ff.store i64.36 ff.0
;; end of store bucket
;; getting dest
ff.store i64.37 ff.0
;; end of store bucket
;; getting dest
ff.store i64.38 ff.0
;; end of store bucket
;; getting dest
ff.store i64.39 ff.0
;; end of store bucket
;; getting dest
ff.store i64.40 ff.0
;; end of store bucket
;; getting dest
ff.store i64.41 ff.0
;; end of store bucket
;; getting dest
ff.store i64.42 ff.0
;; end of store bucket
x_29 = i64.33
x_30 = i64.3
x_31 = i64.10
loop
i64.if x_31
x_32 = ff.load x_29
ff.store x_30 x_32
x_29 = i64.add x_29 i64.1
x_30 = i64.add x_30 i64.1
x_31 = i64.sub x_31 i64.1
continue
end
break
end
;; end of store bucket
x_33 = i64.33
x_34 = i64.13
x_35 = i64.10
loop
i64.if x_35
x_36 = ff.load x_33
ff.store x_34 x_36
x_33 = i64.add x_33 i64.1
x_34 = i64.add x_34 i64.1
x_35 = i64.sub x_35 i64.1
continue
end
break
end
;; end of store bucket
x_37 = i64.33
x_38 = i64.23
x_39 = i64.10
loop
i64.if x_39
x_40 = ff.load x_37
ff.store x_38 x_40
x_37 = i64.add x_37 i64.1
x_38 = i64.add x_38 i64.1
x_39 = i64.sub x_39 i64.1
continue
end
break
end
;; end of store bucket
;;line 36
;; getting dest
set_signal i64.3 ff.3
;; end of store bucket
;;line 38
;; getting dest
ff.store i64.73 ff.0
;; end of store bucket
;; getting dest
ff.store i64.74 ff.0
;; end of store bucket
;; getting dest
ff.store i64.75 ff.0
;; end of store bucket
;; getting dest
ff.store i64.76 ff.0
;; end of store bucket
;; getting dest
ff.store i64.77 ff.0
;; end of store bucket
;; getting dest
ff.store i64.78 ff.0
;; end of store bucket
;; getting dest
ff.store i64.79 ff.0
;; end of store bucket
;; getting dest
ff.store i64.80 ff.0
;; end of store bucket
;; getting dest
ff.store i64.81 ff.0
;; end of store bucket
;; getting dest
ff.store i64.82 ff.0
;; end of store bucket
x_41 = i64.73
x_42 = i64.43
x_43 = i64.10
loop
i64.if x_43
x_44 = ff.load x_41
ff.store x_42 x_44
x_41 = i64.add x_41 i64.1
x_42 = i64.add x_42 i64.1
x_43 = i64.sub x_43 i64.1
continue
end
break
end
;; end of store bucket
x_45 = i64.73
x_46 = i64.53
x_47 = i64.10
loop
i64.if x_47
x_48 = ff.load x_45
ff.store x_46 x_48
x_45 = i64.add x_45 i64.1
x_46 = i64.add x_46 i64.1
x_47 = i64.sub x_47 i64.1
continue
end
break
end
;; end of store bucket
x_49 = i64.73
x_50 = i64.63
x_51 = i64.10
loop
i64.if x_51
x_52 = ff.load x_49
ff.store x_50 x_52
x_49 = i64.add x_49 i64.1
x_50 = i64.add x_50 i64.1
x_51 = i64.sub x_51 i64.1
continue
end
break
end
;; end of store bucket
;; getting dest
ff.store i64.83 ff.99
;; end of store bucket
;; getting dest
ff.store i64.84 ff.99
;; end of store bucket
;; getting dest
ff.store i64.85 ff.0
;; end of store bucket
;; getting dest
ff.store i64.86 ff.0
;; end of store bucket
;; getting dest
ff.store i64.87 ff.0
;; end of store bucket
;; getting dest
ff.store i64.88 ff.0
;; end of store bucket
;; getting dest
ff.store i64.89 ff.0
;; end of store bucket
;; getting dest
ff.store i64.90 ff.0
;; end of store bucket
;; getting dest
ff.store i64.91 ff.0
;; end of store bucket
;; getting dest
ff.store i64.92 ff.0
;; end of store bucket
;;line 39
;; getting dest
ff.store i64.93 ff.1
;; end of store bucket
;; getting dest
ff.store i64.94 ff.1
;; end of store bucket
;; getting dest
ff.store i64.95 ff.1
;; end of store bucket
;; getting dest
ff.store i64.96 ff.1
;; end of store bucket
;; getting dest
ff.store i64.97 ff.0
;; end of store bucket
;; getting dest
ff.store i64.98 ff.0
;; end of store bucket
;; getting dest
ff.store i64.99 ff.0
;; end of store bucket
;; getting dest
ff.store i64.100 ff.0
;; end of store bucket
;; getting dest
ff.store i64.101 ff.0
;; end of store bucket
;; getting dest
ff.store i64.102 ff.0
;; end of store bucket
;;line 40
;; getting dest
ff.store i64.103 ff.2
;; end of store bucket
;; getting dest
ff.store i64.104 ff.2
;; end of store bucket
;; getting dest
ff.store i64.105 ff.2
;; end of store bucket
;; getting dest
ff.store i64.106 ff.2
;; end of store bucket
;; getting dest
ff.store i64.107 ff.2
;; end of store bucket
;; getting dest
ff.store i64.108 ff.2
;; end of store bucket
;; getting dest
ff.store i64.109 ff.0
;; end of store bucket
;; getting dest
ff.store i64.110 ff.0
;; end of store bucket
;; getting dest
ff.store i64.111 ff.0
;; end of store bucket
;; getting dest
ff.store i64.112 ff.0
;; end of store bucket
;;line 38
x_53 = i64.83
x_54 = i64.43
x_55 = i64.10
loop
i64.if x_55
x_56 = ff.load x_53
ff.store x_54 x_56
x_53 = i64.add x_53 i64.1
x_54 = i64.add x_54 i64.1
x_55 = i64.sub x_55 i64.1
continue
end
break
end
;; end of store bucket
x_57 = i64.93
x_58 = i64.53
x_59 = i64.10
loop
i64.if x_59
x_60 = ff.load x_57
ff.store x_58 x_60
x_57 = i64.add x_57 i64.1
x_58 = i64.add x_58 i64.1
x_59 = i64.sub x_59 i64.1
continue
end
break
end
;; end of store bucket
x_61 = i64.103
x_62 = i64.63
x_63 = i64.10
loop
i64.if x_63
x_64 = ff.load x_61
ff.store x_62 x_64
x_61 = i64.add x_61 i64.1
x_62 = i64.add x_62 i64.1
x_63 = i64.sub x_63 i64.1
continue
end
break
end
;; end of store bucket
;;line 43
;; getting dest
ff.store i64.113 ff.0
;; end of store bucket
;; loop bucket. Line 43
loop
;; compute bucket
;; load bucket
x_66 = ff.load i64.113
;; end of load bucket
;; OP(LESSER)
x_65 = ff.lt x_66 ff.3
;; end of compute bucket
ff.if x_65
;; start of call bucket
;; load bucket
;;line 47
x_67 = ff.load i64.113
;; end of load bucket
;; end copying argument 0
x_75 = get_template_id x_68
x_76 = i64.eq x_75 i64.2
i64.if x_76
x_74 = i64.6
else
x_77 = i64.eq x_75 i64.0
i64.if x_77
x_74 = i64.2
else
x_78 = i64.eq x_75 i64.1
i64.if x_78
x_74 = i64.4
else
x_74 = i64.0
end
end
end
;;line 47
ff.mcall $multiple_sizes_0 x_28 x_74 x_67
;; is subcomponent mapped
;; compute bucket
;; compute bucket
;; compute bucket
;; load bucket
x_71 = ff.load i64.113
;; end of load bucket
;; OP(TO_ADDRESS)
x_70 = i64.wrap_ff x_71
;; end of compute bucket
;; OP(MUL_ADDRESS)
;;line 0
x_69 = i64.mul i64.1 x_70
;; end of compute bucket
;; OP(ADD_ADDRESS)
x_68 = i64.add x_69 i64.0
;; end of compute bucket
x_72 = get_template_id x_68
x_73 = get_template_signal_position x_72 i64.1
x_80 = x_73
x_74 = i64.sub x_74 i64.1
loop
i64.if x_74
x_79 = ff.load x_28
set_cmp_input_cnt x_68 x_80 x_79
x_74 = i64.sub x_74 i64.1
x_28 = i64.add x_28 i64.1
x_80 = i64.add x_80 i64.1
continue
end
break
end
x_79 = ff.load x_28
set_cmp_input_cnt_check x_68 x_80 x_79
;; end call bucket
;;line 49
;; is subcomponent mapped
;; compute bucket
;; compute bucket
;; compute bucket
;; load bucket
x_84 = ff.load i64.113
;; end of load bucket
;; OP(TO_ADDRESS)
x_83 = i64.wrap_ff x_84
;; end of compute bucket
;; OP(MUL_ADDRESS)
;;line 0
x_82 = i64.mul i64.1 x_83
;; end of compute bucket
;; OP(ADD_ADDRESS)
x_81 = i64.add x_82 i64.0
;; end of compute bucket
x_85 = get_template_id x_81
x_86 = get_template_signal_position x_85 i64.1
;;line 49
;; compute bucket
;; compute bucket
;; compute bucket
;; load bucket
x_94 = ff.load i64.113
;; end of load bucket
;; OP(TO_ADDRESS)
x_93 = i64.wrap_ff x_94
;; end of compute bucket
;; OP(MUL_ADDRESS)
;;line 34
x_92 = i64.mul i64.10 x_93
;; end of compute bucket
;; OP(ADD_ADDRESS)
x_91 = i64.add x_92 i64.3
;; end of compute bucket
x_87 = x_86
x_88 = x_91
x_89 = i64.10
x_96 = get_template_id x_81
x_97 = i64.eq x_96 i64.2
i64.if x_97
x_95 = i64.6
else
x_98 = i64.eq x_96 i64.0
i64.if x_98
x_95 = i64.2
else
x_99 = i64.eq x_96 i64.1
i64.if x_99
x_95 = i64.4
else
x_95 = i64.0
end
end
end
x_100 = i64.lt x_95 x_89
i64.if x_100
x_89 = x_95
end
loop
i64.if x_89
x_90 = get_cmp_signal x_81 x_87
ff.store x_88 x_90
x_87 = i64.add x_87 i64.1
x_88 = i64.add x_88 i64.1
x_89 = i64.sub x_89 i64.1
continue
end
break
end
;; end of store bucket
;;line 52
;; getting dest
ff.store i64.114 ff.0
;; end of store bucket
;; loop bucket. Line 52
loop
;; compute bucket
;; load bucket
x_102 = ff.load i64.114
;; end of load bucket
;; OP(LESSER)
x_101 = ff.lt x_102 ff.10
;; end of compute bucket
ff.if x_101
;; compute bucket
;; load bucket
x_104 = ff.load i64.114
;; end of load bucket
;; OP(ADD)
x_103 = ff.add x_104 ff.1
;; end of compute bucket
;; getting dest
ff.store i64.114 x_103
;; end of store bucket
continue
end
end
;; end of loop bucket
;;line 43
;; compute bucket
;; load bucket
x_106 = ff.load i64.113
;; end of load bucket
;; OP(ADD)
x_105 = ff.add x_106 ff.1
;; end of compute bucket
;; getting dest
ff.store i64.113 x_105
;; end of store bucket
continue
end
end
;; end of loop bucket
;; assert bucket
;; compute bucket
;; OP(EQ(Single(30)))
;;line 58
;; is array equality
x_108 = i64.3
x_109 = i64.43
x_112 = i64.30
loop
i64.if x_112
x_110 = ff.load x_108
x_111 = ff.load x_109
x_107 = ff.eq x_110 x_111
ff.if x_107
x_112 = i64.sub x_112 i64.1
x_108 = i64.add x_108 i64.1
x_109 = i64.add x_109 i64.1
continue
end
end
break
end
;; end of compute bucket
x_113 = ff.eqz x_107
ff.if x_113
error i64.0
end
;; end of assert bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment