xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long PWMGenPeriodGet(int, int);
unsigned long wave_pwm_get_value(void) {
  return PWMGenPeriodGet(0x40028000, 0x00000040);
}


x86 assembly (clang, -O0):
<wave_pwm_get_value>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40028000,%edi
mov    $0x40,%esi
call   1030 <PWMGenPeriodGet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_pwm_get_value>:
mov    $0x40028000,%edi
mov    $0x40,%esi
jmp    1030 <PWMGenPeriodGet@plt>

LLVM IR (-O0):
define i64 @wave_pwm_get_value() {
%1 = call i64 @PWMGenPeriodGet(i32 1073905664, i32 64)
ret i64 %1
}

LLVM IR (-O2):
define i64 @wave_pwm_get_value() {
%1 = tail call i64 @PWMGenPeriodGet(i32 1073905664, i32 64)
ret i64 %1
}
void sighandler(int sig) { void debug_target_quit_next(); }


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

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

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

LLVM IR (-O2):
define void @sighandler(i32 %0) {
ret void
}
void testfunc_00(const char *ap, char *bp) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[25];
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x8(%rbp),%rax
mov    0x19(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    0xf(%rdi),%al
mov    %al,(%rsi)
mov    0x5(%rdi),%al
mov    %al,0x2(%rsi)
mov    0x7(%rdi),%al
mov    %al,0x9(%rsi)
mov    0x19(%rdi),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_00(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 = getelementptr inbounds i8, i8* %5, i64 15
%7 = load i8, i8* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 5
%12 = load i8, i8* %11
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 %12, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 7
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 9
store i8 %17, i8* %19
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 25
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @testfunc_00(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 15
%4 = load i8, i8* %3
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 5
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 7
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %1, i64 9
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 25
%12 = load i8, i8* %11
store i8 %12, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_socket_server_set_callback() {
  printf("NOT IMPLEMENTED:"
         "pa_socket_server_set_callback"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"NOT IMPLEMENTED:pa_socket_server_set_callback\0A\00"
define i32 @pa_socket_server_set_callback() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_socket_server_set_callback\00"
define i32 @pa_socket_server_set_callback() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void foo5d() {}


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

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

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

LLVM IR (-O2):
define void @foo5d() {
ret void
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "wrong arguments\n");
    return -132409;
  }
  printf("%f\n", atof(argv[1]));
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1171 <main+0x41>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xfffdfac7,-0x4(%rbp)
jmp    118a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    114f <main+0x1f>
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xfffdfac7,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"wrong arguments\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 -132409, i32* %3
br label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call double @atof(i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %15)
br label %17
17: ; preds = %11, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"wrong arguments\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call double @atof(i8* %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %10)
br label %12
12: ; preds = %7, %4
%13 = phi i32 [ -132409, %4 ], [ 0, %7 ]
ret i32 %13
}
void gtk_menu_shell_append() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_shell_append() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_exception_illegal();
int /*<<< orphan*/ m68ki_exception_trap(int);
void m68k_op_trapt_32(void) {
  if (0) {
    m68ki_exception_trap(7);
    return;
  }
  m68ki_exception_illegal();
}


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

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

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

LLVM IR (-O2):
define void @m68k_op_trapt_32() {
%1 = tail call i32 (...) @m68ki_exception_illegal()
ret void
}
int nand_wait_rb_before(void) { return 1 ? 1 : 0; }


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

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

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

LLVM IR (-O2):
define i32 @nand_wait_rb_before() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void foo(int arg) {
  if (arg != 5)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
je     112c <foo+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x5,%edi
jne    1116 <foo+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 5
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
void *childGreetings(void *id) {
  unsigned long *buf = (unsigned long *)id;
  unsigned long childID = buf[0];
  unsigned long numThreads = buf[1];
  printf("Greetings from child #%lu of %lu\n", childID, numThreads);
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Greetings from child #%lu of %lu\0A\00"
define i8* @childGreetings(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %3
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
store i64 %10, i64* %4
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
store i64 %13, i64* %5
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %14, i64 %15)
ret i8* null
}

LLVM IR (-O2):
@.str = [34 x i8] c"Greetings from child #%lu of %lu\0A\00"
define noalias i8* @childGreetings(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = getelementptr inbounds i8, i8* %0, i64 8
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %6)
ret i8* null
}
void d_fetchsw(register const unsigned char **ptr,
               register signed short *dest) {
  *dest = (((signed short)(*ptr)[0] << 8) | ((unsigned short)(*ptr)[1] << 0));
  *ptr += 2;
}


x86 assembly (clang, -O0):
<d_fetchsw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
cwtl
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fetchsw>:
mov    (%rdi),%rax
movzwl (%rax),%ecx
rol    $0x8,%cx
mov    %cx,(%rsi)
add    $0x2,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @d_fetchsw(i8** nocapture %0, i16* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = or i16 %6, %9
store i16 %10, i16* %1
%11 = getelementptr inbounds i8, i8* %3, i64 2
store i8* %11, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void ndb_osdep_createBatchImportAll_end(FILE *fBatch, char *pFName) {
  fprintf(fBatch, "# === create chapter list for check by user =========\n");
  fprintf(fBatch, "ndbl %s_new\n", pFName);
  fflush(fBatch);
}


x86 assembly (clang, -O0):
<ndb_osdep_createBatchImportAll_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xee6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndb_osdep_createBatchImportAll_end>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    $0x36,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"# === create chapter list for check by user =========\0A\00"
@.str.1 = [13 x i8] c"ndbl %s_new\0A\00"
define void @ndb_osdep_createBatchImportAll_end(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32*, i32** %3
%11 = call i32 @fflush(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"# === create chapter list for check by user =========\0A\00"
@.str.1 = [13 x i8] c"ndbl %s_new\0A\00"
define void @ndb_osdep_createBatchImportAll_end(i32* nocapture %0, i8* %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i64 54, i64 1, i32* %0)
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 @fflush(i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
int buzzlex_isnumber(char c) { return isdigit(c) || (c == '.'); }


x86 assembly (clang, -O0):
<buzzlex_isnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <buzzlex_isnumber+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzzlex_isnumber>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x2e,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @buzzlex_isnumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 46
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @buzzlex_isnumber(i8 signext %0) {
%2 = tail call i64 @isdigit(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 46
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sls_animal_run();
int main(int argc, char **argv) {
  sls_animal_run();
  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 <sls_animal_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sls_animal_run@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 (...) @sls_animal_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sls_animal_run()
ret i32 0
}
__attribute__((weak)) void PMC_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @PMC_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
void signal_handler(int signal) {
  printf("Kill received %d !\n", signal);
  exit(0);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Kill received %d !\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"Kill received %d !\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dump(int);
int /*<<< orphan*/ printf(char *);
extern void Trust_Packet(int len) {
  printf("\tTrust - ");
  dump(len);
  printf("\n");
}


x86 assembly (clang, -O0):
<Trust_Packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <dump@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Trust_Packet>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <dump@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"\09Trust - \00"
define void @Trust_Packet(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @dump(i32 %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ filenames_init();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ print_config();
int /*<<< orphan*/ rescue_old_libcalls();
int /*<<< orphan*/ stderr;
void hijacker_init(void) {
  static int isinit = 0;
  if (isinit)
    return;
  isinit++;
  do {
    if (1 < 1)
      fprintf(stderr, "hijacker: skype_bt_hijacker v%s initializing.\n",
              "0.1b");
  } while (0);
  rescue_old_libcalls();
  filenames_init();
  print_config();
}


x86 assembly (clang, -O0):
<hijacker_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f01(%rip)
je     1146 <hijacker_init+0x16>
jmp    116f <hijacker_init+0x3f>
mov    0x2ef0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee7(%rip)
jmp    115a <hijacker_init+0x2a>
mov    $0x0,%al
call   1040 <rescue_old_libcalls@plt>
mov    $0x0,%al
call   1030 <filenames_init@plt>
mov    $0x0,%al
call   1050 <print_config@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hijacker_init>:
push   %rax
cmpb   $0x0,0x2f04(%rip)
je     113c <hijacker_init+0xc>
pop    %rax
ret
movb   $0x1,0x2ef9(%rip)
xor    %eax,%eax
call   1040 <rescue_old_libcalls@plt>
xor    %eax,%eax
call   1030 <filenames_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <print_config@plt>

LLVM IR (-O0):
@hijacker_init.isinit = internal global i32 0
@stderr = global i32 0
define void @hijacker_init() {
%1 = load i32, i32* @hijacker_init.isinit
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %12
4: ; preds = %0
%5 = load i32, i32* @hijacker_init.isinit
%6 = add nsw i32 %5, 1
store i32 %6, i32* @hijacker_init.isinit
br label %7
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = call i32 (...) @rescue_old_libcalls()
%10 = call i32 (...) @filenames_init()
%11 = call i32 (...) @print_config()
br label %12
12: ; preds = %8, %3
ret void
}

LLVM IR (-O2):
@hijacker_init.isinit = internal unnamed_addr global i1 false
@stderr = global i32 0
define void @hijacker_init() {
%1 = load i1, i1* @hijacker_init.isinit
br i1 %1, label %6, label %2
2: ; preds = %0
store i1 true, i1* @hijacker_init.isinit
%3 = tail call i32 (...) @rescue_old_libcalls()
%4 = tail call i32 (...) @filenames_init()
%5 = tail call i32 (...) @print_config()
br label %6
6: ; preds = %0, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CleanupScreen(int);
void CleanupBoard(int scr) { CleanupScreen(scr); }


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

x86 assembly (clang, -O2):
<CleanupBoard>:
jmp    1030 <CleanupScreen@plt>

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

LLVM IR (-O2):
define void @CleanupBoard(i32 %0) {
%2 = tail call i32 @CleanupScreen(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pf2() { printf("Function Test 2\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Function Test 2\00"
define void @pf2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ambe_decoder {
  int dummy;
};
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
int ambe_decode_dtx(struct ambe_decoder *dec, int16_t *audio, int N) {
  memset(audio, 0x00, sizeof(int16_t) * N);
  return 0;
}


x86 assembly (clang, -O0):
<ambe_decode_dtx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ambe_decode_dtx>:
push   %rax
mov    %rsi,%rdi
shl    $0x2,%edx
xor    %esi,%esi
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ambe_decoder = type { i32 }
define i32 @ambe_decode_dtx(%struct.ambe_decoder* %0, i32* %1, i32 %2) {
%4 = alloca %struct.ambe_decoder*
%5 = alloca i32*
%6 = alloca i32
store %struct.ambe_decoder* %0, %struct.ambe_decoder** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 4, %9
%11 = trunc i64 %10 to i32
%12 = call i32 @memset(i32* %7, i32 0, i32 %11)
ret i32 0
}

LLVM IR (-O2):
%struct.ambe_decoder = type { i32 }
define i32 @ambe_decode_dtx(%struct.ambe_decoder* nocapture readnone %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memset(i32* %1, i32 0, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t xtime(uint8_t x) { return ((x << 1) ^ (((x >> 7) & 1) * 0x1b)); }


x86 assembly (clang, -O0):
<xtime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
and    $0x1,%ecx
imul   $0x1b,%ecx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtime>:
lea    (%rdi,%rdi,1),%ecx
shr    $0x7,%edi
and    $0x1,%edi
lea    (%rdi,%rdi,8),%eax
lea    (%rax,%rax,2),%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xtime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 7
%7 = and i32 %6, 1
%8 = mul nsw i32 %7, 27
%9 = xor i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @xtime(i32 %0) {
%2 = shl i32 %0, 1
%3 = lshr i32 %0, 7
%4 = and i32 %3, 1
%5 = mul nuw nsw i32 %4, 27
%6 = xor i32 %5, %2
ret i32 %6
}
void local(void) {
  int localvar __attribute__((annotate("localvar_ann_0")))
  __attribute__((annotate("localvar_ann_1"))) = 3;
}


x86 assembly (clang, -O0):
<local>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"localvar_ann_0\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp9bd67xrj/formatted_code.c\00", section "llvm.metadata"
@.str.2 = [15 x i8] c"localvar_ann_1\00", section "llvm.metadata"
define void @local() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"localvar_ann_0\00", section "llvm.metadata"
@.str.1 = [62 x i8] c"/home/jiang/dataset/exebench/tmp/tmp9bd67xrj/formatted_code.c\00", section "llvm.metadata"
@.str.2 = [15 x i8] c"localvar_ann_1\00", section "llvm.metadata"
define void @local() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
ret void
}
int wts_double_to_int_cap(double d) {
  if (d > 0x7fffffff)
    return 0x7fffffff;
  else
    return (int)d;
}


x86 assembly (clang, -O0):
<wts_double_to_int_cap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    112c <wts_double_to_int_cap+0x2c>
movl   $0x7fffffff,-0x4(%rbp)
jmp    1134 <wts_double_to_int_cap+0x34>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wts_double_to_int_cap>:
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @wts_double_to_int_cap(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0x41DFFFFFFFC00000
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2147483647, i32* %2
br label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = fptosi double %8 to i32
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @wts_double_to_int_cap(double %0) {
%2 = fcmp oge double %0, 0x41DFFFFFFFC00000
%3 = select i1 %2, double 0x41DFFFFFFFC00000, double %0
%4 = fptosi double %3 to i32
ret i32 %4
}
extern char *ReturnString() { return "epic cuteness"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"epic cuteness\00"
define i8* @ReturnString() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"epic cuteness\00"
define i8* @ReturnString() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
double clo1(void *context, double a) {
  if (context)
    return *((double *)context) + a * 2;
  return a * 2;
}


x86 assembly (clang, -O0):
<clo1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1137 <clo1+0x37>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1149 <clo1+0x49>
movsd  0xec1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clo1>:
addsd  %xmm0,%xmm0
test   %rdi,%rdi
je     110d <clo1+0xd>
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @clo1(i8* %0, double %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca double
store i8* %0, i8** %4
store double %1, double* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = load double, double* %5
%13 = call double @llvm.fmuladd.f64(double %12, double 2.000000e+00, double %11)
store double %13, double* %3
br label %17
14: ; preds = %2
%15 = load double, double* %5
%16 = fmul double %15, 2.000000e+00
store double %16, double* %3
br label %17
17: ; preds = %14, %8
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
define double @clo1(i8* %0, double %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i8* %0 to double*
%6 = load double, double* %5
%7 = tail call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double %6)
br label %10
8: ; preds = %2
%9 = fmul double %1, 2.000000e+00
br label %10
10: ; preds = %8, %4
%11 = phi double [ %7, %4 ], [ %9, %8 ]
ret double %11
}
/* Variables and functions */
int simulate();
int benchmarkRun() { return simulate(); }


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

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

LLVM IR (-O0):
define i32 @benchmarkRun() {
%1 = call i32 (...) @simulate()
ret i32 %1
}

LLVM IR (-O2):
define i32 @benchmarkRun() {
%1 = tail call i32 (...) @simulate()
ret i32 %1
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isalnum(int chr) { return isalpha(chr) || isdigit(chr); }


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void bitfield_set(char *bitfield, int index) {
  bitfield[index / 8] |= (1 << (index % 8) | bitfield[index / 8]);
}


x86 assembly (clang, -O0):
<bitfield_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
or     %eax,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitfield_set>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     %al,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define void @bitfield_set(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = sdiv i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
int strlen(char *);
void chrcat(char *str, char chr) {
  int ln;
  ln = strlen(str);
  str[ln] = chr;
  str[ln + 1] = '\0';
}


x86 assembly (clang, -O0):
<chrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x9(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrcat>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
mov    %bpl,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @chrcat(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8, i8* %4
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 %8, i8* %12
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @chrcat(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %1, i8* %5
%6 = add nsw i32 %3, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
void orient(char **start, char **end) {
  if (*end < *start) {
    char *tmp = *end;
    *end = *start;
    *start = tmp;
  }
}


x86 assembly (clang, -O0):
<orient>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%rax
jae    1144 <orient+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<orient>:
mov    (%rsi),%rax
mov    (%rdi),%rcx
cmp    %rcx,%rax
jae    1111 <orient+0x11>
mov    %rcx,(%rsi)
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @orient(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8*, i8** %0
%5 = icmp ult i8* %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i8* %4, i8** %1
store i8* %3, i8** %0
br label %7
7: ; preds = %6, %2
ret void
}
void SteamAPI_ISteamUser_StartVoiceRecording(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamUser_StartVoiceRecording>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_StartVoiceRecording = [40 x i8] c"SteamAPI_ISteamUser_StartVoiceRecording\00"
define void @SteamAPI_ISteamUser_StartVoiceRecording(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @__func__.SteamAPI_ISteamUser_StartVoiceRecording, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamUser_StartVoiceRecording = [40 x i8] c"SteamAPI_ISteamUser_StartVoiceRecording\00"
define void @SteamAPI_ISteamUser_StartVoiceRecording(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @__func__.SteamAPI_ISteamUser_StartVoiceRecording, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ scanf(char *, char *);
void *h_input(void *arg) {
  char c;
  while (1) {
    scanf("%c", &c);
    if (c == 'q')
      break;
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<h_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x71,%eax
jne    114e <h_input+0x2e>
jmp    1153 <h_input+0x33>
jmp    112c <h_input+0xc>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_input>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x7(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpb   $0x71,0x7(%rsp)
jne    1130 <h_input+0x10>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i8* @h_input(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
br label %5
5: ; preds = %1, %11
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 113
br i1 %9, label %10, label %11
10: ; preds = %5
br label %12
11: ; preds = %5
br label %5
12: ; preds = %10
%13 = call i32 @pthread_exit(i32* null)
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define noalias i8* @h_input(i8* nocapture readnone %0) {
%2 = alloca i8
br label %3
3: ; preds = %3, %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 113
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pclose(int /*<<< orphan*/ *);
int clipboard_xclip_close(FILE *p) { return pclose(p); }


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

x86 assembly (clang, -O2):
<clipboard_xclip_close>:
jmp    1030 <pclose@plt>

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

LLVM IR (-O2):
define i32 @clipboard_xclip_close(i32* nocapture %0) {
%2 = tail call i32 @pclose(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int connect_socket(char *, int);
int /*<<< orphan*/ delete_block_on_fs(int, int);
int delete_block(char *host, int port, int block_id) {
  int sock_id = connect_socket(host, port);
  delete_block_on_fs(sock_id, block_id);
  close(sock_id);
  return 1;
}


x86 assembly (clang, -O0):
<delete_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <connect_socket@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <delete_block_on_fs@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_block>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
call   1030 <connect_socket@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <delete_block_on_fs@plt>
mov    %ebp,%edi
call   1040 <close@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @delete_block(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @connect_socket(i8* %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = call i32 @delete_block_on_fs(i32 %11, i32 %12)
%14 = load i32, i32* %7
%15 = call i32 @close(i32 %14)
ret i32 1
}

LLVM IR (-O2):
define i32 @delete_block(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @connect_socket(i8* %0, i32 %1)
%5 = tail call i32 @delete_block_on_fs(i32 %4, i32 %2)
%6 = tail call i32 @close(i32 %4)
ret i32 1
}
/* Variables and functions */
float simple_cos(float const);
float simple_sin(float const);
float simple_tan(const float x) { return simple_sin(x) / simple_cos(x); }


x86 assembly (clang, -O0):
<simple_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <simple_sin@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <simple_cos@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_tan>:
push   %rax
movss  %xmm0,(%rsp)
call   1040 <simple_sin@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1030 <simple_cos@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @simple_tan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @simple_sin(float %3)
%5 = load float, float* %2
%6 = call float @simple_cos(float %5)
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @simple_tan(float %0) {
%2 = tail call float @simple_sin(float %0)
%3 = tail call float @simple_cos(float %0)
%4 = fdiv float %2, %3
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void DeactivateHorizontalScroll() {
  unsigned char d[] = {0x2E};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<DeactivateHorizontalScroll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeactivateHorizontalScroll>:
push   %rax
movb   $0x2e,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.DeactivateHorizontalScroll.d = [1 x i8] c"."
define void @DeactivateHorizontalScroll() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 @oled_SendCommand(i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @DeactivateHorizontalScroll() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 46, i8* %2
%3 = call i32 @oled_SendCommand(i8* %2, i32 1)
ret void
}