xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int ghost_choice() {
  int g;
  printf("Escolha o fantama:\n1.BLINKY (vermelho)\n2.PINKY (rosa)\n3.INKY "
         "(azul)\n4.CLYDE (laranja)\n");
  scanf("%d", &g);
  return g;
}


x86 assembly (clang, -O0):
<ghost_choice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ghost_choice>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [87 x i8] c"Escolha o fantama:\0A1.BLINKY (vermelho)\0A2.PINKY (rosa)\0A3.INKY (azul)\0A4.CLYDE (laranja)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @ghost_choice() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [86 x i8] c"Escolha o fantama:\0A1.BLINKY (vermelho)\0A2.PINKY (rosa)\0A3.INKY (azul)\0A4.CLYDE (laranja)\00"
define i32 @ghost_choice() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_wait(int *ivar, int cmp_value) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_int_wait(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_wait(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
scalar_t__ setregid(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ setreuid(int /*<<< orphan*/, int /*<<< orphan*/);
int priv_end(uid_t real_uid, gid_t real_gid, uid_t effective_uid,
             gid_t effective_gid) {
  if (0 != setreuid(effective_uid, real_uid)) {
    return -1;
  }
  if (0 != setregid(effective_gid, real_gid)) {
    return -2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<priv_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <setreuid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1159 <priv_end+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <priv_end+0x65>
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <setregid@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     117e <priv_end+0x5e>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1185 <priv_end+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priv_end>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
mov    %edi,%esi
mov    %edx,%edi
call   1030 <setreuid@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1154 <priv_end+0x34>
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <setregid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @priv_end(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @setreuid(i32 %2, i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @setregid(i32 %3, i32 %1)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 0, i32 -2
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ -1, %4 ], [ %10, %7 ]
ret i32 %12
}
char *microbit_mp_appended_script() { return (char *)0x3e000; }


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

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

LLVM IR (-O0):
define i8* @microbit_mp_appended_script() {
ret i8* inttoptr (i64 253952 to i8*)
}

LLVM IR (-O2):
define i8* @microbit_mp_appended_script() {
ret i8* inttoptr (i64 253952 to i8*)
}
void cafebabe_constant_info_float_deinit(
    struct cafebabe_constant_info_float *f) {}


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

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

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

LLVM IR (-O2):
%struct.cafebabe_constant_info_float = type opaque
define void @cafebabe_constant_info_float_deinit(%struct.cafebabe_constant_info_float* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void crFree(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<crFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <crFree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crFree>:
test   %rdi,%rdi
je     111a <crFree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @crFree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_7Cuint8_reg(unsigned char val) {
  return ((val) & (-0x7C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff84,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Cuint8_reg>:
test   $0x84,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Cuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -124
%6 = icmp ne i32 %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_7Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -124
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __DELETE_java_lang_StackTraceElement(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_StackTraceElement(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sys_put_be16(int, int /*<<< orphan*/ *);
void sys_put_be32(uint32_t val, uint8_t dst[4]) {
  sys_put_be16(val >> 16, dst);
  sys_put_be16(val, &dst[2]);
}


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

x86 assembly (clang, -O2):
<sys_put_be32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
call   1030 <sys_put_be16@plt>
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <sys_put_be16@plt>

LLVM IR (-O0):
define void @sys_put_be32(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 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = call i32 @sys_put_be16(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = call i32 @sys_put_be16(i32 %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @sys_put_be32(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = tail call i32 @sys_put_be16(i32 %3, i32* %1)
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = tail call i32 @sys_put_be16(i32 %0, i32* %5)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ errno;
int stat(char *, struct stat *);
int fileExists(char *fname) {
  struct stat buf;
  errno = 0;
  int chk = stat(fname, &buf);
  if (errno != 0) {
    return (chk == 0);
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e9f(%rip),%rax
cmpq   $0x0,(%rax)
je     115f <fileExists+0x4f>
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <fileExists+0x56>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ec4(%rip),%rbx
movq   $0x0,(%rbx)
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
cmpq   $0x0,(%rbx)
mov    $0x2,%eax
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i64 0
define i32 @fileExists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
store i64 0, i64* @errno
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = load i64, i64* @errno
%6 = icmp eq i64 %5, 0
%7 = icmp eq i32 %4, 0
%8 = zext i1 %7 to i32
%9 = select i1 %6, i32 2, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
scalar_t__ inc_addr(void *, int);
int shim_migrate_pages(int /*<<< orphan*/, int, unsigned long *,
                       unsigned long *);
int bad_migrate_pages(void *addr) {
  return shim_migrate_pages(getpid(), 1, (unsigned long *)addr,
                            (unsigned long *)inc_addr(addr, 1));
}


x86 assembly (clang, -O0):
<bad_migrate_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1050 <inc_addr@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
mov    $0x1,%esi
call   1030 <shim_migrate_pages@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_migrate_pages>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <inc_addr@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <shim_migrate_pages@plt>

LLVM IR (-O0):
define i32 @bad_migrate_pages(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getpid()
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
%6 = load i8*, i8** %2
%7 = call i64 @inc_addr(i8* %6, i32 1)
%8 = inttoptr i64 %7 to i64*
%9 = call i32 @shim_migrate_pages(i32 %3, i32 1, i64* %5, i64* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @bad_migrate_pages(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = bitcast i8* %0 to i64*
%4 = tail call i64 @inc_addr(i8* %0, i32 1)
%5 = inttoptr i64 %4 to i64*
%6 = tail call i32 @shim_migrate_pages(i32 %2, i32 1, i64* %3, i64* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ emulate_get();
int /*<<< orphan*/ push_int(int /*<<< orphan*/);
void fn_get(void) { push_int(emulate_get()); }


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

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

LLVM IR (-O0):
define void @fn_get() {
%1 = call i32 (...) @emulate_get()
%2 = call i32 @push_int(i32 %1)
ret void
}

LLVM IR (-O2):
define void @fn_get() {
%1 = tail call i32 (...) @emulate_get()
%2 = tail call i32 @push_int(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perm_it(unsigned char *, int);
int /*<<< orphan*/ xor_it(unsigned char *, int);
int encrypt(unsigned char *data, int length) {
  if (length % 512)
    return -1;
  xor_it(data, length);
  perm_it(data, length);
  return 0;
}


x86 assembly (clang, -O0):
<encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114f <encrypt+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <encrypt+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <xor_it@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <perm_it@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt>:
mov    $0xffffffff,%eax
test   $0x1ff,%esi
je     112e <encrypt+0xe>
ret
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <xor_it@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <perm_it@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @encrypt(i8* %0, i32 %1) {
%3 = and i32 %1, 511
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @xor_it(i8* %0, i32 %1)
%7 = tail call i32 @perm_it(i8* %0, i32 %1)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ send_response(char, int, int);
void handle_ukvm_exit(void) { send_response('X', 9, false); }


x86 assembly (clang, -O0):
<handle_ukvm_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
mov    $0x9,%esi
xor    %edx,%edx
call   1030 <send_response@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_ukvm_exit>:
mov    $0x58,%edi
mov    $0x9,%esi
xor    %edx,%edx
jmp    1030 <send_response@plt>

LLVM IR (-O0):
define void @handle_ukvm_exit() {
%1 = call i32 @send_response(i8 signext 88, i32 9, i32 0)
ret void
}

LLVM IR (-O2):
define void @handle_ukvm_exit() {
%1 = tail call i32 @send_response(i8 signext 88, i32 9, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ lang_getstring(char const *, char *, int);
const char *lang_get(const char *desired_key) {
  static char buf[1024];
  lang_getstring(desired_key, buf, sizeof(buf));
  return buf;
}


x86 assembly (clang, -O0):
<lang_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f19(%rip),%rsi
mov    $0x400,%edx
call   1030 <lang_getstring@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lang_get>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x400,%edx
call   1030 <lang_getstring@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@lang_get.buf = internal global [1024 x i8] zeroinitializer
define i8* @lang_get(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @lang_getstring(i8* %3, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @lang_get.buf, i64 0, i64 0), i32 1024)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @lang_get.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@lang_get.buf = internal global [1024 x i8] zeroinitializer
define i8* @lang_get(i8* %0) {
%2 = tail call i32 @lang_getstring(i8* %0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @lang_get.buf, i64 0, i64 0), i32 1024)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @lang_get.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ SubChannelOrganizationPrn(int);
void FIC_DEC_SubChannelOrganizationPrn(int subChId) {
  SubChannelOrganizationPrn(subChId);
}


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

x86 assembly (clang, -O2):
<FIC_DEC_SubChannelOrganizationPrn>:
jmp    1030 <SubChannelOrganizationPrn@plt>

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

LLVM IR (-O2):
define void @FIC_DEC_SubChannelOrganizationPrn(i32 %0) {
%2 = tail call i32 @SubChannelOrganizationPrn(i32 %0)
ret void
}
int psc_wakeup_modem() { return 0; }


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

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

LLVM IR (-O0):
define i32 @psc_wakeup_modem() {
ret i32 0
}

LLVM IR (-O2):
define i32 @psc_wakeup_modem() {
ret i32 0
}
/* Variables and functions */
int strlen(const char *string) {
  register int i = 0;
  while (string[i] != '\0')
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void pdie(const char *mesg) {
  perror(mesg);
  exit(1);
}


x86 assembly (clang, -O0):
<pdie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pdie>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @pdie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @pdie(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void cannot(const char *what, const char *name) {
  fprintf(stderr, "cannot %s %s: %s\n", what, name, strerror(errno));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<cannot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    %rax,%r8
lea    0xe81(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cannot>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e9f(%rip),%rax
mov    (%rax),%ebp
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea8(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"cannot %s %s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @cannot(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7, i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"cannot %s %s: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @cannot(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
unsigned int rand();
unsigned dice_roll(unsigned chance) { return 0 == rand() % chance; }


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

x86 assembly (clang, -O2):
<dice_roll>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
xor    %edx,%edx
div    %ebx
xor    %eax,%eax
test   %edx,%edx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dice_roll(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = urem i32 %3, %4
%6 = icmp eq i32 0, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @dice_roll(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = urem i32 %2, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int i = 5;
  int *iPointer = &i;
  int **ipointerPointer = &iPointer;
  printf("%i\n", **ipointerPointer);
  float f = 6.0;
  float *fPointer = &f;
  float **fpp = &fPointer;
  printf("%f\n", **fpp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cvtsi2ssl (%rax),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movss  0xeab(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
movss  (%rax),%xmm0
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32**
%5 = alloca float
%6 = alloca float*
%7 = alloca float**
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %3
store i32** %3, i32*** %4
%8 = load i32**, i32*** %4
%9 = load i32*, i32** %8
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %11)
store float 6.000000e+00, float* %5
store float* %5, float** %6
store float** %6, float*** %7
%13 = load float**, float*** %7
%14 = load float*, float** %13
%15 = load float, float* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 5.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 6.000000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNC_3() {
  long int stat = 99;
  BNCIO(3);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x3,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_3>:
push   %rax
mov    $0x3,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNC_3() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 3)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNC_3() {
%1 = tail call i32 @BNCIO(i32 3)
ret i64 99
}
/* Variables and functions */
const char *Px_GetMixerName(void *pa_stream, int index) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @Px_GetMixerName(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
int test_imm_91int8_reg(signed char val) {
  return ((val) & (0x91 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_91int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x91,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_91int8_reg>:
test   $0x91,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_91int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 145
%6 = icmp ne i32 %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_91int8_reg(i8 signext %0) {
%2 = and i8 %0, -111
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_log_file(char *, char *, int);
void log_data(char *log_path, char *message) {
  write_log_file(log_path, message, -1);
}


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

x86 assembly (clang, -O2):
<log_data>:
mov    $0xffffffff,%edx
jmp    1030 <write_log_file@plt>

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

LLVM IR (-O2):
define void @log_data(i8* %0, i8* %1) {
%3 = tail call i32 @write_log_file(i8* %0, i8* %1, i32 -1)
ret void
}
unsigned bitCount_fun_short(short x) {
  unsigned r = x & 1;
  for (x = x >> 1 & 0x7fff; x; x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x1,%eax
and    $0x7fff,%eax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     114d <bitCount_fun_short+0x4d>
movswl -0x2(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %ax,-0x2(%rbp)
jmp    1125 <bitCount_fun_short+0x25>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_short>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%di
jb     1124 <bitCount_fun_short+0x24>
nopl   0x0(%rax,%rax,1)
movzwl %di,%ecx
mov    %ecx,%edi
shr    %edi
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
cmp    $0x3,%cx
ja     1110 <bitCount_fun_short+0x10>
ret

LLVM IR (-O0):
define i32 @bitCount_fun_short(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = and i32 %5, 1
store i32 %6, i32* %3
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = ashr i32 %8, 1
%10 = and i32 %9, 32767
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
br label %12
12: ; preds = %21, %1
%13 = load i16, i16* %2
%14 = icmp ne i16 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i16, i16* %2
%17 = sext i16 %16 to i32
%18 = and i32 %17, 1
%19 = load i32, i32* %3
%20 = add i32 %19, %18
store i32 %20, i32* %3
br label %21
21: ; preds = %15
%22 = load i16, i16* %2
%23 = sext i16 %22 to i32
%24 = ashr i32 %23, 1
%25 = trunc i32 %24 to i16
store i16 %25, i16* %2
br label %12
26: ; preds = %12
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @bitCount_fun_short(i16 signext %0) {
%2 = and i16 %0, 1
%3 = zext i16 %2 to i32
%4 = icmp ult i16 %0, 2
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i16 [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %11, %5 ], [ %3, %1 ]
%8 = lshr i16 %6, 1
%9 = and i16 %8, 1
%10 = zext i16 %9 to i32
%11 = add i32 %7, %10
%12 = icmp ult i16 %6, 4
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ %3, %1 ], [ %11, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printPrompt() { printf("flop: "); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"flop: \00"
define void @printPrompt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"flop: \00"
define void @printPrompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void errexit() { printf("Epresso has to die\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Epresso has to die\0A\00"
define void @errexit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Epresso has to die\00"
define void @errexit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int errno;
int rmdir(char const *);
int do_rmdir(const char *file) {
  int err;
  err = rmdir(file);
  if (err)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<do_rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rmdir@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1145 <do_rmdir+0x35>
xor    %eax,%eax
mov    0x2ea5(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    114c <do_rmdir+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rmdir>:
push   %rax
call   1030 <rmdir@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @do_rmdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @rmdir(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @errno
%11 = sub nsw i32 0, %10
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @do_rmdir(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x5f() {
  Assert_real((iscntrl(95) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              480, ("iscntrl should be 0 for _"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for _\00"
define void @t_iscntrl_0x5f() {
%1 = call i64 @iscntrl(i32 95)
%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 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for _\00"
define void @t_iscntrl_0x5f() {
%1 = tail call i64 @iscntrl(i32 95)
%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 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _assert(int, int);
void testSeven(void) {
  _assert((3) != (4), 71);
  _assert((3) == (4), 72);
}


x86 assembly (clang, -O0):
<testSeven>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x47,%esi
call   1030 <_assert@plt>
xor    %edi,%edi
mov    $0x48,%esi
call   1030 <_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSeven>:
push   %rax
mov    $0x1,%edi
mov    $0x47,%esi
call   1030 <_assert@plt>
xor    %edi,%edi
mov    $0x48,%esi
pop    %rax
jmp    1030 <_assert@plt>

LLVM IR (-O0):
define void @testSeven() {
%1 = call i32 @_assert(i32 1, i32 71)
%2 = call i32 @_assert(i32 0, i32 72)
ret void
}

LLVM IR (-O2):
define void @testSeven() {
%1 = tail call i32 @_assert(i32 1, i32 71)
%2 = tail call i32 @_assert(i32 0, i32 72)
ret void
}
/* Type definitions */
typedef int __u32;
typedef int __u16;

/* Variables and functions */
__u16 wrapsum(__u32 sum) {
  sum = ~sum & 0xFFFF;
  return ((((sum & 0x00FF) << 8) | ((sum & 0xFF00) >> 8)));
}


x86 assembly (clang, -O0):
<wrapsum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapsum>:
not    %edi
movzwl %di,%eax
mov    %eax,%ecx
shl    $0x8,%ecx
movzwl %cx,%ecx
shr    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @wrapsum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = and i32 %4, 65535
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = load i32, i32* %2
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = or i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @wrapsum(i32 %0) {
%2 = and i32 %0, 65535
%3 = xor i32 %2, 65535
%4 = shl nuw nsw i32 %3, 8
%5 = and i32 %4, 65280
%6 = lshr i32 %3, 8
%7 = or i32 %5, %6
ret i32 %7
}
void key_6_handler(void) { return; }


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

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

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

LLVM IR (-O2):
define void @key_6_handler() {
ret void
}
unsigned xrop3_236_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk1 = S | stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_236_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = and i32 %6, %5
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  printf("Hello World!\n");
  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 <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>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void xperror(char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<xperror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xperror>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @xperror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @xperror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int pirates_triangle_size(void) { return 11; }


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

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

LLVM IR (-O0):
define i32 @pirates_triangle_size() {
ret i32 11
}

LLVM IR (-O2):
define i32 @pirates_triangle_size() {
ret i32 11
}
/* Type definitions */
struct configuration {
  int dummy;
};

/* Variables and functions */
char *get_config_path(struct configuration *, char *);
char *get_config_file(struct configuration *config) {
  return get_config_path(config, "config");
}


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

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

LLVM IR (-O0):
%struct.configuration = type { i32 }
@.str = [7 x i8] c"config\00"
define i8* @get_config_file(%struct.configuration* %0) {
%2 = alloca %struct.configuration*
store %struct.configuration* %0, %struct.configuration** %2
%3 = load %struct.configuration*, %struct.configuration** %2
%4 = call i8* @get_config_path(%struct.configuration* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.configuration = type { i32 }
@.str = [7 x i8] c"config\00"
define i8* @get_config_file(%struct.configuration* %0) {
%2 = tail call i8* @get_config_path(%struct.configuration* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int reloc_imm(long);
long reloc_bl(long offset) { return 0xeb000000 | reloc_imm(offset); }


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

x86 assembly (clang, -O2):
<reloc_bl>:
push   %rax
call   1030 <reloc_imm@plt>
or     $0xeb000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @reloc_bl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @reloc_imm(i64 %3)
%5 = or i32 -352321536, %4
%6 = zext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @reloc_bl(i64 %0) {
%2 = tail call i32 @reloc_imm(i64 %0)
%3 = or i32 %2, -352321536
%4 = zext i32 %3 to i64
ret i64 %4
}