xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ output(char *, int);
int /*<<< orphan*/ sscanf(char const *, char *, int *);
void print24DiskRBlkInfo(const char *cmd) {
  int id;
  sscanf(cmd + 9, "%d", &id);
  output("Disk %d Read Data\t0\t0\tKB/s\n", id);
}


x86 assembly (clang, -O0):
<print24DiskRBlkInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x9,%rdi
lea    0xec5(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print24DiskRBlkInfo>:
push   %rax
add    $0x9,%rdi
lea    0xed4(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <output@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"Disk %d Read Data\090\090\09KB/s\0A\00"
define void @print24DiskRBlkInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 9
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @output(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [28 x i8] c"Disk %d Read Data\090\090\09KB/s\0A\00"
define void @print24DiskRBlkInfo(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %0, i64 9
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @output(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int, void (*)(int));
void sig_eater(int signum) {
  printf("got signal %d\n", signum);
  signal(signum, sig_eater);
}


x86 assembly (clang, -O0):
<sig_eater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea4(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_eater>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2eb0(%rip),%rsi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <signal@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"got signal %d\0A\00"
define void @sig_eater(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @signal(i32 %0, void (i32)* @sig_eater)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *cmd) {
  fprintf(stderr,
          "Usage: \t%s \"A test string with at least one '«' as argument\"\n",
          cmd);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: \09%s \22A test string with at least one '\C2\AB' as argument\22\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"Usage: \09%s \22A test string with at least one '\C2\AB' as argument\22\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void OBJ_create_objects(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_create_objects() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __gc_exit();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int Game_Over() {
  __gc_exit();
  sleep(1);
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<Game_Over>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__gc_exit@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<Game_Over>:
push   %rax
xor    %eax,%eax
call   1040 <__gc_exit@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @Game_Over() {
%1 = call i32 (...) @__gc_exit()
%2 = call i32 @sleep(i32 1)
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @Game_Over() {
%1 = tail call i32 (...) @__gc_exit()
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dmatrix(double **M, long i0, long NI, long j0, long NJ) {
  free((char *)(M[i0] + j0 - 1));
  free((char *)(M + i0 - 1));
}


x86 assembly (clang, -O0):
<free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 %3
%9 = getelementptr inbounds double, double* %8, i64 -1
%10 = bitcast double* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds double*, double** %6, i64 -1
%13 = bitcast double** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void message_404() {
  printf("HTTP/1.1 404 Bad Request\r\n");
  printf("Connection: close\r\n");
  printf("Content-Length: 17\r\n");
}


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

x86 assembly (clang, -O2):
<message_404>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"HTTP/1.1 404 Bad Request\0D\0A\00"
@.str.1 = [20 x i8] c"Connection: close\0D\0A\00"
@.str.2 = [21 x i8] c"Content-Length: 17\0D\0A\00"
define void @message_404() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"HTTP/1.1 404 Bad Request\0D\00"
@str.3 = [19 x i8] c"Connection: close\0D\00"
@str.4 = [20 x i8] c"Content-Length: 17\0D\00"
define void @message_404() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ amaret_local_Mcu_reset__E();
int /*<<< orphan*/ pollen_hardware_Led_off__E();
void test36_Blink3_pollen__reset__E() {
  amaret_local_Mcu_reset__E();
  pollen_hardware_Led_off__E();
}


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

x86 assembly (clang, -O2):
<test36_Blink3_pollen__reset__E>:
push   %rax
xor    %eax,%eax
call   1030 <amaret_local_Mcu_reset__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pollen_hardware_Led_off__E@plt>

LLVM IR (-O0):
define void @test36_Blink3_pollen__reset__E() {
%1 = call i32 (...) @amaret_local_Mcu_reset__E()
%2 = call i32 (...) @pollen_hardware_Led_off__E()
ret void
}

LLVM IR (-O2):
define void @test36_Blink3_pollen__reset__E() {
%1 = tail call i32 (...) @amaret_local_Mcu_reset__E()
%2 = tail call i32 (...) @pollen_hardware_Led_off__E()
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ window;
};
struct TYPE_4__ {
  TYPE_1__ xproperty;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xproperty_window(void *_p) {
  return (unsigned long)((XEvent *)_p)->xproperty.window;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xproperty_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xproperty_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xproperty_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int lseek(int, int, int /*<<< orphan*/);
int rd_lseek_file(int fd, int offset) { return lseek(fd, offset, SEEK_SET); }


x86 assembly (clang, -O0):
<rd_lseek_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_lseek_file>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @rd_lseek_file(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @lseek(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @rd_lseek_file(i32 %0, i32 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printftest() { printf("libjavaio.so\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"libjavaio.so\00"
define void @printftest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *memcpy(void *, void *, size_t);
void *__attribute__((no)) memcpy_f(void *dst, const void *src, size_t n) {
  return memcpy(dst, (void *)((uintptr_t)src), n);
}


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

x86 assembly (clang, -O2):
<memcpy_f>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i8* @memcpy_f(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = load i64, i64* %6
%12 = call i8* @memcpy(i8* %7, i8* %10, i64 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @memcpy_f(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
int isprint(int c) {
  if (c >= 32 && c <= 126)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     1127 <isprint+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 32
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rx(int *, int);
int getAck(int *status) {
  uint8_t mybuf[2];
  int rc = rx(mybuf, 1);
  if (status)
    *status = rc;
  return *mybuf & 1;
}


x86 assembly (clang, -O0):
<getAck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <rx@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <getAck+0x31>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAck>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1030 <rx@plt>
test   %rbx,%rbx
je     112e <getAck+0x1e>
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getAck(i32* writeonly %0) {
%2 = alloca [2 x i32]
%3 = bitcast [2 x i32]* %2 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%5 = call i32 @rx(i32* %4, i32 1)
%6 = icmp eq i32* %0, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 %5, i32* %0
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %4
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void *print_message_function(void *ptr) {
  char *message;
  message = (char *)ptr;
  printf("\n %s \n", message);
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A %s \0A\00"
define noalias i8* @print_message_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* undef
}
int descramble(int in, int *state) {
  int out;
  out = (in ^ (*state >> 16) ^ (*state >> 11)) & 1;
  *state = (*state << 1) | (in & 1);
  return (out);
}


x86 assembly (clang, -O0):
<descramble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sar    $0xb,%ecx
xor    %ecx,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<descramble>:
mov    (%rsi),%eax
mov    %eax,%ecx
shr    $0x10,%ecx
xor    %edi,%ecx
and    $0x1,%edi
lea    (%rdi,%rax,2),%edx
shr    $0xb,%eax
xor    %ecx,%eax
and    $0x1,%eax
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define i32 @descramble(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = ashr i32 %8, 16
%10 = xor i32 %6, %9
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = ashr i32 %12, 11
%14 = xor i32 %10, %13
%15 = and i32 %14, 1
store i32 %15, i32* %5
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = shl i32 %17, 1
%19 = load i32, i32* %3
%20 = and i32 %19, 1
%21 = or i32 %18, %20
%22 = load i32*, i32** %4
store i32 %21, i32* %22
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @descramble(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = lshr i32 %3, 16
%5 = xor i32 %4, %0
%6 = lshr i32 %3, 11
%7 = xor i32 %5, %6
%8 = and i32 %7, 1
%9 = shl i32 %3, 1
%10 = and i32 %0, 1
%11 = or i32 %9, %10
store i32 %11, i32* %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init_red_led();
int /*<<< orphan*/ gpio_toggle_red_led();
int /*<<< orphan*/ some_delay(unsigned int);
int /*<<< orphan*/ system_init();
int main(void) {
  system_init();
  gpio_init_red_led();
  while (1) {
    gpio_toggle_red_led();
    some_delay(10000u);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <system_init@plt>
mov    $0x0,%al
call   1030 <gpio_init_red_led@plt>
mov    $0x0,%al
call   1040 <gpio_toggle_red_led@plt>
mov    $0x2710,%edi
call   1060 <some_delay@plt>
jmp    115d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <system_init@plt>
xor    %eax,%eax
call   1030 <gpio_init_red_led@plt>
nop
xor    %eax,%eax
call   1040 <gpio_toggle_red_led@plt>
mov    $0x2710,%edi
call   1060 <some_delay@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @system_init()
%3 = call i32 (...) @gpio_init_red_led()
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @gpio_toggle_red_led()
%6 = call i32 @some_delay(i32 10000)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @system_init()
%2 = tail call i32 (...) @gpio_init_red_led()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @gpio_toggle_red_led()
%5 = tail call i32 @some_delay(i32 10000)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: treecmp [-cv] old_dir new_dir\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: treecmp [-cv] old_dir new_dir\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"Usage: treecmp [-cv] old_dir new_dir\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int keyGenerator(int key, int round) {
  key += key * 2 * round;
  return key;
}


x86 assembly (clang, -O0):
<keyGenerator>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyGenerator>:
imul   %edi,%esi
lea    (%rdi,%rsi,2),%eax
ret

LLVM IR (-O0):
define i32 @keyGenerator(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 = mul nsw i32 %5, 2
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @keyGenerator(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = mul nsw i32 %3, %1
%5 = add nsw i32 %4, %0
ret i32 %5
}
int main() {
  volatile int a = 123456;
  if (__builtin_abs(a) != 123456) {
    return 1;
  }
  volatile int b = -123456;
  if (__builtin_abs(b) != 123456) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1e240,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
cmp    $0x1e240,%eax
je     1136 <main+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1168 <main+0x68>
movl   $0xfffe1dc0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    %ecx,%ecx
sub    %eax,%ecx
cmp    $0x0,%eax
cmovl  %ecx,%eax
cmp    $0x1e240,%eax
je     1161 <main+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <main+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1e240,-0x4(%rsp)
mov    -0x4(%rsp),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
mov    $0x1,%eax
cmp    $0x1e240,%ecx
jne    113e <main+0x3e>
movl   $0xfffe1dc0,-0x8(%rsp)
ff
mov    -0x8(%rsp),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
xor    %eax,%eax
cmp    $0x1e240,%ecx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store volatile i32 123456, i32* %1
%4 = load volatile i32, i32* %1
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = icmp eq i32 %5, 123456
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = bitcast i32* %2 to i8*
store volatile i32 -123456, i32* %2
%9 = load volatile i32, i32* %2
%10 = tail call i32 @llvm.abs.i32(i32 %9, i1 true)
%11 = icmp ne i32 %10, 123456
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %0, %7
%14 = phi i32 [ %12, %7 ], [ 1, %0 ]
ret i32 %14
}
/* Variables and functions */
int strlen(char *);
char *btshas_getext(char *fn) {
  char *s;
  s = fn + strlen(fn);
  while ((s > fn) && s[-1] != '.')
    s--;
  return (s);
}


x86 assembly (clang, -O0):
<btshas_getext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jbe    1161 <btshas_getext+0x51>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1171 <btshas_getext+0x61>
jmp    1182 <btshas_getext+0x72>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <btshas_getext+0x2d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btshas_getext>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
add    %rbx,%rcx
nop
mov    %rcx,%rax
cmp    %rbx,%rcx
jbe    1132 <btshas_getext+0x22>
lea    -0x1(%rax),%rcx
cmpb   $0x2e,-0x1(%rax)
jne    1120 <btshas_getext+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @btshas_getext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8* %8, i8** %3
br label %9
9: ; preds = %21, %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = icmp ugt i8* %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 -1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 46
br label %19
19: ; preds = %13, %9
%20 = phi i1 [ false, %9 ], [ %18, %13 ]
br i1 %20, label %21, label %24
21: ; preds = %19
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 -1
store i8* %23, i8** %3
br label %9
24: ; preds = %19
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @btshas_getext(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %8, %1
%6 = phi i8* [ %4, %1 ], [ %9, %8 ]
%7 = icmp ugt i8* %6, %0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 46
br i1 %11, label %12, label %5
12: ; preds = %5, %8
ret i8* %6
}
int test2(int c, int d) { return -c == -d; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xor    %eax,%eax
cmp    %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @test2(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 = sub nsw i32 0, %5
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, C!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
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 = [11 x i8] c"Hello, C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"Hello, C!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mark_mapped(int, int);
void all_mapped() {
  int i, j;
  for (i = 0; i < 20; i++)
    for (j = 0; j < 49; j++)
      mark_mapped(i, j);
}


x86 assembly (clang, -O0):
<all_mapped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jge    1166 <all_mapped+0x56>
movl   $0x0,-0x8(%rbp)
cmpl   $0x31,-0x8(%rbp)
jge    1153 <all_mapped+0x43>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mark_mapped@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <all_mapped+0x20>
jmp    1158 <all_mapped+0x48>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <all_mapped+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_mapped>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <mark_mapped@plt>
add    $0x1,%ebp
cmp    $0x31,%ebp
jne    1130 <all_mapped+0x20>
add    $0x1,%ebx
cmp    $0x14,%ebx
jne    1120 <all_mapped+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @all_mapped() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 20
br i1 %5, label %6, label %21
6: ; preds = %3
store i32 0, i32* %2
br label %7
7: ; preds = %14, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 49
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @mark_mapped(i32 %11, i32 %12)
br label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %7
17: ; preds = %7
br label %18
18: ; preds = %17
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %3
21: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @all_mapped() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @mark_mapped(i32 %2, i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 49
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 20
br i1 %10, label %11, label %1
11: ; preds = %8
ret void
}
void set_netdump_dest_unicast(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<set_netdump_dest_unicast>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_netdump_dest_unicast>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.set_netdump_dest_unicast = [25 x i8] c"set_netdump_dest_unicast\00"
define void @set_netdump_dest_unicast() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.set_netdump_dest_unicast, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.set_netdump_dest_unicast = [25 x i8] c"set_netdump_dest_unicast\00"
define void @set_netdump_dest_unicast() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @__func__.set_netdump_dest_unicast, i64 0, i64 0))
ret void
}
void foo_1_2_1_2_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_2_2_1_1() {
ret void
}
int xyzzy(void) {
  printf("%s:%s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/"
         "ARMToolChain/source/glibc-2.21/elf/tst-deep1mod3.c",
         __func__);
  return 0;
}


x86 assembly (clang, -O0):
<xyzzy>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee5(%rip),%rsi
lea    0xf90(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/ARMToolChain/source/glibc-2.21/elf/tst-deep1mod3.c\00"
@__func__.xyzzy = [6 x i8] c"xyzzy\00"
define i32 @xyzzy() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.xyzzy, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%s\0A\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Boshin/workspace/refs/heads/baseline/ARMToolChain/source/glibc-2.21/elf/tst-deep1mod3.c\00"
@__func__.xyzzy = [6 x i8] c"xyzzy\00"
define i32 @xyzzy() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.xyzzy, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_set_locking_callback(int /*<<< orphan*/);
int /*<<< orphan*/ openssl_locking_callback;
void openssl_init_locks() {
  CRYPTO_set_locking_callback(openssl_locking_callback);
}


x86 assembly (clang, -O0):
<openssl_init_locks>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <CRYPTO_set_locking_callback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_init_locks>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <CRYPTO_set_locking_callback@plt>

LLVM IR (-O0):
@openssl_locking_callback = global i32 0
define void @openssl_init_locks() {
%1 = load i32, i32* @openssl_locking_callback
%2 = call i32 @CRYPTO_set_locking_callback(i32 %1)
ret void
}

LLVM IR (-O2):
@openssl_locking_callback = global i32 0
define void @openssl_init_locks() {
%1 = load i32, i32* @openssl_locking_callback
%2 = tail call i32 @CRYPTO_set_locking_callback(i32 %1)
ret void
}
XKillClient() {}


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

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

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

LLVM IR (-O2):
define i32 @XKillClient() {
ret i32 undef
}
/* Variables and functions */
int decode_key_pressed();
char *get_key_name(int);
int /*<<< orphan*/ puts(char const *);
int main() {
  int i = decode_key_pressed();
  const char *kn = get_key_name(i);
  puts(kn);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <decode_key_pressed@plt>
mov    %eax,%edi
call   1040 <get_key_name@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i32 (...) @decode_key_pressed()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i8* @get_key_name(i32 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @puts(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @decode_key_pressed()
%2 = tail call i8* @get_key_name(i32 %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void sbtabort() { kill(getpid(), SIGABRT); }


x86 assembly (clang, -O0):
<sbtabort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbtabort>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @sbtabort() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = call i32 @kill(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @sbtabort() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret void
}
int main() {
  int volatile a;
  int *volatile b;
  float *const c;
  long double d;
  static const int kDuration = 3;
  int large_int = 9223372036854775807;
  int overflow_int = 9223372036854775808;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@main.kDuration = internal constant i32 3
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca float*
%5 = alloca x86_fp80
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %6
store i32 0, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int execute_fstat64() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_fstat64() {
ret i32 0
}
int comp(const void *a, const void *b) { return *(int *)a - *(int *)b; }


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x2_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x2_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x2_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x2_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x2_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void RemoveSound(void) {}


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

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

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

LLVM IR (-O2):
define void @RemoveSound() {
ret void
}
void GPIOPortP5_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortP5_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortP5_Handler+0x9>
jmp    1109 <GPIOPortP5_Handler+0x9>

x86 assembly (clang, -O2):
<GPIOPortP5_Handler>:
jmp    1100 <GPIOPortP5_Handler>

LLVM IR (-O0):
define void @GPIOPortP5_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortP5_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ hw_register_events(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *register_fueling(int /*<<< orphan*/ *);
int /*<<< orphan*/ *register_ignition(int /*<<< orphan*/ *);
int /*<<< orphan*/ setup_HW_interface();
int /*<<< orphan*/ setup_fueling();
int /*<<< orphan*/ setup_ignition();
int main() {
  int32_t *list;
  setup_HW_interface();
  setup_fueling();
  setup_ignition();
  while (1 == 1) {
    list = register_fueling(list);
    list = register_ignition(list);
    if (list != NULL) {
      hw_register_events(list, list[0]);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <setup_HW_interface@plt>
mov    $0x0,%al
call   1060 <setup_fueling@plt>
mov    $0x0,%al
call   1040 <setup_ignition@plt>
mov    -0x10(%rbp),%rdi
call   1050 <register_fueling@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <register_ignition@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11b8 <main+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1080 <hw_register_events@plt>
jmp    1184 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <setup_HW_interface@plt>
xor    %eax,%eax
call   1040 <setup_fueling@plt>
xor    %eax,%eax
call   1030 <setup_ignition@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 (...) @setup_HW_interface()
%4 = call i32 (...) @setup_fueling()
%5 = call i32 (...) @setup_ignition()
br label %6
6: ; preds = %0, %19
%7 = load i32*, i32** %2
%8 = call i32* @register_fueling(i32* %7)
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = call i32* @register_ignition(i32* %9)
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %19
13: ; preds = %6
%14 = load i32*, i32** %2
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
%18 = call i32 @hw_register_events(i32* %14, i32 %17)
br label %19
19: ; preds = %13, %6
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_HW_interface()
%2 = tail call i32 (...) @setup_fueling()
%3 = tail call i32 (...) @setup_ignition()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ UART1_Write_Text(char *);
void say_hello() { UART1_Write_Text("Hello"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define void @say_hello() {
%1 = tail call i32 @UART1_Write_Text(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}