xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ *ENGINE_get_first();
int /*<<< orphan*/ *ENGINE_get_next(int /*<<< orphan*/ *);
int /*<<< orphan*/ ENGINE_register_complete(int /*<<< orphan*/ *);
int ENGINE_register_all_complete(void) {
  ENGINE *e;
  for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e))
    ENGINE_register_complete(e);
  return 1;
}


x86 assembly (clang, -O0):
<ENGINE_register_all_complete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ENGINE_get_first@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <ENGINE_register_all_complete+0x39>
mov    -0x8(%rbp),%rdi
call   1040 <ENGINE_register_complete@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ENGINE_get_next@plt>
mov    %rax,-0x8(%rbp)
jmp    1143 <ENGINE_register_all_complete+0x13>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENGINE_register_all_complete>:
push   %rbx
xor    %eax,%eax
call   1050 <ENGINE_get_first@plt>
test   %rax,%rax
je     1158 <ENGINE_register_all_complete+0x28>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1040 <ENGINE_register_complete@plt>
mov    %rbx,%rdi
call   1030 <ENGINE_get_next@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <ENGINE_register_all_complete+0x10>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ENGINE_register_all_complete() {
%1 = alloca i32*
%2 = call i32* (...) @ENGINE_get_first()
store i32* %2, i32** %1
br label %3
3: ; preds = %9, %0
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32*, i32** %1
%8 = call i32 @ENGINE_register_complete(i32* %7)
br label %9
9: ; preds = %6
%10 = load i32*, i32** %1
%11 = call i32* @ENGINE_get_next(i32* %10)
store i32* %11, i32** %1
br label %3
12: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
define i32 @ENGINE_register_all_complete() {
%1 = tail call i32* (...) @ENGINE_get_first()
%2 = icmp eq i32* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32* [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @ENGINE_register_complete(i32* %4)
%6 = tail call i32* @ENGINE_get_next(i32* %4)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret i32 1
}
int search_linear(int *array, int key, int start, int end) {
  int i;
  for (i = start; i < end; i++) {
    if (array[i] == key)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<search_linear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1155 <search_linear+0x55>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1142 <search_linear+0x42>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <search_linear+0x5c>
jmp    1147 <search_linear+0x47>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1117 <search_linear+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_linear>:
mov    $0xffffffff,%eax
cmp    %ecx,%edx
jge    111f <search_linear+0x1f>
movslq %edx,%r8
lea    (%rdi,%r8,4),%rdi
cmp    %esi,(%rdi)
je     1120 <search_linear+0x20>
add    $0x1,%edx
add    $0x4,%rdi
cmp    %edx,%ecx
jne    1110 <search_linear+0x10>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @search_linear(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %2, %3
br i1 %5, label %6, label %19
6: ; preds = %4
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %6, %13
%9 = phi i64 [ %7, %6 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %1
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = add nsw i64 %9, 1
%15 = trunc i64 %14 to i32
%16 = icmp eq i32 %15, %3
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %13, %17, %4
%20 = phi i32 [ -1, %4 ], [ %18, %17 ], [ -1, %13 ]
ret i32 %20
}
int sub2(int i, int j, long l) { return !l ? i : j; }


x86 assembly (clang, -O0):
<sub2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <sub2+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <sub2+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub2>:
mov    %edi,%eax
test   %rdx,%rdx
cmovne %esi,%eax
ret

LLVM IR (-O0):
define i32 @sub2(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = load i32, i32* %4
br label %13
11: ; preds = %3
%12 = load i32, i32* %5
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @sub2(i32 %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = select i1 %4, i32 %0, i32 %1
ret i32 %5
}
/* Variables and functions */
float __builtin_allegrex_sqrt_s(float);
float pspFpuRsqrt(float fs) { return (1.0f / __builtin_allegrex_sqrt_s(fs)); }


x86 assembly (clang, -O0):
<pspFpuRsqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_allegrex_sqrt_s@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pspFpuRsqrt>:
push   %rax
call   1030 <__builtin_allegrex_sqrt_s@plt>
movss  0xee2(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @pspFpuRsqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @__builtin_allegrex_sqrt_s(float %3)
%5 = fdiv float 1.000000e+00, %4
ret float %5
}

LLVM IR (-O2):
define float @pspFpuRsqrt(float %0) {
%2 = tail call float @__builtin_allegrex_sqrt_s(float %0)
%3 = fdiv float 1.000000e+00, %2
ret float %3
}
/* Variables and functions */
char *tmpnam(char *);
char *c_tmpnam(char *arg0) { return tmpnam(arg0); }


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

x86 assembly (clang, -O2):
<c_tmpnam>:
jmp    1030 <tmpnam@plt>

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

LLVM IR (-O2):
define i8* @c_tmpnam(i8* %0) {
%2 = tail call i8* @tmpnam(i8* %0)
ret i8* %2
}
void _exit(void) {
  __asm__("mov $0x01, %eax");
  __asm__("int $0x82");
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
int    $0x82

x86 assembly (clang, -O2):
<_exit>:
mov    $0x1,%eax
int    $0x82

LLVM IR (-O0):
define void @_exit() {
unreachable
}

LLVM IR (-O2):
define void @_exit() {
tail call void asm sideeffect "mov $$0x01, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x82", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ kernel_sema_init();
int /*<<< orphan*/ kernel_thread_init();
int /*<<< orphan*/ printf(char *);
void kernel_init() {
  printf("Init: kernel\n\r");
  kernel_thread_init();
  kernel_sema_init();
}


x86 assembly (clang, -O0):
<kernel_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <kernel_thread_init@plt>
mov    $0x0,%al
call   1040 <kernel_sema_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_init>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <kernel_thread_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <kernel_sema_init@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Init: kernel\0A\0D\00"
define void @kernel_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @kernel_thread_init()
%3 = call i32 (...) @kernel_sema_init()
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Init: kernel\0A\0D\00"
define void @kernel_init() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @kernel_thread_init()
%3 = tail call i32 (...) @kernel_sema_init()
ret void
}
/* Type definitions */
struct device_d {
  int dummy;
};

/* Variables and functions */
struct device_d *add_generic_device_res(char *, int, int /*<<< orphan*/,
                                        int /*<<< orphan*/, void *);
struct device_d *add_gpio_keys_device(int id, void *pdata) {
  return add_generic_device_res("gpio_keys", id, 0, 0, pdata);
}


x86 assembly (clang, -O0):
<add_gpio_keys_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%r8
lea    0xed3(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <add_generic_device_res@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_gpio_keys_device>:
mov    %rsi,%r8
mov    %edi,%esi
lea    0xee4(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <add_generic_device_res@plt>

LLVM IR (-O0):
%struct.device_d = type { i32 }
@.str = [10 x i8] c"gpio_keys\00"
define %struct.device_d* @add_gpio_keys_device(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call %struct.device_d* @add_generic_device_res(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 0, i32 0, i8* %6)
ret %struct.device_d* %7
}

LLVM IR (-O2):
%struct.device_d = type { i32 }
@.str = [10 x i8] c"gpio_keys\00"
define %struct.device_d* @add_gpio_keys_device(i32 %0, i8* %1) {
%3 = tail call %struct.device_d* @add_generic_device_res(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0, i8* %1)
ret %struct.device_d* %3
}
int finalise(struct dynref__obj *const p) {}


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

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

LLVM IR (-O0):
%struct.dynref__obj = type opaque
define i32 @finalise(%struct.dynref__obj* %0) {
%2 = alloca i32
%3 = alloca %struct.dynref__obj*
store %struct.dynref__obj* %0, %struct.dynref__obj** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.dynref__obj = type opaque
define i32 @finalise(%struct.dynref__obj* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ consolestr(char *);
void vmemDumpStack() { consolestr("STACK\n-----\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"STACK\0A-----\0A\00"
define void @vmemDumpStack() {
%1 = call i32 @consolestr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"STACK\0A-----\0A\00"
define void @vmemDumpStack() {
%1 = tail call i32 @consolestr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __builtin_wrpie(int);
int foo(int a) {
  int b;
  b = __builtin_wrpie(a);
  a = __builtin_wrpie(b);
  return a + b;
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
call   1030 <__builtin_wrpie@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <__builtin_wrpie@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @__builtin_wrpie(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @__builtin_wrpie(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @__builtin_wrpie(i32 %0)
%3 = tail call i32 @__builtin_wrpie(i32 %2)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CameraDesiredHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void CameraDesiredRequestUpdate() {
  UAVObjRequestUpdate(CameraDesiredHandle());
}


x86 assembly (clang, -O0):
<CameraDesiredRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CameraDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraDesiredRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <CameraDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @CameraDesiredRequestUpdate() {
%1 = call i32 (...) @CameraDesiredHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @CameraDesiredRequestUpdate() {
%1 = tail call i32 (...) @CameraDesiredHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
struct types_cnets_osblinnikov_github_com {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ types_cnets_osblinnikov_github_com_onDestroy(
    struct types_cnets_osblinnikov_github_com *);
void types_cnets_osblinnikov_github_com_deinit(
    struct types_cnets_osblinnikov_github_com *that) {
  types_cnets_osblinnikov_github_com_onDestroy(that);
}


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

x86 assembly (clang, -O2):
<types_cnets_osblinnikov_github_com_deinit>:
jmp    1030 <types_cnets_osblinnikov_github_com_onDestroy@plt>

LLVM IR (-O0):
%struct.types_cnets_osblinnikov_github_com = type { i32 }
define void @types_cnets_osblinnikov_github_com_deinit(%struct.types_cnets_osblinnikov_github_com* %0) {
%2 = alloca %struct.types_cnets_osblinnikov_github_com*
store %struct.types_cnets_osblinnikov_github_com* %0, %struct.types_cnets_osblinnikov_github_com** %2
%3 = load %struct.types_cnets_osblinnikov_github_com*, %struct.types_cnets_osblinnikov_github_com** %2
%4 = call i32 @types_cnets_osblinnikov_github_com_onDestroy(%struct.types_cnets_osblinnikov_github_com* %3)
ret void
}

LLVM IR (-O2):
%struct.types_cnets_osblinnikov_github_com = type { i32 }
define void @types_cnets_osblinnikov_github_com_deinit(%struct.types_cnets_osblinnikov_github_com* %0) {
%2 = tail call i32 @types_cnets_osblinnikov_github_com_onDestroy(%struct.types_cnets_osblinnikov_github_com* %0)
ret void
}
int func() {
  int i, b, c;
  i = b;
  b = c;
  c = i;
  i = b;
  b = c;
  c = i;
  i = b;
  b = c;
  c = i;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int sys_check_file(const char *path) {
  int ret = 0;
  struct stat buffer;
  if (stat(path, &buffer) == 0) {
    if (S_ISREG(buffer.st_mode)) {
      ret = 1;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<sys_check_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1168 <sys_check_file+0x48>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     1163 <sys_check_file+0x43>
movl   $0x1,-0xc(%rbp)
jmp    1168 <sys_check_file+0x48>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_check_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <sys_check_file+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @sys_check_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.stat
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISREG(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %3
br label %14
14: ; preds = %13, %8
br label %15
15: ; preds = %14, %1
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @sys_check_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
long grid(int step, int start_axis, int end_axis) {
  long total = step;
  for (int i = start_axis; step + i < end_axis; i += 8) {
    step += i;
    total += step;
  }
  return total;
}


x86 assembly (clang, -O0):
<grid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114d <grid+0x4d>
mov    -0x1c(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <grid+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid>:
movslq %edi,%rax
lea    (%rax,%rsi,1),%ecx
cmp    %edx,%ecx
jge    111f <grid+0x1f>
add    $0x8,%esi
nopl   (%rax)
movslq %ecx,%rcx
add    %rcx,%rax
add    %esi,%ecx
add    $0x8,%esi
cmp    %edx,%ecx
jl     1110 <grid+0x10>
ret

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

LLVM IR (-O2):
define i64 @grid(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = add nsw i32 %1, %0
%6 = icmp slt i32 %5, %2
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = zext i32 %1 to i64
br label %11
9: ; preds = %11, %3
%10 = phi i64 [ %4, %3 ], [ %16, %11 ]
ret i64 %10
11: ; preds = %7, %11
%12 = phi i64 [ %8, %7 ], [ %17, %11 ]
%13 = phi i32 [ %5, %7 ], [ %19, %11 ]
%14 = phi i64 [ %4, %7 ], [ %16, %11 ]
%15 = sext i32 %13 to i64
%16 = add nsw i64 %14, %15
%17 = add i64 %12, 8
%18 = trunc i64 %17 to i32
%19 = add nsw i32 %13, %18
%20 = icmp slt i32 %19, %2
br i1 %20, label %11, label %9
}
/* Variables and functions */
int /*<<< orphan*/ glLightModelf(unsigned int, float);
void LightModelf(unsigned int p, float v) { glLightModelf(p, v); }


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

x86 assembly (clang, -O2):
<LightModelf>:
jmp    1030 <glLightModelf@plt>

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

LLVM IR (-O2):
define void @LightModelf(i32 %0, float %1) {
%3 = tail call i32 @glLightModelf(i32 %0, float %1)
ret void
}
/* Variables and functions */
char *concat(char const *, char *, char *);
char *HTMLGenBody(const char *innerHTML) {
  return concat(innerHTML, "<body>", "</body>");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"<body>\00"
@.str.1 = [8 x i8] c"</body>\00"
define i8* @HTMLGenBody(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @concat(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"<body>\00"
@.str.1 = [8 x i8] c"</body>\00"
define i8* @HTMLGenBody(i8* %0) {
%2 = tail call i8* @concat(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
void list_init(char a) { a = 1; }


x86 assembly (clang, -O0):
<list_init>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @list_init(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
store i8 1, i8* %2
ret void
}

LLVM IR (-O2):
define void @list_init(i8 signext %0) {
ret void
}
/* Variables and functions */
int rand();
int init_vector(int vect[]) {
  for (int i = 0; i < 100; ++i) {
    vect[i] = rand() % 100;
  }
  return 0;
}


x86 assembly (clang, -O0):
<init_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1155 <init_vector+0x45>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <init_vector+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_vector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1120 <init_vector+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @init_vector(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 100
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %9, i32* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @init_vector(i32* nocapture writeonly %0) {
br label %3
2: ; preds = %3
ret i32 0
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %8, %3 ]
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 100
%7 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %6, i32* %7
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, 100
br i1 %9, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void _prs(char *s) { printf("%s\n", s); }


x86 assembly (clang, -O0):
<_prs>:
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):
<_prs>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @_prs(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void delayms(unsigned int howLong) {
  struct timespec sleeper, dummy;
  sleeper.tv_sec = (time_t)(howLong / 1000);
  sleeper.tv_nsec = (long)(howLong % 1000) * 1000000;
  nanosleep(&sleeper, &dummy);
}


x86 assembly (clang, -O0):
<delayms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
imul   $0xf4240,%rax,%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delayms>:
sub    $0x28,%rsp
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %rax,0x10(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0xf4240,%edi,%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @delayms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = udiv i32 %5, 1000
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %7, i64* %8
%9 = load i32, i32* %2
%10 = urem i32 %9, 1000
%11 = zext i32 %10 to i64
%12 = mul nsw i64 %11, 1000000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %12, i64* %13
%14 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @delayms(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = udiv i32 %0, 1000
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = urem i32 %0, 1000
%10 = mul nuw nsw i32 %9, 1000000
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %11, i64* %12
%13 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}
void SwapInt(int x[], int i, int j) {
  int temp;
  temp = x[i];
  x[i] = x[j];
  x[j] = temp;
}


x86 assembly (clang, -O0):
<SwapInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapInt>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @SwapInt(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @SwapInt(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void test_ok1(char *mem) { mem[79] = 'a'; }


x86 assembly (clang, -O0):
<test_ok1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,0x4f(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ok1>:
movb   $0x61,0x4f(%rdi)
ret

LLVM IR (-O0):
define void @test_ok1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 79
store i8 97, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_ok1(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 79
store i8 97, i8* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
void osal_search_dir_close(void *dir_handle) { closedir((DIR *)dir_handle); }


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

x86 assembly (clang, -O2):
<osal_search_dir_close>:
jmp    1030 <closedir@plt>

LLVM IR (-O0):
define void @osal_search_dir_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @closedir(i32* %4)
ret void
}

LLVM IR (-O2):
define void @osal_search_dir_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @closedir(i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *KTraderParse_putSymbol(char *_name) {
  char *p = (char *)malloc(strlen(_name) + 1);
  if (p != NULL) {
    strcpy(p, _name);
  }
  return p;
}


x86 assembly (clang, -O0):
<KTraderParse_putSymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <KTraderParse_putSymbol+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KTraderParse_putSymbol>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <KTraderParse_putSymbol+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @KTraderParse_putSymbol(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @KTraderParse_putSymbol(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int mos_put_queue_msg(void *, void const *);
int /*<<< orphan*/ mos_release_msg(void *);
int mos_post_msg(void *msgq, const void *msg) {
  int result;
  do {
  } while (0);
  result = mos_put_queue_msg(msgq, msg);
  if (0 == result) {
    mos_release_msg(msgq);
    result = 0;
  }
  do {
  } while (0);
  return result;
}


x86 assembly (clang, -O0):
<mos_post_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1135 <mos_post_msg+0x15>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mos_put_queue_msg@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jne    1160 <mos_post_msg+0x40>
mov    -0x8(%rbp),%rdi
call   1030 <mos_release_msg@plt>
movl   $0x0,-0x14(%rbp)
jmp    1165 <mos_post_msg+0x45>
jmp    116a <mos_post_msg+0x4a>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mos_post_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <mos_put_queue_msg@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1139 <mos_post_msg+0x19>
mov    %rbx,%rdi
call   1030 <mos_release_msg@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @mos_post_msg(i8* %0, i8* %1) {
%3 = tail call i32 @mos_put_queue_msg(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @mos_release_msg(i8* %0)
br label %7
7: ; preds = %2, %5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void say_version(void) {
  fprintf(stderr, "seeq-1.1"
                  "\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"seeq-1.1\0A\00"
define void @say_version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"seeq-1.1\0A\00"
define void @say_version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void output_p_to_x() {}


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

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

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

LLVM IR (-O2):
define void @output_p_to_x() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xff() {
  Assert_real((islower(255) == 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",
              1280, ("islower should be 0 for 0xff"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xff>:
push   %rax
mov    $0xff,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x500,%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 0xff\00"
define void @t_islower_0xff() {
%1 = call i64 @islower(i32 255)
%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 1280, 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 0xff\00"
define void @t_islower_0xff() {
%1 = tail call i64 @islower(i32 255)
%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 1280, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void goback(int x, int y) {
  printf("\033[%dA", x);
  printf("\033[%dD", y);
}


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

x86 assembly (clang, -O2):
<goback>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dA\00"
@.str.1 = [6 x i8] c"\1B[%dD\00"
define void @goback(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 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dA\00"
@.str.1 = [6 x i8] c"\1B[%dD\00"
define void @goback(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ moveToStackTraceField();
int /*<<< orphan*/ printf(char *, char *);
void traceOutput(char *leading) {
  moveToStackTraceField();
  printf("%s", leading);
}


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

x86 assembly (clang, -O2):
<traceOutput>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <moveToStackTraceField@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @traceOutput(i8* %0) {
%2 = tail call i32 (...) @moveToStackTraceField()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void set_non_block(int fd, unsigned long block) {
  fcntl(fd, F_SETFL, (block ? O_NONBLOCK : 0));
}


x86 assembly (clang, -O0):
<set_non_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <set_non_block+0x3d>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <set_non_block+0x47>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1157 <set_non_block+0x47>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_non_block>:
mov    %rsi,%rax
mov    0x2ebe(%rip),%rcx
mov    (%rcx),%esi
xor    %edx,%edx
test   %rax,%rax
je     112c <set_non_block+0x1c>
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_non_block(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i32, i32* @F_SETFL
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* @O_NONBLOCK
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %9
%13 = phi i32 [ %10, %9 ], [ 0, %11 ]
%14 = call i32 @fcntl(i32 %5, i32 %6, i32 %13)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_non_block(i32 %0, i64 %1) {
%3 = load i32, i32* @F_SETFL
%4 = icmp eq i64 %1, 0
%5 = load i32, i32* @O_NONBLOCK
%6 = select i1 %4, i32 0, i32 %5
%7 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %6)
ret void
}
int test_imm_D1int64_midword_reg(long long val) {
  return ((val >> 16) & (0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xd1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1int64_midword_reg>:
test   $0xd10000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D1int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 209
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D1int64_midword_reg(i64 %0) {
%2 = and i64 %0, 13697024
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}