xunge/DecIR huggingface dataset:
unsigned int swap32(unsigned int i) {
  return ((unsigned int)(((i << 24) & 0xff000000) | ((i << 8) & 0x00ff0000) |
                         ((i >> 8) & 0x0000ff00) | ((i >> 24) & 0x000000ff)));
}


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = and i32 %4, -16777216
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = and i32 %7, 16711680
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = and i32 %11, 65280
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = lshr i32 %14, 24
%16 = and i32 %15, 255
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
struct passwd *getpwnam(char const *);
int /*<<< orphan*/ prt_passwd(struct passwd *);
int /*<<< orphan*/ stderr;
void user_by_name(const char *name) {
  struct passwd *pw;
  pw = getpwnam(name);
  if (pw == NULL) {
    fprintf(stderr, "No entry found. -u %s\n", name);
    exit(-1);
  };
  prt_passwd(pw);
}


x86 assembly (clang, -O0):
<user_by_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <user_by_name+0x47>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1050 <prt_passwd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_by_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1157 <user_by_name+0x17>
mov    %rax,%rdi
pop    %rbx
jmp    1050 <prt_passwd@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"No entry found. -u %s\0A\00"
define void @user_by_name(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.passwd*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.passwd* @getpwnam(i8* %4)
store %struct.passwd* %5, %struct.passwd** %3
%6 = load %struct.passwd*, %struct.passwd** %3
%7 = icmp eq %struct.passwd* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
%14 = load %struct.passwd*, %struct.passwd** %3
%15 = call i32 @prt_passwd(%struct.passwd* %14)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"No entry found. -u %s\0A\00"
define void @user_by_name(i8* %0) {
%2 = tail call %struct.passwd* @getpwnam(i8* %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
%9 = tail call i32 @prt_passwd(%struct.passwd* %2)
ret void
}
int hvt_gdb_supported(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @hvt_gdb_supported() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char *const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(int argc, char **argv) {
  write(0, "Starting the program\n", 21);
  char *const args[] = {"-l"};
  execv("/bin/ls", args);
  write(0, "test\n", 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    0xec8(%rip),%rsi
mov    $0x15,%edx
call   1030 <write@plt>
mov    0x2ccf(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1040 <execv@plt>
xor    %edi,%edi
lea    0xebb(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
xor    %edi,%edi
mov    $0x15,%edx
call   1030 <write@plt>
lea    0xedb(%rip),%rax
mov    %rax,(%rsp)
lea    0xed3(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execv@plt>
lea    0xecc(%rip),%rsi
xor    %edi,%edi
mov    $0x5,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Starting the program\0A\00"
@.str.1 = [3 x i8] c"-l\00"
@__const.main.args = [1 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [8 x i8] c"/bin/ls\00"
@.str.3 = [6 x i8] c"test\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [1 x i8*]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @write(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 21)
%7 = bitcast [1 x i8*]* %5 to i8*
%8 = getelementptr inbounds [1 x i8*], [1 x i8*]* %5, i64 0, i64 0
%9 = call i32 @execv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %8)
%10 = call i32 @write(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Starting the program\0A\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [8 x i8] c"/bin/ls\00"
@.str.3 = [6 x i8] c"test\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1 x i8*]
%4 = tail call i32 @write(i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 21)
%5 = bitcast [1 x i8*]* %3 to i8*
%6 = bitcast [1 x i8*]* %3 to i64*
store i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64* %6
%7 = getelementptr inbounds [1 x i8*], [1 x i8*]* %3, i64 0, i64 0
%8 = call i32 @execv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %7)
%9 = call i32 @write(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 5)
ret i32 0
}
/* Variables and functions */
float logf(float);
float __ocl_half_log_float(float src) { return logf(src); }


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

x86 assembly (clang, -O2):
<__ocl_half_log_float>:
jmp    1030 <logf@plt>

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

LLVM IR (-O2):
define float @__ocl_half_log_float(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t __GET_UINT32_RAW(uint32_t *addr) {
  return (*(uint32_t *)(((uint8_t *)(addr)) + (0)));
}


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

x86 assembly (clang, -O2):
<__GET_UINT32_RAW>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @__GET_UINT32_RAW(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void perfctr_ppc64_init_tests(void) {}


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

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

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

LLVM IR (-O2):
define void @perfctr_ppc64_init_tests() {
ret void
}
/* Variables and functions */
int nothing();
int /*<<< orphan*/ printf(char *);
main() {
  int y;
  y = nothing();
  printf("hello\n");
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @nothing()
store i32 %2, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (...) @nothing()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fopen(char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readFile(int /*<<< orphan*/);
int /*<<< orphan*/ writeFile(int /*<<< orphan*/);
int main() {
  char aux;
  char nombreArchivo[40];
  printf("Nombre de la nota: ");
  gets(nombreArchivo);
  readFile(fopen(nombreArchivo, "r"));
  writeFile(fopen(nombreArchivo, "a"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x30(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1060 <fopen@plt>
mov    %eax,%edi
call   1070 <readFile@plt>
lea    -0x30(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1060 <fopen@plt>
mov    %eax,%edi
call   1040 <writeFile@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
call   1060 <fopen@plt>
mov    %eax,%edi
call   1070 <readFile@plt>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1060 <fopen@plt>
mov    %eax,%edi
call   1040 <writeFile@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Nombre de la nota: \00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [40 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%8 = call i32 @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @readFile(i32 %8)
%10 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%11 = call i32 @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @writeFile(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Nombre de la nota: \00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @readFile(i32 %5)
%7 = call i32 @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @writeFile(i32 %7)
ret i32 0
}
void rcu_print_detail_task_stall(struct rcu_state *rsp) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_state = type opaque
define void @rcu_print_detail_task_stall(%struct.rcu_state* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isnan(float);
int IsFill(float val, float fill) { return isnan(val) || val == fill; }


x86 assembly (clang, -O0):
<IsFill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1152 <IsFill+0x42>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsFill>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
call   1030 <isnan@plt>
test   %rax,%rax
setne  %al
movss  (%rsp),%xmm0
ucomiss 0x4(%rsp),%xmm0
setnp  %cl
sete   %dl
and    %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @IsFill(float %0, float %1) {
%3 = tail call i64 @isnan(float %0)
%4 = icmp ne i64 %3, 0
%5 = fcmp oeq float %0, %1
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
void *cs2qcb();
void *cs2qcb_(void) { return cs2qcb(); }


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

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

LLVM IR (-O0):
define i8* @cs2qcb_() {
%1 = call i8* (...) @cs2qcb()
ret i8* %1
}

LLVM IR (-O2):
define i8* @cs2qcb_() {
%1 = tail call i8* (...) @cs2qcb()
ret i8* %1
}
/* Type definitions */
struct MemoryStream {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct MemoryStream *);
void memory_close(void *data) {
  struct MemoryStream *stm = data;
  free(stm);
}


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

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

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

LLVM IR (-O2):
%struct.MemoryStream = type { i32 }
define void @memory_close(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.MemoryStream*
%3 = tail call i32 @free(%struct.MemoryStream* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_print(int n) {
  ft_putchar(n + 48);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print>:
push   %rax
add    $0x30,%dil
movsbl %dil,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = trunc i32 %4 to i8
%6 = call i32 @ft_putchar(i8 signext %5)
%7 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_print(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = add i8 %2, 48
%4 = tail call i32 @ft_putchar(i8 signext %3)
%5 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Type definitions */
struct taskstats {
  int /*<<< orphan*/ nivcsw;
  int /*<<< orphan*/ nvcsw;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void task_context_switch_counts(struct taskstats *t) {
  printf("\n\nTask   %15s%15s\n"
         "       %15lu%15lu\n",
         "voluntary", "nonvoluntary", t->nvcsw, t->nivcsw);
}


x86 assembly (clang, -O0):
<task_context_switch_counts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%r8d
lea    0xecf(%rip),%rdi
lea    0xef0(%rip),%rsi
lea    0xee6(%rip),%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_context_switch_counts>:
mov    (%rdi),%r8d
mov    0x4(%rdi),%ecx
lea    0xee3(%rip),%rdi
lea    0xf04(%rip),%rsi
lea    0xefa(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.taskstats = type { i32, i32 }
@.str = [37 x i8] c"\0A\0ATask %15s%15s\0A %15lu%15lu\0A\00"
@.str.1 = [10 x i8] c"voluntary\00"
@.str.2 = [13 x i8] c"nonvoluntary\00"
define void @task_context_switch_counts(%struct.taskstats* %0) {
%2 = alloca %struct.taskstats*
store %struct.taskstats* %0, %struct.taskstats** %2
%3 = load %struct.taskstats*, %struct.taskstats** %2
%4 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %3, i32 0, i32 1
%5 = load i32, i32* %4
%6 = load %struct.taskstats*, %struct.taskstats** %2
%7 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.taskstats = type { i32, i32 }
@.str = [37 x i8] c"\0A\0ATask %15s%15s\0A %15lu%15lu\0A\00"
@.str.1 = [10 x i8] c"voluntary\00"
@.str.2 = [13 x i8] c"nonvoluntary\00"
define void @task_context_switch_counts(%struct.taskstats* nocapture %0) {
%2 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.taskstats, %struct.taskstats* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %3, i32 %5)
ret void
}
__attribute__((always_)) void
thread_group_cputime_free(struct signal_struct *sig) {}


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

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

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

LLVM IR (-O2):
%struct.signal_struct = type opaque
define void @thread_group_cputime_free(%struct.signal_struct* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ dcac_acl_ops(int, int, int, char const *, char const *);
int dcac_set_file_exacl(const char *file, const char *acl) {
  return (int)dcac_acl_ops(27, -1, -1, acl, file);
}


x86 assembly (clang, -O0):
<dcac_set_file_exacl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x1b,%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1030 <dcac_acl_ops@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcac_set_file_exacl>:
mov    %rsi,%rcx
mov    %rdi,%r8
mov    $0x1b,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <dcac_acl_ops@plt>

LLVM IR (-O0):
define i32 @dcac_set_file_exacl(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @dcac_acl_ops(i32 27, i32 -1, i32 -1, i8* %5, i8* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dcac_set_file_exacl(i8* %0, i8* %1) {
%3 = tail call i64 @dcac_acl_ops(i32 27, i32 -1, i32 -1, i8* %1, i8* %0)
%4 = trunc i64 %3 to i32
ret i32 %4
}
void rop3_244_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_244_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_244_1_0>:
mov    (%rdi),%al
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_244_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, -1
%6 = and i8 %5, %2
%7 = and i8 %4, %1
%8 = or i8 %7, %6
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
char func_b();
char func_c();
int main(int argc, char **argv) {
  if (func_b() != 'b') {
    return 1;
  }
  if (func_c() != 'c') {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <func_b@plt>
movsbl %al,%eax
cmp    $0x62,%eax
je     1155 <main+0x35>
movl   $0x1,-0x4(%rbp)
jmp    117b <main+0x5b>
mov    $0x0,%al
call   1040 <func_c@plt>
movsbl %al,%eax
cmp    $0x63,%eax
je     1174 <main+0x54>
movl   $0x2,-0x4(%rbp)
jmp    117b <main+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func_b@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x62,%cl
jne    1147 <main+0x27>
xor    %eax,%eax
call   1040 <func_c@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x63,%cl
setne  %al
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call signext i8 (...) @func_b()
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 98
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %16
10: ; preds = %2
%11 = call signext i8 (...) @func_c()
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 99
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 2, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call signext i8 (...) @func_b()
%4 = icmp eq i8 %3, 98
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call signext i8 (...) @func_c()
%7 = icmp eq i8 %6, 99
%8 = select i1 %7, i32 0, i32 2
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ pause();
int main(int argc, const char *argv[]) {
  for (;;)
    pause();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pause@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <pause@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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
br label %6
6: ; preds = %6, %2
%7 = call i32 (...) @pause()
br label %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @pause()
br label %3
}
void _asm_megabuf_end(void) {}


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

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

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

LLVM IR (-O2):
define void @_asm_megabuf_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check();
int /*<<< orphan*/ init();
int main(int argc, char **argv) {
  init();
  check();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init()
%7 = call i32 (...) @check()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @check()
ret i32 0
}
int _gnix_notifier_close(struct gnix_mr_notifier *mrn) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.gnix_mr_notifier = type opaque
define i32 @_gnix_notifier_close(%struct.gnix_mr_notifier* nocapture readnone %0) {
ret i32 0
}
int test_imm_CDint8_reg(signed char val) {
  return ((val) & (0xCD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CDint8_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, 205
%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_CDint8_reg(i8 signext %0) {
%2 = and i8 %0, -51
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct tavl_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *tavl_delete(struct tavl_table *, void *);
void *(tavl_assert_delete)(struct tavl_table *table, void *item) {
  void *p = tavl_delete(table, item);
  assert(p != NULL);
  return p;
}


x86 assembly (clang, -O0):
<tavl_assert_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <tavl_delete@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tavl_assert_delete>:
push   %rbx
call   1030 <tavl_delete@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tavl_table = type { i32 }
define i8* @tavl_assert_delete(%struct.tavl_table* %0, i8* %1) {
%3 = alloca %struct.tavl_table*
%4 = alloca i8*
%5 = alloca i8*
store %struct.tavl_table* %0, %struct.tavl_table** %3
store i8* %1, i8** %4
%6 = load %struct.tavl_table*, %struct.tavl_table** %3
%7 = load i8*, i8** %4
%8 = call i8* @tavl_delete(%struct.tavl_table* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
%struct.tavl_table = type { i32 }
define i8* @tavl_assert_delete(%struct.tavl_table* %0, i8* %1) {
%3 = tail call i8* @tavl_delete(%struct.tavl_table* %0, i8* %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sio_write(char *, int);
int outchar(char c, char *ptr, int off) {
  if (ptr == (char *)-1)
    sio_write(&c, 1);
  else if (ptr > (char *)255)
    ptr[off] = c;
  return off + 1;
}


x86 assembly (clang, -O0):
<outchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x10(%rbp)
jne    1149 <outchar+0x39>
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <sio_write@plt>
jmp    116b <outchar+0x5b>
mov    $0xff,%eax
cmp    %rax,-0x10(%rbp)
jbe    1166 <outchar+0x56>
mov    -0x1(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    116b <outchar+0x5b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outchar>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %dil,0xf(%rsp)
cmp    $0xffffffffffffffff,%rsi
je     1134 <outchar+0x24>
cmp    $0x100,%rsi
jb     1143 <outchar+0x33>
movslq %ebx,%rax
mov    %dil,(%rsi,%rax,1)
jmp    1143 <outchar+0x33>
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
call   1030 <sio_write@plt>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @outchar(i8 signext %0, i8* writeonly %1, i32 %2) {
%4 = alloca i8
store i8 %0, i8* %4
%5 = icmp eq i8* %1, inttoptr (i64 -1 to i8*)
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @sio_write(i8* %4, i32 1)
br label %13
8: ; preds = %3
%9 = icmp ugt i8* %1, inttoptr (i64 255 to i8*)
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = sext i32 %2 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
store i8 %0, i8* %12
br label %13
13: ; preds = %8, %10, %6
%14 = add nsw i32 %2, 1
ret i32 %14
}
/* Variables and functions */
scalar_t__ decode_move_string(char *);
int /*<<< orphan*/ get_move_string(char *);
int /*<<< orphan*/ update_board();
scalar_t__ validate_move();
void play(void) {
  char move_string[10];
  for (;;) {
    get_move_string(move_string);
    if (decode_move_string(move_string) == 0)
      continue;
    if (validate_move())
      break;
  }
  update_board();
}


x86 assembly (clang, -O0):
<play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
call   1040 <get_move_string@plt>
lea    -0xa(%rbp),%rdi
call   1050 <decode_move_string@plt>
cmp    $0x0,%rax
jne    1169 <play+0x29>
jmp    1148 <play+0x8>
mov    $0x0,%al
call   1060 <validate_move@plt>
cmp    $0x0,%rax
je     117f <play+0x3f>
jmp    1184 <play+0x44>
jmp    1148 <play+0x8>
mov    $0x0,%al
call   1030 <update_board@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <get_move_string@plt>
mov    %rbx,%rdi
call   1050 <decode_move_string@plt>
test   %rax,%rax
je     1150 <play+0x10>
xor    %eax,%eax
call   1060 <validate_move@plt>
test   %rax,%rax
je     1150 <play+0x10>
xor    %eax,%eax
call   1030 <update_board@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @play() {
%1 = alloca [10 x i8]
br label %2
2: ; preds = %13, %8, %0
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @get_move_string(i8* %3)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i64 @decode_move_string(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %2
9: ; preds = %2
%10 = call i64 (...) @validate_move()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
br label %14
13: ; preds = %9
br label %2
14: ; preds = %12
%15 = call i32 (...) @update_board()
ret void
}

LLVM IR (-O2):
define void @play() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %7, %0
%4 = call i32 @get_move_string(i8* %2)
%5 = call i64 @decode_move_string(i8* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3, %8
br label %3
8: ; preds = %3
%9 = call i64 (...) @validate_move()
%10 = icmp eq i64 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %8
%12 = call i32 (...) @update_board()
ret void
}
void rlinit() {}


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

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

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

LLVM IR (-O2):
define void @rlinit() {
ret void
}
/* Variables and functions */
#define GLUT_KEY_DOWN 129
#define GLUT_KEY_UP 128
int /*<<< orphan*/ down();
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ up();
void special(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_UP:
    up();
    break;
  case GLUT_KEY_DOWN:
    down();
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     116a <special+0x3a>
jmp    1157 <special+0x27>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     1176 <special+0x46>
jmp    117d <special+0x4d>
mov    $0x0,%al
call   1040 <up@plt>
jmp    117d <special+0x4d>
mov    $0x0,%al
call   1030 <down@plt>
mov    $0x0,%al
call   1050 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
push   %rax
cmp    $0x81,%edi
je     114a <special+0x1a>
cmp    $0x80,%edi
jne    1151 <special+0x21>
xor    %eax,%eax
call   1040 <up@plt>
jmp    1151 <special+0x21>
xor    %eax,%eax
call   1030 <down@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @special(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %12 [
i32 128, label %8
i32 129, label %10
]
8: ; preds = %3
%9 = call i32 (...) @up()
br label %12
10: ; preds = %3
%11 = call i32 (...) @down()
br label %12
12: ; preds = %3, %10, %8
%13 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @special(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %8 [
i32 128, label %4
i32 129, label %6
]
4: ; preds = %3
%5 = tail call i32 (...) @up()
br label %8
6: ; preds = %3
%7 = tail call i32 (...) @down()
br label %8
8: ; preds = %3, %6, %4
%9 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
void pressenter() {
  printf("Press enter to continue.");
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<pressenter>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1148 <pressenter+0x28>
jmp    1130 <pressenter+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pressenter>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1130 <pressenter+0x10>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Press enter to continue.\00"
define void @pressenter() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Press enter to continue.\00"
define void @pressenter() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
void set_uchar_array(unsigned char *array, unsigned char value, int index) {
  int i;
  if (index < 0) {
    for (i = 0; i < 11; i++)
      array[i] = value;
  } else
    array[index] = value;
}


x86 assembly (clang, -O0):
<set_uchar_array>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114d <set_uchar_array+0x4d>
movl   $0x0,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jge    1148 <set_uchar_array+0x48>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1122 <set_uchar_array+0x22>
jmp    115b <set_uchar_array+0x5b>
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_uchar_array>:
test   %edx,%edx
js     110b <set_uchar_array+0xb>
mov    %edx,%eax
mov    %sil,(%rdi,%rax,1)
ret
movzbl %sil,%eax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rax,%rcx
mov    %rcx,(%rdi)
mov    %ecx,0x7(%rdi)
ret

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

LLVM IR (-O2):
define void @set_uchar_array(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %3
br label %9
6: ; preds = %3
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %1, i8* %8
br label %9
9: ; preds = %5, %6
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int atomic_inc(int *, int);
int time(int /*<<< orphan*/);
__attribute__((constructor)) int32_t get_xid() {
  static int32_t xid = -1;
  if (xid == -1) {
    xid = time(0);
  }
  return atomic_inc(&xid, 1);
}


x86 assembly (clang, -O0):
<get_xid>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0xffffffff,0x2f05(%rip)
jne    113e <get_xid+0x1e>
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0x2ef2(%rip)
lea    0x2eeb(%rip),%rdi
mov    $0x1,%esi
call   1040 <atomic_inc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_xid>:
push   %rax
cmpl   $0xffffffff,0x2f08(%rip)
jne    1137 <get_xid+0x17>
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0x2ef9(%rip)
lea    0x2ef2(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1040 <atomic_inc@plt>

LLVM IR (-O0):
@get_xid.xid = internal global i32 -1
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (i32 ()* @get_xid to void ()*), i8* null }]
define i32 @get_xid() {
%1 = load i32, i32* @get_xid.xid
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @time(i32 0)
store i32 %4, i32* @get_xid.xid
br label %5
5: ; preds = %3, %0
%6 = call i32 @atomic_inc(i32* @get_xid.xid, i32 1)
ret i32 %6
}

LLVM IR (-O2):
@get_xid.xid = internal global i32 -1
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* bitcast (i32 ()* @get_xid to void ()*), i8* null }]
define i32 @get_xid() {
%1 = load i32, i32* @get_xid.xid
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @time(i32 0)
store i32 %4, i32* @get_xid.xid
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @atomic_inc(i32* @get_xid.xid, i32 1)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ restore_db();
int main() {
  for (;;) {
    restore_db();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <restore_db@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <restore_db@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @restore_db()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @restore_db()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x9c() {
  Assert_real((isxdigit(156) == 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_isxdigit.c",
              785, ("isxdigit should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x311,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x9c\00"
define void @t_isxdigit_0x9c() {
%1 = call i64 @isxdigit(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x9c\00"
define void @t_isxdigit_0x9c() {
%1 = tail call i64 @isxdigit(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float drand48();
float random_float() { return drand48(); }


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

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

LLVM IR (-O0):
define float @random_float() {
%1 = call float (...) @drand48()
ret float %1
}

LLVM IR (-O2):
define float @random_float() {
%1 = tail call float (...) @drand48()
ret float %1
}
void RTUtf16ToUtf8Tag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUtf16ToUtf8Tag() {
ret void
}