#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ bigint_mul136(unsigned char *, unsigned char *,
                                 unsigned char *);
int /*<<< orphan*/ bigint_print(unsigned char *, int);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ randombytes(unsigned char *, int);
void test_bigint_mul136() {
  unsigned char a[17], b[17], r[34];
  int i, n;
  for (n = 0; n < 60; n++) {
    randombytes(a, 17);
    randombytes(b, 17);
    bigint_mul136(r, a, b);
    bigint_print(a, 17);
    print("*");
    bigint_print(b, 17);
    print("-");
    bigint_print(r, 34);
    print("\r\n");
  }
  for (i = 0; i < 17; i++)
    a[i] = b[i] = 255;
  bigint_mul136(r, a, b);
  bigint_print(a, 17);
  print("*");
  bigint_print(b, 17);
  print("-");
  bigint_print(r, 34);
  print("\r\n");
}


x86 assembly (clang, -O0):
<test_bigint_mul136>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x78(%rbp)
cmpl   $0x3c,-0x78(%rbp)
jge    11e5 <test_bigint_mul136+0xa5>
lea    -0x20(%rbp),%rdi
mov    $0x11,%esi
call   1050 <randombytes@plt>
lea    -0x40(%rbp),%rdi
mov    $0x11,%esi
call   1050 <randombytes@plt>
lea    -0x70(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <bigint_mul136@plt>
lea    -0x20(%rbp),%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
lea    0xe62(%rip),%rdi
call   1060 <print@plt>
lea    -0x40(%rbp),%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
lea    0xe4a(%rip),%rdi
call   1060 <print@plt>
lea    -0x70(%rbp),%rdi
mov    $0x22,%esi
call   1040 <bigint_print@plt>
lea    0xe32(%rip),%rdi
call   1060 <print@plt>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1152 <test_bigint_mul136+0x12>
movl   $0x0,-0x74(%rbp)
cmpl   $0x11,-0x74(%rbp)
jge    1216 <test_bigint_mul136+0xd6>
movslq -0x74(%rbp),%rax
movb   $0xff,-0x40(%rbp,%rax,1)
movslq -0x74(%rbp),%rax
movb   $0xff,-0x20(%rbp,%rax,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11ec <test_bigint_mul136+0xac>
lea    -0x70(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
call   1030 <bigint_mul136@plt>
lea    -0x20(%rbp),%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
lea    0xdc4(%rip),%rdi
call   1060 <print@plt>
lea    -0x40(%rbp),%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
lea    0xdac(%rip),%rdi
call   1060 <print@plt>
lea    -0x70(%rbp),%rdi
mov    $0x22,%esi
call   1040 <bigint_print@plt>
lea    0xd94(%rip),%rdi
call   1060 <print@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bigint_mul136>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    $0x3c,%r12d
lea    0x20(%rsp),%r14
mov    %rsp,%rbx
lea    0x40(%rsp),%r15
lea    0xe9a(%rip),%r13
lea    0xe95(%rip),%rbp
nop
mov    %r14,%rdi
mov    $0x11,%esi
call   1050 <randombytes@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1050 <randombytes@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <bigint_mul136@plt>
mov    %r14,%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
lea    0xe54(%rip),%rdi
call   1060 <print@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
mov    %r13,%rdi
call   1060 <print@plt>
mov    %r15,%rdi
mov    $0x22,%esi
call   1040 <bigint_print@plt>
mov    %rbp,%rdi
call   1060 <print@plt>
add    $0xffffffff,%r12d
jne    1170 <test_bigint_mul136+0x30>
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,(%rsp)
movb   $0xff,0x10(%rsp)
movdqa %xmm0,0x20(%rsp)
movb   $0xff,0x30(%rsp)
lea    0x40(%rsp),%r14
lea    0x20(%rsp),%rbp
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1030 <bigint_mul136@plt>
mov    %rbp,%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
lea    0xdd7(%rip),%rdi
call   1060 <print@plt>
mov    %rbx,%rdi
mov    $0x11,%esi
call   1040 <bigint_print@plt>
lea    0xdc0(%rip),%rdi
call   1060 <print@plt>
mov    %r14,%rdi
mov    $0x22,%esi
call   1040 <bigint_print@plt>
lea    0xda9(%rip),%rdi
call   1060 <print@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @test_bigint_mul136() {
%1 = alloca [17 x i8]
%2 = alloca [17 x i8]
%3 = alloca [34 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %5
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 60
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%11 = call i32 @randombytes(i8* %10, i32 17)
%12 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%13 = call i32 @randombytes(i8* %12, i32 17)
%14 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
%15 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%16 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%17 = call i32 @bigint_mul136(i8* %14, i8* %15, i8* %16)
%18 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%19 = call i32 @bigint_print(i8* %18, i32 17)
%20 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%22 = call i32 @bigint_print(i8* %21, i32 17)
%23 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%24 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
%25 = call i32 @bigint_print(i8* %24, i32 34)
%26 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %9
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %6
30: ; preds = %6
store i32 0, i32* %4
br label %31
31: ; preds = %41, %30
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 17
br i1 %33, label %34, label %44
34: ; preds = %31
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 %36
store i8 -1, i8* %37
%38 = load i32, i32* %4
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 %39
store i8 -1, i8* %40
br label %41
41: ; preds = %34
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
store i32 %43, i32* %4
br label %31
44: ; preds = %31
%45 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
%46 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%47 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%48 = call i32 @bigint_mul136(i8* %45, i8* %46, i8* %47)
%49 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%50 = call i32 @bigint_print(i8* %49, i32 17)
%51 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%52 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%53 = call i32 @bigint_print(i8* %52, i32 17)
%54 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%55 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
%56 = call i32 @bigint_print(i8* %55, i32 34)
%57 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [3 x i8] c"\0D\0A\00"
define void @test_bigint_mul136() {
%1 = alloca [17 x i8]
%2 = alloca [17 x i8]
%3 = alloca [34 x i8]
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
br label %7
7: ; preds = %0, %7
%8 = phi i32 [ 0, %0 ], [ %18, %7 ]
%9 = call i32 @randombytes(i8* %4, i32 17)
%10 = call i32 @randombytes(i8* %5, i32 17)
%11 = call i32 @bigint_mul136(i8* %6, i8* %4, i8* %5)
%12 = call i32 @bigint_print(i8* %4, i32 17)
%13 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @bigint_print(i8* %5, i32 17)
%15 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @bigint_print(i8* %6, i32 34)
%17 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%18 = add nuw nsw i32 %8, 1
%19 = icmp eq i32 %18, 60
br i1 %19, label %20, label %7
20: ; preds = %7
%21 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%22 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%23 = call i32 @bigint_mul136(i8* %6, i8* %4, i8* %5)
%24 = call i32 @bigint_print(i8* %4, i32 17)
%25 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%26 = call i32 @bigint_print(i8* %5, i32 17)
%27 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @bigint_print(i8* %6, i32 34)
%29 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}