xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ldrui_set_progress(int);
int /*<<< orphan*/ loaderui_thread_end();
int /*<<< orphan*/ loaderui_thread_start();
int main() {
  int i;
  loaderui_thread_start();
  for (i = 0; i < 10000; i++) {
    ldrui_set_progress(i % 100);
  }
  loaderui_thread_end();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <loaderui_thread_start@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    117a <main+0x4a>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <ldrui_set_progress@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
mov    $0x0,%al
call   1040 <loaderui_thread_end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <loaderui_thread_start@plt>
mov    $0x2710,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
mov    %ebx,%edi
sub    %eax,%edi
call   1030 <ldrui_set_progress@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
call   1040 <loaderui_thread_end@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @loaderui_thread_start()
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = srem i32 %8, 100
%10 = call i32 @ldrui_set_progress(i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = call i32 (...) @loaderui_thread_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @loaderui_thread_start()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %8, %2 ]
%4 = trunc i32 %3 to i16
%5 = urem i16 %4, 100
%6 = zext i16 %5 to i32
%7 = tail call i32 @ldrui_set_progress(i32 %6)
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 10000
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 (...) @loaderui_thread_end()
ret i32 0
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ printf(char *, char *);
int show_error(char subject[]) {
  printf("machelper: %s\n", subject);
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<show_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_error>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"machelper: %s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @show_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
ret i32 %5
}

LLVM IR (-O2):
@.str = [15 x i8] c"machelper: %s\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @show_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Gamma_Left(int value) {
  if (value) {
    cpc_key_press(0x72);
  } else {
    cpc_key_unpress(0x72);
  };
}


x86 assembly (clang, -O0):
<Joy_Gamma_Left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Gamma_Left+0x24>
mov    $0x72,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Gamma_Left+0x2e>
mov    $0x72,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Gamma_Left>:
test   %edi,%edi
je     112e <Joy_Gamma_Left+0xe>
mov    $0x72,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x72,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Gamma_Left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @cpc_key_press(i32 114)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 114)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Gamma_Left(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 114)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 114)
br label %7
7: ; preds = %5, %3
ret void
}
void set4l(char *p, unsigned long v) {
  int i;
  for (i = 0; i < 4; i++)
    p[i] = ((v >> 8 * i) & 255);
}


x86 assembly (clang, -O0):
<set4l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    114d <set4l+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
and    $0xff,%rax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <set4l+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set4l>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set4l(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i64, i64* %4
%11 = load i32, i32* %5
%12 = mul nsw i32 8, %11
%13 = zext i32 %12 to i64
%14 = lshr i64 %10, %13
%15 = and i64 %14, 255
%16 = trunc i64 %15 to i8
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
br label %21
21: ; preds = %9
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @set4l(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
store i8 %3, i8* %0
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %1, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %1, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int is_leap_year(time_t year) {
  if (year % 4)
    return 0;
  else if (year % 100)
    return 1;
  else if (year % 400)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1127 <is_leap_year+0x27>
movl   $0x0,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1147 <is_leap_year+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1167 <is_leap_year+0x67>
movl   $0x0,-0x4(%rbp)
jmp    116e <is_leap_year+0x6e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 100
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = srem i32 %14, 400
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %2
br label %19
18: ; preds = %13
store i32 1, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int double_to_bits(double);
int isnan(double x) {
  unsigned long exponent = (double_to_bits(x) >> 52) & 0x7ff;
  unsigned long mantissa = double_to_bits(x) & 0xffffffffffffful;
  return exponent == 2047 && mantissa != 0;
}


x86 assembly (clang, -O0):
<isnan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <double_to_bits@plt>
mov    $0x34,%ecx
sar    %cl,%eax
and    $0x7ff,%eax
cltq
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <double_to_bits@plt>
cltq
movabs $0xfffffffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x7ff,-0x10(%rbp)
mov    %al,-0x19(%rbp)
jne    1174 <isnan+0x64>
cmpq   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnan>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <double_to_bits@plt>
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <double_to_bits@plt>

LLVM IR (-O0):
define i32 @isnan(double %0) {
%2 = alloca double
%3 = alloca i64
%4 = alloca i64
store double %0, double* %2
%5 = load double, double* %2
%6 = call i32 @double_to_bits(double %5)
%7 = ashr i32 %6, 52
%8 = and i32 %7, 2047
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
%10 = load double, double* %2
%11 = call i32 @double_to_bits(double %10)
%12 = sext i32 %11 to i64
%13 = and i64 %12, 4503599627370495
store i64 %13, i64* %4
%14 = load i64, i64* %3
%15 = icmp eq i64 %14, 2047
br i1 %15, label %16, label %19
16: ; preds = %1
%17 = load i64, i64* %4
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %16, %1
%20 = phi i1 [ false, %1 ], [ %18, %16 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @isnan(double %0) {
%2 = tail call i32 @double_to_bits(double %0)
%3 = tail call i32 @double_to_bits(double %0)
ret i32 poison
}
int find(int *p, int size, int find_num) {
  int i;
  for (i = 0; i < size; i++) {
    if (p[i] == find_num) {
      return find_num;
    }
  }
  if (i == size)
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <find+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <find+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <find+0x72>
jmp    1145 <find+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <find+0x15>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    116b <find+0x6b>
movl   $0x0,-0x4(%rbp)
jmp    1172 <find+0x72>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
test   %esi,%esi
jle    111e <find+0x1e>
mov    %edx,%eax
mov    %esi,%ecx
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmp    %eax,(%rdi,%rdx,4)
je     1120 <find+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <find+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @find(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %7
store i32 %22, i32* %4
br label %33
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 0, i32* %4
br label %33
32: ; preds = %27
store i32 0, i32* %4
br label %33
33: ; preds = %32, %31, %21
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @find(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ %2, %9 ]
ret i32 %16
}
int lockup_exit(void) {}


x86 assembly (clang, -O0):
<lockup_exit>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockup_exit>:
ret

LLVM IR (-O0):
define i32 @lockup_exit() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @lockup_exit() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ outl(int, int);
int /*<<< orphan*/ outw(unsigned short, int);
void pci_write_config16(unsigned addr, unsigned short value) {
  outl(0x80000000 | (addr & ~3), 0xCF8);
  outw(value, 0xCFC + (addr & 2));
}


x86 assembly (clang, -O0):
<pci_write_config16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
and    $0xfffffffc,%edi
or     $0x80000000,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
mov    -0x6(%rbp),%ax
mov    -0x4(%rbp),%esi
and    $0x2,%esi
add    $0xcfc,%esi
movzwl %ax,%edi
call   1040 <outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_write_config16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
and    $0x7ffffffc,%edi
or     $0x80000000,%edi
mov    $0xcf8,%esi
call   1030 <outl@plt>
and    $0x2,%ebp
or     $0xcfc,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outw@plt>

LLVM IR (-O0):
define void @pci_write_config16(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = and i32 %5, -4
%7 = or i32 -2147483648, %6
%8 = call i32 @outl(i32 %7, i32 3320)
%9 = load i16, i16* %4
%10 = load i32, i32* %3
%11 = and i32 %10, 2
%12 = add i32 3324, %11
%13 = call i32 @outw(i16 zeroext %9, i32 %12)
ret void
}

LLVM IR (-O2):
define void @pci_write_config16(i32 %0, i16 zeroext %1) {
%3 = and i32 %0, 2147483644
%4 = or i32 %3, -2147483648
%5 = tail call i32 @outl(i32 %4, i32 3320)
%6 = and i32 %0, 2
%7 = or i32 %6, 3324
%8 = tail call i32 @outw(i16 zeroext %1, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xe5() {
  Assert_real((iscntrl(229) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1150, ("iscntrl should be 0 for 0xe5"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xe5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe5,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x47e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xe5>:
push   %rax
mov    $0xe5,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x47e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe5\00"
define void @t_iscntrl_0xe5() {
%1 = call i64 @iscntrl(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xe5\00"
define void @t_iscntrl_0xe5() {
%1 = tail call i64 @iscntrl(i32 229)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1150, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void releaseTwoD(int size, char **twoD) {
  int ind;
  for (ind = 0; ind < size; ind++) {
    free(twoD[ind]);
  }
  free(twoD);
}


x86 assembly (clang, -O0):
<releaseTwoD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <releaseTwoD+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <releaseTwoD+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<releaseTwoD>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <releaseTwoD+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <releaseTwoD+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @releaseTwoD(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8**, i8*** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i8**, i8*** %4
%21 = bitcast i8** %20 to i8*
ret void
}

LLVM IR (-O2):
define void @releaseTwoD(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
void ff_hevc_put_hevc_qpel_h64_10_avx2() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_qpel_h64_10_avx2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_qpel_h64_10_avx2>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_qpel_h64_10_avx2() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h64_10_avx2() {
ret void
}
/* Variables and functions */
bool interrupt_empty_sniffer(void) { return true; }


x86 assembly (clang, -O0):
<interrupt_empty_sniffer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_empty_sniffer>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @interrupt_empty_sniffer() {
ret i32 1
}

LLVM IR (-O2):
define i32 @interrupt_empty_sniffer() {
ret i32 1
}
callstk(nargs) int nargs;
{
  immed();
  outdec(nargs);
  outasm("(%esp), %eax");
  nl();
  ol("call *%eax");
}


x86 assembly (clang, -O0):
<callstk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <immed@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1060 <outdec@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <outasm@plt>
mov    $0x0,%al
call   1030 <nl@plt>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1070 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callstk>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <immed@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1060 <outdec@plt>
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1050 <outasm@plt>
xor    %eax,%eax
call   1030 <nl@plt>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1070 <ol@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"(%esp), %eax\00"
@.str.1 = [11 x i8] c"call *%eax\00"
define i32 @callstk(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @immed()
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @outdec to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @nl()
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"(%esp), %eax\00"
@.str.1 = [11 x i8] c"call *%eax\00"
define i32 @callstk(i32 %0) {
%2 = tail call i32 (...) @immed()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @outdec to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @nl()
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int lib_init_key(unsigned char *, unsigned int, unsigned char *, unsigned int);
int sec_init_key(unsigned char *nKey, unsigned int nKey_len,
                 unsigned char *eKey, unsigned int eKey_len) {
  return lib_init_key(nKey, nKey_len, eKey, eKey_len);
}


x86 assembly (clang, -O0):
<sec_init_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <lib_init_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec_init_key>:
jmp    1030 <lib_init_key@plt>

LLVM IR (-O0):
define i32 @sec_init_key(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @lib_init_key(i8* %9, i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @sec_init_key(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @lib_init_key(i8* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ rint(float);
__attribute__((always_)) __attribute__((const)) long int lrintf(float x) {
  return (int)(rint(x));
}


x86 assembly (clang, -O0):
<lrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <rint@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintf>:
push   %rax
call   1030 <rint@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @lrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @rint(float %3)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @lrintf(float %0) {
%2 = tail call i64 @rint(float %0)
%3 = shl i64 %2, 32
%4 = ashr exact i64 %3, 32
ret i64 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("State it");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"State it\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [9 x i8] c"State it\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
short GetMaxShort(void) { return ((unsigned short)-1) >> 1; }


x86 assembly (clang, -O0):
<GetMaxShort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7fff,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMaxShort>:
mov    $0x7fff,%ax
ret

LLVM IR (-O0):
define signext i16 @GetMaxShort() {
ret i16 32767
}

LLVM IR (-O2):
define signext i16 @GetMaxShort() {
ret i16 32767
}
/* Variables and functions */
int f396(int *);
int f397(int *p) { return f396(p); }


x86 assembly (clang, -O0):
<f397>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <f396@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f397>:
jmp    1030 <f396@plt>

LLVM IR (-O0):
define i32 @f397(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @f396(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @f397(i32* %0) {
%2 = tail call i32 @f396(i32* %0)
ret i32 %2
}
void ff_hevc_put_hevc_epel_h24_8_sse4() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_epel_h24_8_sse4>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_epel_h24_8_sse4>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_epel_h24_8_sse4() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h24_8_sse4() {
ret void
}
long nelinm1(int a) { return -(a != -1); }


x86 assembly (clang, -O0):
<nelinm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<nelinm1>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
neg    %rax
ret

LLVM IR (-O0):
define i64 @nelinm1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
%6 = sub nsw i32 0, %5
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @nelinm1(i32 %0) {
%2 = icmp ne i32 %0, -1
%3 = sext i1 %2 to i64
ret i64 %3
}
void TM12_intr(void) {}


x86 assembly (clang, -O0):
<TM12_intr>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TM12_intr>:
ret

LLVM IR (-O0):
define void @TM12_intr() {
ret void
}

LLVM IR (-O2):
define void @TM12_intr() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtepi32_ps(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_cvttps_epi32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ss(float *);
int /*<<< orphan*/ _mm_store_ss(float *, int /*<<< orphan*/);
uint32_t determ_trunc_float(uint32_t a) {
  uint32_t r;
  _mm_store_ss((float *)&r,
               _mm_cvtepi32_ps(_mm_cvttps_epi32(_mm_load_ss((float *)&a))));
  return r;
}


x86 assembly (clang, -O0):
<determ_trunc_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1060 <_mm_load_ss@plt>
mov    %eax,%edi
call   1040 <_mm_cvttps_epi32@plt>
mov    %eax,%edi
call   1030 <_mm_cvtepi32_ps@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <_mm_store_ss@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_trunc_float>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1060 <_mm_load_ss@plt>
mov    %eax,%edi
call   1040 <_mm_cvttps_epi32@plt>
mov    %eax,%edi
call   1030 <_mm_cvtepi32_ps@plt>
mov    %rsp,%rdi
mov    %eax,%esi
call   1050 <_mm_store_ss@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @determ_trunc_float(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to float*
%5 = bitcast i32* %2 to float*
%6 = call i32 @_mm_load_ss(float* %5)
%7 = call i32 @_mm_cvttps_epi32(i32 %6)
%8 = call i32 @_mm_cvtepi32_ps(i32 %7)
%9 = call i32 @_mm_store_ss(float* %4, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @determ_trunc_float(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = bitcast i32* %3 to float*
%6 = bitcast i32* %2 to float*
%7 = call i32 @_mm_load_ss(float* %6)
%8 = call i32 @_mm_cvttps_epi32(i32 %7)
%9 = call i32 @_mm_cvtepi32_ps(i32 %8)
%10 = call i32 @_mm_store_ss(float* %5, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}
__attribute__((__always___)) unsigned int rte_xbegin(void) {
  unsigned int ret = (~0u);
  asm volatile(".byte 0xc7,0xf8 ; .long 0" : "+a"(ret)::"memory");
  return ret;
}


x86 assembly (clang, -O0):
<rte_xbegin>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xbegin 1114 <rte_xbegin+0x14>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_xbegin>:
mov    $0xffffffff,%eax
xbegin 110b <rte_xbegin+0xb>
ret

LLVM IR (-O0):
define i32 @rte_xbegin() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @rte_xbegin() {
%1 = tail call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 -1)
ret i32 %1
}
int tmax(void) {
  int x = 0X80;
  return (~(x << 24));
  ;
}


x86 assembly (clang, -O0):
<tmax>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmax>:
mov    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i32 @tmax() {
%1 = alloca i32
store i32 128, i32* %1
%2 = load i32, i32* %1
%3 = shl i32 %2, 24
%4 = xor i32 %3, -1
ret i32 %4
}

LLVM IR (-O2):
define i32 @tmax() {
ret i32 2147483647
}
unsigned int euclidGCD(unsigned int a, unsigned int b) {
  if (b == 0)
    return a;
  else
    return euclidGCD(b, a % b);
}


x86 assembly (clang, -O0):
<euclidGCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <euclidGCD+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <euclidGCD+0x38>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%esi
call   1030 <euclidGCD@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclidGCD>:
mov    %edi,%eax
test   %esi,%esi
je     111e <euclidGCD+0x1e>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
xor    %edx,%edx
div    %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <euclidGCD+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @euclidGCD(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = urem i32 %12, %13
%15 = call i32 @euclidGCD(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @euclidGCD(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = urem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
void *calloc(unsigned long, unsigned int);
int /*<<< orphan*/ free(void *);
void f2(int i) {
  unsigned long j = 10;
  void *ptr = calloc(j, (unsigned)i);
  free(ptr);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0xa,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
mov    %edi,%esi
mov    $0xa,%edi
call   1040 <calloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8*
store i32 %0, i32* %2
store i64 10, i64* %3
%5 = load i64, i64* %3
%6 = load i32, i32* %2
%7 = call i8* @calloc(i64 %5, i32 %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = tail call i8* @calloc(i64 10, i32 %0)
%3 = tail call i32 @free(i8* %2)
ret void
}
R0A1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (r0 <= (*((unsigned short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movzwl -0x6(%rbp),%eax
mov    $0xa98ac7,%ecx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     113f <R0A1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <R0A1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0A1>:
movzwl %di,%ecx
movzwl 0xa98ac7,%edx
xor    %eax,%eax
cmp    %edx,%ecx
setbe  %al
ret

LLVM IR (-O0):
define i32 @R0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %8
%17 = zext i16 %16 to i32
%18 = load i16, i16* inttoptr (i64 11111111 to i16*)
%19 = zext i16 %18 to i32
%20 = icmp sle i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @R0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = and i32 %0, 65535
%8 = load i16, i16* inttoptr (i64 11111111 to i16*)
%9 = zext i16 %8 to i32
%10 = icmp ule i32 %7, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *message) {
  fprintf(stderr, "Error %s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"Error %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"Error %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_key_shares();
int main(void) {
  test_key_shares();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_key_shares@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_key_shares@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_key_shares()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_key_shares()
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(char);
void consume_number(char **s) {
  if (**s == '-')
    (*s)++;
  while (isdigit(**s))
    (*s)++;
}


x86 assembly (clang, -O0):
<consume_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    113d <consume_number+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1142 <consume_number+0x32>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     116e <consume_number+0x5e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1142 <consume_number+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consume_number>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rcx
mov    (%rcx),%al
cmp    $0x2d,%al
jne    1127 <consume_number+0x17>
lea    0x1(%rcx),%rax
mov    %rax,(%rbx)
mov    0x1(%rcx),%al
movsbl %al,%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isdigit@plt>
test   %rax,%rax
je     114a <consume_number+0x3a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1130 <consume_number+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @consume_number(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %9
br label %12
12: ; preds = %8, %1
br label %13
13: ; preds = %19, %12
%14 = load i8**, i8*** %2
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = call i64 @isdigit(i8 signext %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = load i8**, i8*** %2
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %20
br label %13
23: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @consume_number(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %6, i8** %0
%7 = load i8, i8* %6
br label %8
8: ; preds = %5, %1
%9 = phi i8 [ %7, %5 ], [ %3, %1 ]
%10 = tail call i64 @isdigit(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %8, %12
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %14, i8** %0
%15 = load i8, i8* %14
%16 = tail call i64 @isdigit(i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %12
18: ; preds = %12, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_units_typehdr(int, int);
void fgmvwrite_units_typehdr_(int *data_type, int numtypes) {
  gmvwrite_units_typehdr(*data_type, numtypes);
}


x86 assembly (clang, -O0):
<fgmvwrite_units_typehdr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <gmvwrite_units_typehdr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_units_typehdr_>:
mov    (%rdi),%edi
jmp    1030 <gmvwrite_units_typehdr@plt>

LLVM IR (-O0):
define void @fgmvwrite_units_typehdr_(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = call i32 @gmvwrite_units_typehdr(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_units_typehdr_(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @gmvwrite_units_typehdr(i32 %3, i32 %1)
ret void
}
int diff(char const *a, char const *b,
         char const *udata __attribute__((unused)),
         int uleng __attribute__((unused))) {
  return *(short const *)a - *(short const *)b;
}


x86 assembly (clang, -O0):
<diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
mov    -0x10(%rbp),%rcx
movswl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff>:
movswl (%rdi),%eax
movswl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @diff(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i16*
%11 = load i16, i16* %10
%12 = sext i16 %11 to i32
%13 = load i8*, i8** %6
%14 = bitcast i8* %13 to i16*
%15 = load i16, i16* %14
%16 = sext i16 %15 to i32
%17 = sub nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @diff(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2, i32 %3) {
%5 = bitcast i8* %0 to i16*
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = bitcast i8* %1 to i16*
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
unsigned int _am_dirlen(DIR *dp) {
  unsigned int dlen = 0;
  struct dirent *de;
  while ((de = readdir(dp)) != NULL)
    ++dlen;
  rewinddir(dp);
  return dlen - 2;
}


x86 assembly (clang, -O0):
<_am_dirlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1158 <_am_dirlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <_am_dirlen+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <rewinddir@plt>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_am_dirlen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xfffffffd,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <readdir@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <_am_dirlen+0x10>
mov    %r14,%rdi
call   1030 <rewinddir@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @_am_dirlen(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca %struct.dirent*
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %9, %1
%6 = load i32*, i32** %2
%7 = call %struct.dirent* @readdir(i32* %6)
store %struct.dirent* %7, %struct.dirent** %4
%8 = icmp ne %struct.dirent* %7, null
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = add i32 %10, 1
store i32 %11, i32* %3
br label %5
12: ; preds = %5
%13 = load i32*, i32** %2
%14 = call i32 @rewinddir(i32* %13)
%15 = load i32, i32* %3
%16 = sub i32 %15, 2
ret i32 %16
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @_am_dirlen(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = tail call %struct.dirent* @readdir(i32* %0)
%5 = icmp eq %struct.dirent* %4, null
%6 = add i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @rewinddir(i32* %0)
%9 = add i32 %3, -2
ret i32 %9
}
/* Variables and functions */
int read(int, char *, int);
int tun_read(int fd, char *buf, int len) { return read(fd, buf, len); }


x86 assembly (clang, -O0):
<tun_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @tun_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @tun_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}