xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int64_t;
typedef size_t int32_t;

/* Variables and functions */
int64_t fix_utils_lpow10(int32_t n) {
  static int64_t arr[19] = {1,
                            10,
                            100,
                            1000,
                            10000,
                            100000,
                            1000000,
                            10000000,
                            100000000,
                            1000000000,
                            10000000000,
                            100000000000,
                            1000000000000,
                            10000000000000,
                            100000000000000,
                            1000000000000000,
                            10000000000000000,
                            100000000000000000,
                            1000000000000000000};
  return arr[n];
}


x86 assembly (clang, -O0):
<fix_utils_lpow10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0x2f1d(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_utils_lpow10>:
lea    0xef9(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@fix_utils_lpow10.arr = internal global [19 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000, i32 1410065408, i32 1215752192, i32 -727379968, i32 1316134912, i32 276447232, i32 -1530494976, i32 1874919424, i32 1569325056, i32 -1486618624]
define i32 @fix_utils_lpow10(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds [19 x i32], [19 x i32]* @fix_utils_lpow10.arr, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
@fix_utils_lpow10.arr = internal unnamed_addr constant [19 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000, i32 1410065408, i32 1215752192, i32 -727379968, i32 1316134912, i32 276447232, i32 -1530494976, i32 1874919424, i32 1569325056, i32 -1486618624]
define i32 @fix_utils_lpow10(i64 %0) {
%2 = getelementptr inbounds [19 x i32], [19 x i32]* @fix_utils_lpow10.arr, i64 0, i64 %0
%3 = load i32, i32* %2
ret i32 %3
}
int foo(int a) { return 42 + a; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x2a(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 42, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 42
ret i32 %2
}
void glDrawElements(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDrawElements() {
ret void
}
void f2() {
  int i;
  for (i = 10; i > 0; i--) {
    ;
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1128 <f2+0x28>
jmp    111a <f2+0x1a>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f2+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f2() {
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Wed May 27 15:17:43 IST 2015 BUILD=debug "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


x86 assembly (clang, -O0):
<__malidrv_build_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__malidrv_build_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [344 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed May 27 15:17:43 IST 2015 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [344 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Wed May 27 15:17:43 IST 2015 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ *_system_property_find2(char const *);
scalar_t__ init_resetprop();
int prop_exist(const char *name) {
  if (init_resetprop())
    return 0;
  return _system_property_find2(name) != NULL;
}


x86 assembly (clang, -O0):
<prop_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <init_resetprop@plt>
cmp    $0x0,%rax
je     1149 <prop_exist+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1161 <prop_exist+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <_system_property_find2@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prop_exist>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <init_resetprop@plt>
test   %rax,%rax
jne    1145 <prop_exist+0x25>
mov    %r14,%rdi
call   1030 <_system_property_find2@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prop_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @init_resetprop()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32* @_system_property_find2(i8* %8)
%10 = icmp ne i32* %9, null
%11 = zext i1 %10 to i32
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @prop_exist(i8* %0) {
%2 = tail call i64 (...) @init_resetprop()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32* @_system_property_find2(i8* %0)
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fin_connection(int /*<<< orphan*/ *, char *);
void my_fgets(char *buf, int size, FILE *stream) {
  if (!fgets(buf, size - 1, stream))
    fin_connection(stream, "echec de fgets");
}


x86 assembly (clang, -O0):
<my_fgets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%eax
jne    115f <my_fgets+0x3f>
mov    -0x18(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1040 <fin_connection@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fgets>:
push   %rbx
mov    %rdx,%rbx
add    $0xffffffff,%esi
call   1030 <fgets@plt>
test   %eax,%eax
je     1132 <my_fgets+0x12>
pop    %rbx
ret
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fin_connection@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"echec de fgets\00"
define void @my_fgets(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i32*, i32** %6
%11 = call i32 @fgets(i8* %7, i32 %9, i32* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %3
%14 = load i32*, i32** %6
%15 = call i32 @fin_connection(i32* %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"echec de fgets\00"
define void @my_fgets(i8* %0, i32 %1, i32* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @fgets(i8* %0, i32 %4, i32* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @fin_connection(i32* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt3();
int /*<<< orphan*/ unknown();
int test25() { 1 ? halt3() : unknown(); }


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

x86 assembly (clang, -O2):
<test25>:
xor    %eax,%eax
jmp    1030 <halt3@plt>

LLVM IR (-O0):
define i32 @test25() {
%1 = alloca i32
%2 = call i32 (...) @halt3()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test25() {
%1 = tail call i32 (...) @halt3()
ret i32 undef
}
int tmq_start(struct tmq *tmq __attribute__((unused))) { return -1; }


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

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

LLVM IR (-O0):
%struct.tmq = type opaque
define i32 @tmq_start(%struct.tmq* %0) {
%2 = alloca %struct.tmq*
store %struct.tmq* %0, %struct.tmq** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.tmq = type opaque
define i32 @tmq_start(%struct.tmq* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
void *malloc(int);
void *_malloc_r(struct _reent *ptr, int size) { return malloc(size); }


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

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

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_malloc_r(%struct._reent* %0, i32 %1) {
%3 = alloca %struct._reent*
%4 = alloca i32
store %struct._reent* %0, %struct._reent** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i8* @malloc(i32 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define noalias i8* @_malloc_r(%struct._reent* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
ret i8* %3
}
void assert_equal(expected, result) {
  if (expected == result) {
    printf("OK\n");
  } else {
    printf("NG\n");
  }
}


x86 assembly (clang, -O0):
<assert_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113d <assert_equal+0x2d>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114b <assert_equal+0x3b>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal>:
cmp    %esi,%edi
lea    0xeea(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
@.str.1 = [4 x i8] c"NG\0A\00"
define void @assert_equal(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
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"NG\00"
@str.2 = [3 x i8] c"OK\00"
define void @assert_equal(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void forceKill() {
  clearScreen();
  printf("\n\nYou've just destroyed the world. But the Good always win, don't "
         "forget it.\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<forceKill>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clearScreen@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<forceKill>:
push   %rax
xor    %eax,%eax
call   1040 <clearScreen@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [79 x i8] c"\0A\0AYou've just destroyed the world. But the Good always win, don't forget it.\0A\0A\00"
define void @forceKill() {
%1 = call i32 (...) @clearScreen()
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [78 x i8] c"\0A\0AYou've just destroyed the world. But the Good always win, don't forget it.\0A\00"
define void @forceKill() {
%1 = tail call i32 (...) @clearScreen()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ dispose(struct list *);
int list_length(struct list *);
int main2(struct list *l) {
  int tmp = list_length(l);
  assert(0 <= tmp);
  dispose(l);
  return 0;
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_length@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dispose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
push   %rbx
mov    %rdi,%rbx
call   1050 <list_length@plt>
not    %eax
shr    $0x1f,%eax
mov    %eax,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <dispose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @main2(%struct.list* %0) {
%2 = alloca %struct.list*
%3 = alloca i32
store %struct.list* %0, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call i32 @list_length(%struct.list* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 0, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load %struct.list*, %struct.list** %2
%11 = call i32 @dispose(%struct.list* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @main2(%struct.list* %0) {
%2 = tail call i32 @list_length(%struct.list* %0)
%3 = xor i32 %2, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @dispose(%struct.list* %0)
ret i32 0
}
int _dist_(pos1, pos2, lx)
int pos1;
int pos2;
int lx;
{
  int dx = (pos1 % lx) - (pos2 % lx);
  int dy = (pos1 / lx) - (pos2 / lx);
  return dx * dx + dy * dy;
}


x86 assembly (clang, -O0):
<_dist_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
mov    -0x1c(%rbp),%edx
sub    %eax,%edx
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dist_>:
mov    %edx,%ecx
mov    %esi,%r8d
mov    %edi,%eax
cltd
idiv   %ecx
mov    %edx,%edi
mov    %eax,%esi
mov    %r8d,%eax
cltd
idiv   %ecx
sub    %edx,%edi
sub    %eax,%esi
imul   %edi,%edi
imul   %esi,%esi
add    %edi,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @_dist_(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* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %6
%11 = srem i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = srem i32 %12, %13
%15 = sub nsw i32 %11, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = sdiv i32 %16, %17
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = sdiv i32 %19, %20
%22 = sub nsw i32 %18, %21
store i32 %22, i32* %8
%23 = load i32, i32* %7
%24 = load i32, i32* %7
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %8
%27 = load i32, i32* %8
%28 = mul nsw i32 %26, %27
%29 = add nsw i32 %25, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @_dist_(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %0, %2
%5 = srem i32 %1, %2
%6 = sub nsw i32 %4, %5
%7 = sdiv i32 %0, %2
%8 = sdiv i32 %1, %2
%9 = sub nsw i32 %7, %8
%10 = mul nsw i32 %6, %6
%11 = mul nsw i32 %9, %9
%12 = add nuw nsw i32 %11, %10
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32r16(uint32_t x) { return (x << 16) | (x >> 16); }


x86 assembly (clang, -O0):
<rot32r16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32r16>:
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32r16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32r16(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr i32 %0, 16
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
float sinf(float);
float IvSin(float a) { return sinf(a); }


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

x86 assembly (clang, -O2):
<IvSin>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @IvSin(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
uint8_t rc5_get_preferred_block_size(void) { return (8U); }


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

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

LLVM IR (-O0):
define i32 @rc5_get_preferred_block_size() {
ret i32 8
}

LLVM IR (-O2):
define i32 @rc5_get_preferred_block_size() {
ret i32 8
}
void av_hash_get_size() {}


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

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

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

LLVM IR (-O2):
define void @av_hash_get_size() {
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRA4_set(void) { return U_WMRCORENONE_set("U_WMRA4"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA4\00"
define i8* @U_WMRA4_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA4\00"
define i8* @U_WMRA4_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
TR_CLASSVARS_DECL(TR_Logger) {}


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

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

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

LLVM IR (-O2):
define i32 @TR_CLASSVARS_DECL(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
multiply(int a, int b) {
  int c;
  c = a * b;
  printf("The result is %d", c);
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
imul   %edi,%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"The result is %d\00"
define i32 @multiply(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [17 x i8] c"The result is %d\00"
define i32 @multiply(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 undef
}
int y(void) {
  int b, a;
  b = 1;
  a = b;
  b = 2;
  return a;
}


x86 assembly (clang, -O0):
<y>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x2,-0x4(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @y() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void mod_websocket_tcp_server_disconnect(int sockfd) {
  close(sockfd);
  return;
}


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

x86 assembly (clang, -O2):
<mod_websocket_tcp_server_disconnect>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @mod_websocket_tcp_server_disconnect(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void led_config(void) {
  *(volatile uint16_t *)0x40023830 = 0x08;
  *(volatile uint32_t *)0x40020c00 = 0x04000000;
}


x86 assembly (clang, -O0):
<led_config>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40023830,%eax
movl   $0x8,(%rax)
mov    $0x40020c00,%eax
movl   $0x4000000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_config>:
movl   $0x8,0x40023830
movl   $0x4000000,0x40020c00
ret

LLVM IR (-O0):
define void @led_config() {
store volatile i32 8, i32* inttoptr (i64 1073887280 to i32*)
store volatile i32 67108864, i32* inttoptr (i64 1073875968 to i32*)
ret void
}

LLVM IR (-O2):
define void @led_config() {
store volatile i32 8, i32* inttoptr (i64 1073887280 to i32*)
store volatile i32 67108864, i32* inttoptr (i64 1073875968 to i32*)
ret void
}
signed int _moduschar(unsigned char x, unsigned char y) {
  return ((int)((signed char)x) % (int)y);
}


x86 assembly (clang, -O0):
<_moduschar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_moduschar>:
movsbl %dil,%eax
cwtd
idiv   %si
movswl %dx,%eax
ret

LLVM IR (-O0):
define i32 @_moduschar(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = srem i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_moduschar(i8 zeroext %0, i8 zeroext %1) {
%3 = sext i8 %0 to i16
%4 = zext i8 %1 to i16
%5 = srem i16 %3, %4
%6 = sext i16 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("/usr/bin/gcc ./Main.c -lm -o Main 2>error.log");
  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)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"/usr/bin/gcc ./Main.c -lm -o Main 2>error.log\00"
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 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"/usr/bin/gcc ./Main.c -lm -o Main 2>error.log\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct b_preamp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct b_preamp *);
void freePreamp(void *pa) {
  struct b_preamp *pp = (struct b_preamp *)pa;
  free(pp);
}


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

x86 assembly (clang, -O2):
<freePreamp>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.b_preamp = type { i32 }
define void @freePreamp(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.b_preamp*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.b_preamp*
store %struct.b_preamp* %5, %struct.b_preamp** %3
%6 = load %struct.b_preamp*, %struct.b_preamp** %3
%7 = call i32 @free(%struct.b_preamp* %6)
ret void
}

LLVM IR (-O2):
%struct.b_preamp = type { i32 }
define void @freePreamp(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.b_preamp*
%3 = tail call i32 @free(%struct.b_preamp* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
int event(char *action, char *devpath, void *data) {
  fprintf((FILE *)data, "%s@%s\n", action, devpath);
  return 0;
}


x86 assembly (clang, -O0):
<event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rax
lea    0xee2(%rip),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s@%s\0A\00"
define i32 @event(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to i32*
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s@%s\0A\00"
define i32 @event(i8* %0, i8* %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ mpop();
int /*<<< orphan*/ mpush(scalar_t__);
void oneplus() { mpush(mpop() + 1); }


x86 assembly (clang, -O0):
<oneplus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mpop@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1040 <mpush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oneplus>:
push   %rax
xor    %eax,%eax
call   1030 <mpop@plt>
lea    0x1(%rax),%rdi
pop    %rax
jmp    1040 <mpush@plt>

LLVM IR (-O0):
define void @oneplus() {
%1 = call i64 (...) @mpop()
%2 = add nsw i64 %1, 1
%3 = call i32 @mpush(i64 %2)
ret void
}

LLVM IR (-O2):
define void @oneplus() {
%1 = tail call i64 (...) @mpop()
%2 = add nsw i64 %1, 1
%3 = tail call i32 @mpush(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ evdns_requests_pump_waiting_queue();
int evdns_resume(void) {
  evdns_requests_pump_waiting_queue();
  return 0;
}


x86 assembly (clang, -O0):
<evdns_resume>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <evdns_requests_pump_waiting_queue@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @evdns_resume() {
%1 = call i32 (...) @evdns_requests_pump_waiting_queue()
ret i32 0
}

LLVM IR (-O2):
define i32 @evdns_resume() {
%1 = tail call i32 (...) @evdns_requests_pump_waiting_queue()
ret i32 0
}
/* Type definitions */
struct mali_l2_cache_core {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mali_pm_unlock();
void mali_l2_cache_unlock_power_state(struct mali_l2_cache_core *cache) {
  mali_pm_unlock();
}


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

x86 assembly (clang, -O2):
<mali_l2_cache_unlock_power_state>:
xor    %eax,%eax
jmp    1030 <mali_pm_unlock@plt>

LLVM IR (-O0):
%struct.mali_l2_cache_core = type { i32 }
define void @mali_l2_cache_unlock_power_state(%struct.mali_l2_cache_core* %0) {
%2 = alloca %struct.mali_l2_cache_core*
store %struct.mali_l2_cache_core* %0, %struct.mali_l2_cache_core** %2
%3 = call i32 (...) @mali_pm_unlock()
ret void
}

LLVM IR (-O2):
%struct.mali_l2_cache_core = type { i32 }
define void @mali_l2_cache_unlock_power_state(%struct.mali_l2_cache_core* nocapture readnone %0) {
%2 = tail call i32 (...) @mali_pm_unlock()
ret void
}
/* Variables and functions */
char *dup_unquote_string(char const *, char);
char *strdup(char const *);
char *dup_unquote_string_ifquoted(const char *qstring, char qchar) {
  if (qstring[0] == qchar)
    return dup_unquote_string(qstring, qchar);
  else
    return strdup(qstring);
}


x86 assembly (clang, -O0):
<dup_unquote_string_ifquoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    115b <dup_unquote_string_ifquoted+0x3b>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <dup_unquote_string@plt>
mov    %rax,-0x8(%rbp)
jmp    1168 <dup_unquote_string_ifquoted+0x48>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup_unquote_string_ifquoted>:
cmp    %sil,(%rdi)
jne    112e <dup_unquote_string_ifquoted+0xe>
movsbl %sil,%esi
jmp    1030 <dup_unquote_string@plt>
jmp    1040 <strdup@plt>

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

LLVM IR (-O2):
define i8* @dup_unquote_string_ifquoted(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @dup_unquote_string(i8* %0, i8 signext %1)
br label %9
7: ; preds = %2
%8 = tail call i8* @strdup(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sunxi_gpio_cleanup();
void sig_handler(int signo) {
  if (signo == SIGINT) {
    printf("handle SIGINT\n");
    sunxi_gpio_cleanup();
    exit(1);
  }
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    116a <sig_handler+0x3a>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <sunxi_gpio_cleanup@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
je     113e <sig_handler+0xe>
pop    %rax
ret
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <sunxi_gpio_cleanup@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [15 x i8] c"handle SIGINT\0A\00"
define void @sig_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @sunxi_gpio_cleanup()
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [14 x i8] c"handle SIGINT\00"
define void @sig_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @sunxi_gpio_cleanup()
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_close();
scalar_t__ i2c_hum();
int /*<<< orphan*/ i2c_init();
scalar_t__ i2c_temp();
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  i2c_init();
  printf("%3.1f ", ((float)i2c_temp()) / 10.);
  printf("%3.1f\n", ((float)i2c_hum()) / 10.);
  i2c_close();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <i2c_init@plt>
mov    $0x0,%al
call   1050 <i2c_temp@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe82(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <i2c_hum@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe56(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <i2c_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <i2c_init@plt>
xor    %eax,%eax
call   1050 <i2c_temp@plt>
cvtsi2ss %rax,%xmm0
divss  0xe94(%rip),%xmm0
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <i2c_hum@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  0xe71(%rip),%xmm0
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1070 <i2c_close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%3.1f \00"
@.str.1 = [7 x i8] c"%3.1f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @i2c_init()
%3 = call i64 (...) @i2c_temp()
%4 = sitofp i64 %3 to float
%5 = fpext float %4 to double
%6 = fdiv double %5, 1.000000e+01
%7 = fptrunc double %6 to float
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %7)
%9 = call i64 (...) @i2c_hum()
%10 = sitofp i64 %9 to float
%11 = fpext float %10 to double
%12 = fdiv double %11, 1.000000e+01
%13 = fptrunc double %12 to float
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %13)
%15 = call i32 (...) @i2c_close()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%3.1f \00"
@.str.1 = [7 x i8] c"%3.1f\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @i2c_init()
%2 = tail call i64 (...) @i2c_temp()
%3 = sitofp i64 %2 to float
%4 = fdiv float %3, 1.000000e+01
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %4)
%6 = tail call i64 (...) @i2c_hum()
%7 = sitofp i64 %6 to float
%8 = fdiv float %7, 1.000000e+01
%9 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %8)
%10 = tail call i32 (...) @i2c_close()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("This is a demo!\n");
  printf("Added to check Strider.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"This is a demo!\0A\00"
@.str.1 = [25 x i8] c"Added to check Strider.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"This is a demo!\00"
@str.2 = [24 x i8] c"Added to check Strider.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int tlsext_sigalgs_serverhello_needs(SSL *s) { return 0; }


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

x86 assembly (clang, -O2):
<tlsext_sigalgs_serverhello_needs>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tlsext_sigalgs_serverhello_needs(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int primeFactors(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int stevilo;
  scanf("%d", &stevilo);
  if (primeFactors(stevilo) == 2)
    printf("Y \n");
  else
    printf("N \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <primeFactors@plt>
cmp    $0x2,%eax
jne    1171 <main+0x41>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x4d>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <primeFactors@plt>
cmp    $0x2,%eax
lea    0xeb1(%rip),%rax
lea    0xea7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"Y \0A\00"
@.str.2 = [4 x i8] c"N \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @primeFactors(i32 %4)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"N \00"
@str.3 = [3 x i8] c"Y \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @primeFactors(i32 %4)
%6 = icmp eq i32 %5, 2
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *name) {
  printf("%s NAME\n", name);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%s NAME\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int socketcall(int (*)(int, struct sockaddr const *, int /*<<< orphan*/), int,
               struct sockaddr const *, int /*<<< orphan*/, int /*<<< orphan*/,
               int /*<<< orphan*/, int /*<<< orphan*/);
int bind(int fd, const struct sockaddr *addr, socklen_t len) {
  return socketcall(bind, fd, addr, len, 0, 0, 0);
}


x86 assembly (clang, -O0):
<bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    0x2eb5(%rip),%rdi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2ec2(%rip),%rdi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <socketcall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32, i32* %6
%10 = call i32 @socketcall(i32 (i32, %struct.sockaddr*, i32)* @bind, i32 %7, %struct.sockaddr* %8, i32 %9, i32 0, i32 0, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @socketcall(i32 (i32, %struct.sockaddr*, i32)* @bind, i32 %0, %struct.sockaddr* %1, i32 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SysCtlClockSet(int);
int main(void) {
  SysCtlClockSet(0x04C00000 | 0x00000000 | 0x00000000 | 0x00000540);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @SysCtlClockSet(i32 79693120)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void handler_sigchld(int sig) {
  sig = sig;
  wait(NULL);
  return;
}


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

x86 assembly (clang, -O2):
<handler_sigchld>:
xor    %edi,%edi
jmp    1030 <wait@plt>

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

LLVM IR (-O2):
define void @handler_sigchld(i32 %0) {
%2 = tail call i32 @wait(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ YabauseStopSlave();
void SmpcSSHOFF() { YabauseStopSlave(); }


x86 assembly (clang, -O0):
<SmpcSSHOFF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <YabauseStopSlave@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SmpcSSHOFF>:
xor    %eax,%eax
jmp    1030 <YabauseStopSlave@plt>

LLVM IR (-O0):
define void @SmpcSSHOFF() {
%1 = call i32 (...) @YabauseStopSlave()
ret void
}

LLVM IR (-O2):
define void @SmpcSSHOFF() {
%1 = tail call i32 (...) @YabauseStopSlave()
ret void
}