xunge/DecIR huggingface dataset:
int ti_apo_start(double const *options) {
  (void)options;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @ti_apo_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
ret i32 1
}

LLVM IR (-O2):
define i32 @ti_apo_start(double* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_within_macro_3(int lhs, int rhs) {
  __emit_expression_range(0, lhs == rhs);
}


x86 assembly (clang, -O0):
<test_within_macro_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_within_macro_3>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
xor    %edi,%edi
mov    %eax,%esi
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_within_macro_3(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* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @__emit_expression_range(i32 0, i32 %8)
ret void
}

LLVM IR (-O2):
define void @test_within_macro_3(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @__emit_expression_range(i32 0, i32 %4)
ret void
}
/* Variables and functions */
int receive_data(int, int *, int);
int receive_int(int socket, int *i) {
  return receive_data(socket, i, sizeof(int));
}


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

x86 assembly (clang, -O2):
<receive_int>:
mov    $0x4,%edx
jmp    1030 <receive_data@plt>

LLVM IR (-O0):
define i32 @receive_int(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** %4
%7 = call i32 @receive_data(i32 %5, i32* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
define i32 @receive_int(i32 %0, i32* %1) {
%3 = tail call i32 @receive_data(i32 %0, i32* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
scalar_t__ roots_search(char *);
int roots_same(char *q, char *q2) {
  return roots_search(q) == roots_search(q2);
}


x86 assembly (clang, -O0):
<roots_same>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <roots_search@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <roots_search@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roots_same>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <roots_search@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <roots_search@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @roots_same(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @roots_search(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @roots_search(i8* %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @roots_same(i8* %0, i8* %1) {
%3 = tail call i64 @roots_search(i8* %0)
%4 = tail call i64 @roots_search(i8* %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ weightsDeallocatorOutputMomentum(int);
void weightsDeallocator() { weightsDeallocatorOutputMomentum(-1); }


x86 assembly (clang, -O0):
<weightsDeallocator>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <weightsDeallocatorOutputMomentum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<weightsDeallocator>:
mov    $0xffffffff,%edi
jmp    1030 <weightsDeallocatorOutputMomentum@plt>

LLVM IR (-O0):
define void @weightsDeallocator() {
%1 = call i32 @weightsDeallocatorOutputMomentum(i32 -1)
ret void
}

LLVM IR (-O2):
define void @weightsDeallocator() {
%1 = tail call i32 @weightsDeallocatorOutputMomentum(i32 -1)
ret void
}
void set_bit(int nr, volatile unsigned long *addr) {
  asm volatile(""
               "btsl %1,%0"
               : "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
bts    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @set_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btsl $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32_xxh32s_data(int /*<<< orphan*/ const *, size_t,
                                        uintptr_t);
uint32_t rgph_u32_xxh32s_u8a(const uint8_t *key, size_t len, uintptr_t seed) {
  return rgph_u32_xxh32s_data(key, len, seed);
}


x86 assembly (clang, -O0):
<rgph_u32_xxh32s_u8a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <rgph_u32_xxh32s_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32_xxh32s_u8a>:
jmp    1030 <rgph_u32_xxh32s_data@plt>

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

LLVM IR (-O2):
define i32 @rgph_u32_xxh32s_u8a(i32* %0, i64 %1, i64 %2) {
%4 = tail call i32 @rgph_u32_xxh32s_data(i32* %0, i64 %1, i64 %2)
ret i32 %4
}
void test_eh_return_data_regno() {
  volatile int res;
  res = __builtin_eh_return_data_regno(0);
  res = __builtin_eh_return_data_regno(1);
}


x86 assembly (clang, -O0):
<test_eh_return_data_regno>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eh_return_data_regno>:
movl   $0x0,-0x4(%rsp)
movl   $0x1,-0x4(%rsp)
ret

LLVM IR (-O0):
define void @test_eh_return_data_regno() {
%1 = alloca i32
store volatile i32 0, i32* %1
store volatile i32 1, i32* %1
ret void
}

LLVM IR (-O2):
define void @test_eh_return_data_regno() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
store volatile i32 1, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_color_raw(float f) {
  int i;
  i = (int)(f * 5.11);
  if (i < 256)
    printf("\x1b[38;2;255;%d;0m", i);
  else
    printf("\x1b[38;2;%d;255;0m", 511 - i);
}


x86 assembly (clang, -O0):
<print_color_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    115a <print_color_raw+0x4a>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <print_color_raw+0x5e>
mov    $0x1ff,%esi
sub    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_color_raw>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%esi
cmp    $0xff,%esi
jg     1134 <print_color_raw+0x24>
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>
mov    $0x1ff,%eax
sub    %esi,%eax
lea    0xed7(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\1B[38;2;255;%d;0m\00"
@.str.1 = [17 x i8] c"\1B[38;2;%d;255;0m\00"
define void @print_color_raw(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double %5, 5.110000e+00
%7 = fptosi double %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %17
13: ; preds = %1
%14 = load i32, i32* %3
%15 = sub nsw i32 511, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\1B[38;2;255;%d;0m\00"
@.str.1 = [17 x i8] c"\1B[38;2;%d;255;0m\00"
define void @print_color_raw(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 5.110000e+00
%4 = fptosi double %3 to i32
%5 = icmp slt i32 %4, 256
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %11
8: ; preds = %1
%9 = sub nsw i32 511, %4
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ paint_it(char const *, char *);
void blue(const char *string) { paint_it(string, "\x1b[0;34m"); }


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

x86 assembly (clang, -O2):
<blue>:
lea    0xee9(%rip),%rsi
jmp    1030 <paint_it@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;34m\00"
define void @blue(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @paint_it(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;34m\00"
define void @blue(i8* %0) {
%2 = tail call i32 @paint_it(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int fun829() { return 829; }


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

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

LLVM IR (-O0):
define i32 @fun829() {
ret i32 829
}

LLVM IR (-O2):
define i32 @fun829() {
ret i32 829
}
int array_isequal(const unsigned char data[], unsigned int size,
                  unsigned char value) {
  for (unsigned int i = 0; i < size; ++i) {
    if (data[i] != value)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<array_isequal>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1159 <array_isequal+0x59>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
movzbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
je     1146 <array_isequal+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1160 <array_isequal+0x60>
jmp    114b <array_isequal+0x4b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <array_isequal+0x17>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_isequal>:
test   %esi,%esi
je     113a <array_isequal+0x3a>
xor    %eax,%eax
cmp    %dl,(%rdi)
jne    1139 <array_isequal+0x39>
mov    %esi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rsi
cmp    %rax,%rcx
je     1131 <array_isequal+0x31>
lea    0x1(%rsi),%rax
cmp    %dl,(%rdi,%rsi,1)
je     1120 <array_isequal+0x20>
xor    %eax,%eax
cmp    %rcx,%rsi
setae  %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @array_isequal(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %25, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i32, i32* %8
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = icmp ne i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %13
store i32 0, i32* %4
br label %29
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add i32 %26, 1
store i32 %27, i32* %8
br label %9
28: ; preds = %9
store i32 1, i32* %4
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @array_isequal(i8* nocapture %0, i32 %1, i8 zeroext %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %20, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, %2
br i1 %8, label %9, label %20
9: ; preds = %5, %12
%10 = phi i64 [ %16, %12 ], [ 1, %5 ]
%11 = icmp eq i64 %10, %6
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, %2
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %9, label %17
17: ; preds = %9, %12
%18 = icmp uge i64 %10, %6
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %17, %5, %3
%21 = phi i32 [ 1, %3 ], [ 0, %5 ], [ %19, %17 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int reverse(int);
int main(int argc, const char *argv[]) {
  printf("Hello, World!\n");
  int mod = -12 / 10;
  printf("余数结果:%d\n", mod);
  int result = reverse(-2143847412);
  printf("反转之后的数字:%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x80377c0c,%edi
call   1030 <reverse@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef3(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x80377c0c,%edi
call   1030 <reverse@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@.str.1 = [17 x i8] c"\E4\BD\99\E6\95\B0\E7\BB\93\E6\9E\9C:%d\0A\00"
@.str.2 = [26 x i8] c"\E5\8F\8D\E8\BD\AC\E4\B9\8B\E5\90\8E\E7\9A\84\E6\95\B0\E5\AD\97:%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %6
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 @reverse(i32 -2143847412)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"\E4\BD\99\E6\95\B0\E7\BB\93\E6\9E\9C:%d\0A\00"
@.str.2 = [26 x i8] c"\E5\8F\8D\E8\BD\AC\E4\B9\8B\E5\90\8E\E7\9A\84\E6\95\B0\E5\AD\97:%d\0A\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 -1)
%5 = tail call i32 @reverse(i32 -2143847412)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct ftp_conn {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
void ftp_conn_abort_open_actv_data(struct ftp_conn *conn, int data) {
  close(data);
}


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

x86 assembly (clang, -O2):
<ftp_conn_abort_open_actv_data>:
mov    %esi,%edi
jmp    1030 <close@plt>

LLVM IR (-O0):
%struct.ftp_conn = type { i32 }
define void @ftp_conn_abort_open_actv_data(%struct.ftp_conn* %0, i32 %1) {
%3 = alloca %struct.ftp_conn*
%4 = alloca i32
store %struct.ftp_conn* %0, %struct.ftp_conn** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.ftp_conn = type { i32 }
define void @ftp_conn_abort_open_actv_data(%struct.ftp_conn* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @close(i32 %1)
ret void
}
int calc_gcd(int a, int b) {
  int temp = 0;
  while (b != 0) {
    temp = b;
    b = a % b;
    a = temp;
  }
  if (a == 0)
    a = 1;
  return a;
}


x86 assembly (clang, -O0):
<calc_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1136 <calc_gcd+0x36>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <calc_gcd+0x11>
cmpl   $0x0,-0x4(%rbp)
jne    1147 <calc_gcd+0x47>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <calc_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <calc_gcd+0x10>
jmp    111f <calc_gcd+0x1f>
mov    %eax,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_gcd(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 = srem 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 ]
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 1, i32 %10
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ test_12_4();
int /*<<< orphan*/ test_basic_2_2_2();
int /*<<< orphan*/ test_lrc_6_6_3();
int /*<<< orphan*/ test_lrc_6_6_3_count_all();
int /*<<< orphan*/ test_sources_2_2_2();
int main(int argc, char **argv) {
  test_basic_2_2_2();
  test_sources_2_2_2();
  test_12_4();
  test_lrc_6_6_3();
  test_lrc_6_6_3_count_all();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <test_basic_2_2_2@plt>
mov    $0x0,%al
call   1060 <test_sources_2_2_2@plt>
mov    $0x0,%al
call   1030 <test_12_4@plt>
mov    $0x0,%al
call   1040 <test_lrc_6_6_3@plt>
mov    $0x0,%al
call   1050 <test_lrc_6_6_3_count_all@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_basic_2_2_2@plt>
xor    %eax,%eax
call   1060 <test_sources_2_2_2@plt>
xor    %eax,%eax
call   1030 <test_12_4@plt>
xor    %eax,%eax
call   1040 <test_lrc_6_6_3@plt>
xor    %eax,%eax
call   1050 <test_lrc_6_6_3_count_all@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_basic_2_2_2()
%7 = call i32 (...) @test_sources_2_2_2()
%8 = call i32 (...) @test_12_4()
%9 = call i32 (...) @test_lrc_6_6_3()
%10 = call i32 (...) @test_lrc_6_6_3_count_all()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_basic_2_2_2()
%4 = tail call i32 (...) @test_sources_2_2_2()
%5 = tail call i32 (...) @test_12_4()
%6 = tail call i32 (...) @test_lrc_6_6_3()
%7 = tail call i32 (...) @test_lrc_6_6_3_count_all()
ret i32 0
}
/* Variables and functions */
int _linux_getkey(int, unsigned long);
unsigned kb_os_waitkey(void) { return _linux_getkey(1, (unsigned long)-1); }


x86 assembly (clang, -O0):
<kb_os_waitkey>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0xffffffffffffffff,%rsi
call   1030 <_linux_getkey@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_os_waitkey>:
mov    $0x1,%edi
mov    $0xffffffffffffffff,%rsi
jmp    1030 <_linux_getkey@plt>

LLVM IR (-O0):
define i32 @kb_os_waitkey() {
%1 = call i32 @_linux_getkey(i32 1, i64 -1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @kb_os_waitkey() {
%1 = tail call i32 @_linux_getkey(i32 1, i64 -1)
ret i32 %1
}
void pwrscale_sysfs_release(struct kobject *kobj) {}


x86 assembly (clang, -O0):
<pwrscale_sysfs_release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kobject = type opaque
define void @pwrscale_sysfs_release(%struct.kobject* %0) {
%2 = alloca %struct.kobject*
store %struct.kobject* %0, %struct.kobject** %2
ret void
}

LLVM IR (-O2):
%struct.kobject = type opaque
define void @pwrscale_sysfs_release(%struct.kobject* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void version(void) {
  fprintf(stderr, "\nTFTP Upgrade Client Version %s\n", "1.0.3");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xef6(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xefa(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"\0ATFTP Upgrade Client Version %s\0A\00"
@.str.1 = [6 x i8] c"1.0.3\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"\0ATFTP Upgrade Client Version %s\0A\00"
@.str.1 = [6 x i8] c"1.0.3\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ erfcl(long double);
int /*<<< orphan*/ link_failure_erfcl();
void test_erfcl(long double ld) {
  if (erfcl(ld) != erfcl(ld))
    link_failure_erfcl();
}


x86 assembly (clang, -O0):
<test_erfcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <erfcl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <erfcl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_erfcl+0x43>
mov    $0x0,%al
call   1040 <link_failure_erfcl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_erfcl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <erfcl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <erfcl@plt>
cmp    %rax,%rbx
jne    1151 <test_erfcl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_erfcl@plt>

LLVM IR (-O0):
define void @test_erfcl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @erfcl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @erfcl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_erfcl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_erfcl(x86_fp80 %0) {
%2 = tail call i64 @erfcl(x86_fp80 %0)
%3 = tail call i64 @erfcl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_erfcl()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_nth_fibonacci(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int n = 48;
  printf("\n\n------\n");
  printf("[c99] nth_fibonacci(%d)=%llu\n", n, get_nth_fibonacci(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x30,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <get_nth_fibonacci@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee6(%rip),%rdi
call   1040 <puts@plt>
mov    $0x30,%edi
call   1030 <get_nth_fibonacci@plt>
lea    0xeb2(%rip),%rdi
mov    $0x30,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0A\0A------\0A\00"
@.str.1 = [30 x i8] c"[c99] nth_fibonacci(%d)=%llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 48, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @get_nth_fibonacci(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"[c99] nth_fibonacci(%d)=%llu\0A\00"
@str = [9 x i8] c"\0A\0A------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @get_nth_fibonacci(i32 48)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 48, i32 %4)
ret i32 0
}
unsigned xrop3_222_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_222_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_222_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    $0xff,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_222_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_222_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void help(const char *argv0) {
  printf("Usage: %s [OPTIONS] [COMMAND] [ARGUMENT...]\n"
         "  -c                       execute COMMAND\n"
         "  -i                       make shell interactive\n"
         "  -m, -o monitor           enable job control\n"
         "  -o OPTION                enable OPTION\n"
         "  -s                       read from stdin\n"
         "      --help               display this help\n"
         "      --version            display version info\n",
         argv0);
}


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

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [361 x i8] c"Usage: %s [OPTIONS] [COMMAND] [ARGUMENT...]\0A -c execute COMMAND\0A -i make shell interactive\0A -m, -o monitor enable job control\0A -o OPTION enable OPTION\0A -s read from stdin\0A --help display this help\0A --version display version info\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [361 x i8] c"Usage: %s [OPTIONS] [COMMAND] [ARGUMENT...]\0A -c execute COMMAND\0A -i make shell interactive\0A -m, -o monitor enable job control\0A -o OPTION enable OPTION\0A -s read from stdin\0A --help display this help\0A --version display version info\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *realloc(int /*<<< orphan*/, int /*<<< orphan*/);
void reallocSizeZero4() {
  char *r = realloc(0, 0);
  free(r);
}


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

x86 assembly (clang, -O2):
<reallocSizeZero4>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @reallocSizeZero4() {
%1 = alloca i8*
%2 = call i8* @realloc(i32 0, i32 0)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @reallocSizeZero4() {
%1 = tail call i8* @realloc(i32 0, i32 0)
%2 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void calcNthTriangle(int n) {
  int i, triangularNumber = 0;
  for (i = 1; i <= n; i++)
    triangularNumber += i;
  printf("Triangular Number %i is %i\n", n, triangularNumber);
}


x86 assembly (clang, -O0):
<calcNthTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114c <calcNthTriangle+0x3c>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <calcNthTriangle+0x19>
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcNthTriangle>:
mov    %edi,%esi
test   %edi,%edi
jle    1135 <calcNthTriangle+0x25>
lea    -0x1(%rsi),%eax
lea    -0x2(%rsi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rsi,2),%edx
add    $0xffffffff,%edx
lea    0xed0(%rip),%rdi
jmp    1030 <printf@plt>
xor    %edx,%edx
lea    0xec2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Triangular Number %i is %i\0A\00"
define void @calcNthTriangle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 1, i32* %3
br label %5
5: ; preds = %13, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, %10
store i32 %12, i32* %4
br label %13
13: ; preds = %9
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %2
%18 = load i32, i32* %4
%19 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Triangular Number %i is %i\0A\00"
define void @calcNthTriangle(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
%16 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %15)
ret void
}
long BG_StringHashValue_Lwr(const char *fname) {
  int i;
  long hash;
  hash = 0;
  i = 0;
  while (fname[i] != '\0') {
    hash += (long)(fname[i]) * (i + 119);
    i++;
  }
  if (hash == -1) {
    hash = 0;
  }
  return hash;
}


x86 assembly (clang, -O0):
<BG_StringHashValue_Lwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <BG_StringHashValue_Lwr+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
mov    -0xc(%rbp),%ecx
add    $0x77,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <BG_StringHashValue_Lwr+0x17>
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    116f <BG_StringHashValue_Lwr+0x6f>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BG_StringHashValue_Lwr>:
mov    (%rdi),%dl
test   %dl,%dl
je     1133 <BG_StringHashValue_Lwr+0x33>
mov    $0x77,%eax
xor    %ecx,%ecx
nopl   (%rax)
movsbq %dl,%rdx
imul   %rax,%rdx
add    %rdx,%rcx
movzbl -0x76(%rdi,%rax,1),%edx
add    $0x1,%rax
test   %dl,%dl
jne    1110 <BG_StringHashValue_Lwr+0x10>
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rcx
cmovne %rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @BG_StringHashValue_Lwr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i64
%9 = add nuw nsw i64 %5, 119
%10 = mul nsw i64 %9, %8
%11 = add nsw i64 %10, %7
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = icmp eq i64 %11, -1
%18 = select i1 %17, i64 0, i64 %11
br label %19
19: ; preds = %16, %1
%20 = phi i64 [ 0, %1 ], [ %18, %16 ]
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ saa7114_write_reg(int, unsigned char);
int saa7114_set_decoder_analog_input(unsigned char input) {
  saa7114_write_reg(0x02, input);
  return (0);
}


x86 assembly (clang, -O0):
<saa7114_set_decoder_analog_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
movzbl -0x1(%rbp),%esi
call   1030 <saa7114_write_reg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saa7114_set_decoder_analog_input>:
push   %rax
mov    %edi,%esi
mov    $0x2,%edi
call   1030 <saa7114_write_reg@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @saa7114_set_decoder_analog_input(i8 zeroext %0) {
%2 = tail call i32 @saa7114_write_reg(i32 2, i8 zeroext %0)
ret i32 0
}
char num_to_digit(unsigned int num) {
  if (num < 10) {
    return '0' + num;
  } else
    return '?';
}


x86 assembly (clang, -O0):
<num_to_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    111f <num_to_digit+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1123 <num_to_digit+0x23>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_to_digit>:
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
movzbl %al,%ecx
mov    $0x3f,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @num_to_digit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %11
10: ; preds = %1
store i8 63, i8* %2
br label %11
11: ; preds = %10, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @num_to_digit(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 48
%5 = select i1 %2, i8 %4, i8 63
ret i8 %5
}
void func4(void) {
  asm("    .global "
      "set_tracepoint"
      "\n"
      "set_tracepoint"
      ":\n"
      "    call "
      "func5"
      "\n");
}


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

x86 assembly (clang, -O2):
<func4>:
call   1030 <func5@plt>
ret

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

LLVM IR (-O2):
define void @func4() {
tail call void asm sideeffect " .global set_tracepoint\0Aset_tracepoint:\0A call func5\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void clearcache(void *a, unsigned size) {}


x86 assembly (clang, -O0):
<clearcache>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @clearcache(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @clearcache(i8* nocapture %0, i32 %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int bytes_per_line;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_bytes_per_line(void *_p, int _v) {
  ((XImage *)_p)->bytes_per_line = (int)_v;
}


x86 assembly (clang, -O0):
<set_XImage_bytes_per_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XImage_bytes_per_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_bytes_per_line(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void unknown_symbol(void) { printf("unknown symbol in advapi32 called\n"); }


x86 assembly (clang, -O0):
<unknown_symbol>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_symbol>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"unknown symbol in advapi32 called\0A\00"
define void @unknown_symbol() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"unknown symbol in advapi32 called\00"
define void @unknown_symbol() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert((3 && 2) == 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void in(int d) {
  while (d-- > 0)
    putchar('\t');
}


x86 assembly (clang, -O0):
<in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    113e <in+0x2e>
mov    $0x9,%edi
call   1030 <putchar@plt>
jmp    111b <in+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in>:
push   %rbx
test   %edi,%edi
jle    1132 <in+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <in+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @in(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 9)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @in(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 9)
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
void disable_interrupts() { __asm__ __volatile__("cli"); }


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

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

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

LLVM IR (-O2):
define void @disable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x99() {
  Assert_real((islower(153) == 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_islower.c",
              770, ("islower should be 0 for 0x99"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x99>:
push   %rax
mov    $0x99,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x302,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x99\00"
define void @t_islower_0x99() {
%1 = call i64 @islower(i32 153)
%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 770, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x99\00"
define void @t_islower_0x99() {
%1 = tail call i64 @islower(i32 153)
%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 770, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}