xunge/DecIR huggingface dataset:
void __attribute__((weak)) tim11_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim11_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim11_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim11_isr = [10 x i8] c"tim11_isr\00"
define weak void @tim11_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.tim11_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim11_isr = [10 x i8] c"tim11_isr\00"
define weak void @tim11_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.tim11_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nullf(char *, int);
int /*<<< orphan*/ output_byte(int);
void emit_fadd(int r) {
  nullf("fadd st%d\n", r);
  output_byte(0xd8);
  output_byte(0xc0 + r);
}


x86 assembly (clang, -O0):
<emit_fadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <nullf@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
mov    -0x4(%rbp),%edi
add    $0xc0,%edi
call   1040 <output_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fadd>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <nullf@plt>
mov    $0xd8,%edi
call   1040 <output_byte@plt>
add    $0xc0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <output_byte@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"fadd st%d\0A\00"
define void @emit_fadd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nullf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @output_byte(i32 216)
%6 = load i32, i32* %2
%7 = add nsw i32 192, %6
%8 = call i32 @output_byte(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"fadd st%d\0A\00"
define void @emit_fadd(i32 %0) {
%2 = tail call i32 @nullf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @output_byte(i32 216)
%4 = add nsw i32 %0, 192
%5 = tail call i32 @output_byte(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flushall();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ sum(int, int);
main() {
  int num1 = 0;
  int num2 = 0;
  printf("Enter two numbers\n");
  scanf("%d", &num1);
  scanf("%d", &num2);
  flushall();
  sum(num1, num2);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <sum@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1040 <flushall@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1060 <sum@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter two numbers\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 (...) @flushall()
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @sum(i32 %7, i32 %8)
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Enter two numbers\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (...) @flushall()
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @sum(i32 %9, i32 %10)
%12 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mmo_char_convert(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 3) {
    printf("Usage: convert <input filename> <output filename>\n");
    exit(0);
  }
  mmo_char_convert(argv[1], argv[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1163 <main+0x33>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <mmo_char_convert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jle    1147 <main+0x17>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <mmo_char_convert@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"Usage: convert <input filename> <output filename>\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 slt i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @mmo_char_convert(i8* %14, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@str = [50 x i8] c"Usage: convert <input filename> <output filename>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @mmo_char_convert(i8* %9, i8* %11)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int centruj_x(char *string) { return 160 - (strlen(string) << 2); }


x86 assembly (clang, -O0):
<centruj_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
shl    $0x2,%ecx
mov    $0xa0,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<centruj_x>:
push   %rax
call   1030 <strlen@plt>
shl    $0x2,%eax
mov    $0xa0,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @centruj_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = shl i32 %4, 2
%6 = sub nsw i32 160, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @centruj_x(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = mul i32 %2, -4
%4 = add i32 %3, 160
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ com_fopen(int /*<<< orphan*/ **, char *, char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
FILE *fopen_or_die(char *filename, const char *mode) {
  FILE *retval;
  com_fopen(&retval, filename, mode);
  if (retval == NULL) {
    perror(filename);
    exit(-1);
  }
  return retval;
}


x86 assembly (clang, -O0):
<fopen_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
call   1050 <com_fopen@plt>
cmpq   $0x0,-0x18(%rbp)
jne    116f <fopen_or_die+0x3f>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_or_die>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <com_fopen@plt>
mov    0x8(%rsp),%rax
test   %rax,%rax
je     1158 <fopen_or_die+0x28>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32* @fopen_or_die(i8* %0, i8* %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 = load i8*, i8** %4
%8 = call i32 @com_fopen(i32** %5, i8* %6, i8* %7)
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @perror(i8* %12)
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
define i32* @fopen_or_die(i8* %0, i8* %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
%5 = call i32 @com_fopen(i32** %3, i8* %0, i8* %1)
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @perror(i8* %0)
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
ret i32* %6
}
int test_imm_3Bint32_reg(int val) { return ((val) & (0x3B << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_3Bint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x3b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Bint32_reg(i32 %0) {
%2 = and i32 %0, 59
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ halt_execution();
unsigned int shutdown_dispatch(void *data) { halt_execution(); }


x86 assembly (clang, -O0):
<shutdown_dispatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <halt_execution@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @shutdown_dispatch(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @halt_execution()
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @shutdown_dispatch(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @halt_execution()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void libtest1_dtor(void) { printf("libtest1: destructor!\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"libtest1: destructor!\00"
define void @libtest1_dtor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct hashEl {
  int dummy;
};
struct hash {
  int dummy;
};
typedef int /*<<< orphan*/ s;

/* Variables and functions */
struct hashEl *hashLookup(struct hash *, char *);
int /*<<< orphan*/ safef(char *, int, char *, char *);
int /*<<< orphan*/ strUpper(char *);
struct hashEl *hashLookupUpperCase(struct hash *hash, char *name) {
  char s[256];
  safef(s, sizeof(s), "%s", name);
  (void)strUpper(s);
  return hashLookup(hash, s);
}


x86 assembly (clang, -O0):
<hashLookupUpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xea6(%rip),%rdx
call   1030 <safef@plt>
lea    -0x110(%rbp),%rdi
call   1050 <strUpper@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <hashLookup@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashLookupUpperCase>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rcx
mov    %rdi,%r14
lea    0xeb9(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <safef@plt>
mov    %rbx,%rdi
call   1050 <strUpper@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <hashLookup@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.hashEl = type { i32 }
%struct.hash = type { i32 }
@.str = [3 x i8] c"%s\00"
define %struct.hashEl* @hashLookupUpperCase(%struct.hash* %0, i8* %1) {
%3 = alloca %struct.hash*
%4 = alloca i8*
%5 = alloca [256 x i8]
store %struct.hash* %0, %struct.hash** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @safef(i8* %6, i32 256, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = call i32 @strUpper(i8* %9)
%11 = load %struct.hash*, %struct.hash** %3
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = call %struct.hashEl* @hashLookup(%struct.hash* %11, i8* %12)
ret %struct.hashEl* %13
}

LLVM IR (-O2):
%struct.hashEl = type { i32 }
%struct.hash = type { i32 }
@.str = [3 x i8] c"%s\00"
define %struct.hashEl* @hashLookupUpperCase(%struct.hash* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @safef(i8* %4, i32 256, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i32 @strUpper(i8* %4)
%7 = call %struct.hashEl* @hashLookup(%struct.hash* %0, i8* %4)
ret %struct.hashEl* %7
}
void WriteNothing(struct z26_state *s) {}


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

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

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

LLVM IR (-O2):
%struct.z26_state = type opaque
define void @WriteNothing(%struct.z26_state* nocapture %0) {
ret void
}
main() {
  int i, j;
  i <<= 1;
  j >>= 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = shl i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *atsruntime_malloc_user(size_t bsz) { return malloc(bsz); }


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

x86 assembly (clang, -O2):
<atsruntime_malloc_user>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @atsruntime_malloc_user(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ checkIfNumIsPowerOf2(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int num = -32;
  if (checkIfNumIsPowerOf2(num) == 0)
    printf("%d is power of 2\n", num);
  else
    printf("%d is not power of 2\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffe0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <checkIfNumIsPowerOf2@plt>
cmp    $0x0,%rax
jne    1163 <main+0x43>
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
jmp    1172 <main+0x52>
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffe0,%edi
call   1030 <checkIfNumIsPowerOf2@plt>
test   %rax,%rax
lea    0xecb(%rip),%rax
lea    0xed6(%rip),%rdi
cmove  %rax,%rdi
mov    $0xffffffe0,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%d is power of 2\0A\00"
@.str.1 = [22 x i8] c"%d is not power of 2\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -32, i32* %6
%7 = load i32, i32* %6
%8 = call i64 @checkIfNumIsPowerOf2(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d is power of 2\0A\00"
@.str.1 = [22 x i8] c"%d is not power of 2\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @checkIfNumIsPowerOf2(i32 -32)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* %5, i32 -32)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void RTC_WKUP_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @RTC_WKUP_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @RTC_WKUP_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int be16dec(int /*<<< orphan*/ const *);
uint32_t be32dec(const uint8_t *buf) {
  return (uint32_t)((uint32_t)be16dec(buf) << 16 | be16dec(buf + 2));
}


x86 assembly (clang, -O0):
<be32dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <be16dec@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <be16dec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32dec>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <be16dec@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
add    $0x8,%rbx
mov    %rbx,%rdi
call   1030 <be16dec@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @be32dec(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @be16dec(i32* %3)
%5 = shl i32 %4, 16
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = call i32 @be16dec(i32* %7)
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @be32dec(i32* %0) {
%2 = tail call i32 @be16dec(i32* %0)
%3 = shl i32 %2, 16
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = tail call i32 @be16dec(i32* %4)
%6 = or i32 %3, %5
ret i32 %6
}
void rop3_114_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ S;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_114_0_0>:
xor    %esi,%edx
or     (%rdi),%dl
xor    %sil,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_114_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
%7 = xor i8 %6, %1
store i8 %7, i8* %0
ret void
}
int h2(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @h2(i32 returned %0) {
ret i32 %0
}
void foo_2_2_2_2_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_2_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vuln();
int main(int argc, char *argv[]) {
  printf("My mother told me to never accept things from strangers\n");
  printf("How bad could running a couple bytes be though?\n");
  fflush(stdout);
  vuln();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <vuln@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <vuln@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"My mother told me to never accept things from strangers\0A\00"
@.str.1 = [49 x i8] c"How bad could running a couple bytes be though?\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call i32 (...) @vuln()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [56 x i8] c"My mother told me to never accept things from strangers\00"
@str.2 = [48 x i8] c"How bad could running a couple bytes be though?\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.2, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 (...) @vuln()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ buildMaxHeap(int *, int);
int /*<<< orphan*/ maxHeapify(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ swap(int *, int /*<<< orphan*/, int);
int *heapSort(int *A, int len) {
  buildMaxHeap(A, len);
  for (int i = len - 1; i >= 1; i--) {
    swap(A, 0, i);
    maxHeapify(A, i, 0);
  }
  return A;
}


x86 assembly (clang, -O0):
<heapSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <buildMaxHeap@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1188 <heapSort+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1050 <swap@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   1040 <maxHeapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1154 <heapSort+0x24>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapSort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <buildMaxHeap@plt>
cmp    $0x2,%ebx
jl     1173 <heapSort+0x43>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <swap@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %edx,%edx
call   1040 <maxHeapify@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1150 <heapSort+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @heapSort(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 = call i32 @buildMaxHeap(i32* %6, i32 %7)
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load i32, i32* %5
%13 = icmp sge i32 %12, 1
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = call i32 @swap(i32* %15, i32 0, i32 %16)
%18 = load i32*, i32** %3
%19 = load i32, i32* %5
%20 = call i32 @maxHeapify(i32* %18, i32 %19, i32 0)
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %11
24: ; preds = %11
%25 = load i32*, i32** %3
ret i32* %25
}

LLVM IR (-O2):
define i32* @heapSort(i32* returned %0, i32 %1) {
%3 = tail call i32 @buildMaxHeap(i32* %0, i32 %1)
%4 = icmp sgt i32 %1, 1
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret i32* %0
6: ; preds = %2, %6
%7 = phi i32 [ %8, %6 ], [ %1, %2 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @swap(i32* %0, i32 0, i32 %8)
%10 = tail call i32 @maxHeapify(i32* %0, i32 %8, i32 0)
%11 = icmp ugt i32 %7, 2
br i1 %11, label %6, label %5
}
int is_right_breakable(int maze[25][25], int i, int j) {
  int check = 0;
  if (j == 25 - 1) {
    check = 0;
  } else if (maze[i][j] != maze[i][j + 1]) {
    check = 1;
  }
  return check;
}


x86 assembly (clang, -O0):
<is_right_breakable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x18,-0x10(%rbp)
jne    112b <is_right_breakable+0x2b>
movl   $0x0,-0x14(%rbp)
jmp    116e <is_right_breakable+0x6e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
imul   $0x64,%rdx,%rdx
add    %rdx,%rcx
mov    -0x10(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
je     1169 <is_right_breakable+0x69>
movl   $0x1,-0x14(%rbp)
jmp    116e <is_right_breakable+0x6e>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_right_breakable>:
xor    %eax,%eax
cmp    $0x18,%edx
je     1120 <is_right_breakable+0x20>
movslq %esi,%rax
movslq %edx,%rcx
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    (%rdi,%rcx,4),%edx
xor    %eax,%eax
cmp    0x4(%rdi,%rcx,4),%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_right_breakable([25 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 24
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds [25 x i32], [25 x i32]* %0, i64 %6, i64 %7
%9 = load i32, i32* %8
%10 = add nsw i32 %2, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [25 x i32], [25 x i32]* %0, i64 %6, i64 %11
%13 = load i32, i32* %12
%14 = icmp ne i32 %9, %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %5, %3
%17 = phi i32 [ 0, %3 ], [ %15, %5 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_service() {
  puts("service [<service name>]\n"
       "Records a service against the bill of a guest. Prompts for service\n"
       "name if not provided as parameter, and for guest name.");
}


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

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

LLVM IR (-O0):
@.str = [147 x i8] c"service [<service name>]\0ARecords a service against the bill of a guest. Prompts for service\0Aname if not provided as parameter, and for guest name.\00"
define void @help_service() {
%1 = call i32 @puts(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [147 x i8] c"service [<service name>]\0ARecords a service against the bill of a guest. Prompts for service\0Aname if not provided as parameter, and for guest name.\00"
define void @help_service() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
int ConvertCharNumberToInt(char *character) { return atoi(character); }


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

x86 assembly (clang, -O2):
<ConvertCharNumberToInt>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @ConvertCharNumberToInt(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void (*)());
void foo() { printf("the addrss of foo() is %p\n", foo); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"the addrss of foo() is %p\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), void (...)* bitcast (void ()* @foo to void (...)*))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"the addrss of foo() is %p\0A\00"
define void @foo() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), void (...)* bitcast (void ()* @foo to void (...)*))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_exit(char *);
void *malloc(int);
void *buf_alloc(int size) {
  void *buf;
  if (NULL == (buf = malloc(size)))
    error_exit("out of memory");
  return buf;
}


x86 assembly (clang, -O0):
<buf_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1151 <buf_alloc+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <error_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <buf_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <error_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @buf_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* null, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @error_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @buf_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error_exit(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int sig) { printf("process alarm signal %d.\n", sig); }


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

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [26 x i8] c"process alarm signal %d.\0A\00"
define void @handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ deputy_fail_mayreturn(char const *, char const *,
                                         char const *, int, char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((regparm(0))) __attribute__((noreturn)) void
deputy_fail_noreturn(const char *check, const char *text, const char *file,
                     int line, const char *func) {
  deputy_fail_mayreturn(check, text, file, line, func);
  fprintf(stderr, "Deputy check failed; execution aborted.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<deputy_fail_noreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1040 <deputy_fail_mayreturn@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<deputy_fail_noreturn>:
push   %rax
call   1040 <deputy_fail_mayreturn@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Deputy check failed; execution aborted.\0A\00"
define void @deputy_fail_noreturn(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @deputy_fail_mayreturn(i8* %11, i8* %12, i8* %13, i32 %14, i8* %15)
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Deputy check failed; execution aborted.\0A\00"
define void @deputy_fail_noreturn(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @deputy_fail_mayreturn(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ stop();
void bsd_boot_entry(void) { stop(); }


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

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

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

LLVM IR (-O2):
define void @bsd_boot_entry() {
%1 = tail call i32 (...) @stop()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
void set_XNoExposeEvent_send_event(void *_p, int _v) {
  ((XNoExposeEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XNoExposeEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XNoExposeEvent_send_event(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XNoExposeEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ set_warn_handler(void *);
int /*<<< orphan*/ warn_v(char const *, int /*<<< orphan*/);
void die_v(const char *p, va_list args) {
  set_warn_handler(((void *)0));
  warn_v(p, args);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die_v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <set_warn_handler@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <warn_v@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die_v>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <set_warn_handler@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <warn_v@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die_v(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @set_warn_handler(i8* null)
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @warn_v(i8* %6, i32 %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die_v(i8* %0, i32 %1) {
%3 = tail call i32 @set_warn_handler(i8* null)
%4 = tail call i32 @warn_v(i8* %0, i32 %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
long Random();
short RandomInt(short range) {
  register long rawResult;
  rawResult = Random();
  if (rawResult < 0)
    rawResult *= -1;
  return (rawResult * (long)range / 32768);
}


x86 assembly (clang, -O0):
<RandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1030 <Random@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    113e <RandomInt+0x2e>
imul   $0xffffffffffffffff,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movswq -0x2(%rbp),%rcx
imul   %rcx,%rax
mov    $0x8000,%ecx
cqto
idiv   %rcx
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInt>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <Random@plt>
mov    %rax,%rcx
neg    %rcx
cmovns %rcx,%rax
movslq %ebx,%rcx
imul   %rcx,%rax
lea    0x7fff(%rax),%ecx
test   %rax,%rax
cmovs  %rcx,%rax
shr    $0xf,%rax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @RandomInt(i16 signext %0) {
%2 = alloca i16
%3 = alloca i64
store i16 %0, i16* %2
%4 = call i64 (...) @Random()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = mul nsw i64 %8, -1
store i64 %9, i64* %3
br label %10
10: ; preds = %7, %1
%11 = load i64, i64* %3
%12 = load i16, i16* %2
%13 = sext i16 %12 to i64
%14 = mul nsw i64 %11, %13
%15 = sdiv i64 %14, 32768
%16 = trunc i64 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @RandomInt(i16 signext %0) {
%2 = tail call i64 (...) @Random()
%3 = tail call i64 @llvm.abs.i64(i64 %2, i1 true)
%4 = sext i16 %0 to i64
%5 = mul nsw i64 %3, %4
%6 = sdiv i64 %5, 32768
%7 = trunc i64 %6 to i16
ret i16 %7
}
/* Variables and functions */
void *realloc(void *, size_t);
void *def_realloc_func(void *opaque, void *address, size_t items, size_t size) {
  (void)opaque;
  return realloc(address, items * size);
}


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

x86 assembly (clang, -O2):
<def_realloc_func>:
mov    %rsi,%rdi
imul   %rcx,%rdx
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @def_realloc_func(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = mul i64 %11, %12
%14 = call i8* @realloc(i8* %10, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @def_realloc_func(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = mul i64 %3, %2
%6 = tail call i8* @realloc(i8* %1, i64 %5)
ret i8* %6
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR84_get(void) { return U_WMRCORENONE_get("U_WMR84"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR84\00"
define i32 @U_WMR84_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR84\00"
define i32 @U_WMR84_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ __SntpDealTime(int /*<<< orphan*/);
void sntp_process(time_t t) { __SntpDealTime(t); }


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

x86 assembly (clang, -O2):
<sntp_process>:
jmp    1030 <__SntpDealTime@plt>

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

LLVM IR (-O2):
define void @sntp_process(i32 %0) {
%2 = tail call i32 @__SntpDealTime(i32 %0)
ret void
}
int filter_heartbeat_frame(int is_inbound, int sesno,
                           struct amqp09_frame_header *hdr) {
  return 1;
}


x86 assembly (clang, -O0):
<filter_heartbeat_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.amqp09_frame_header = type opaque
define i32 @filter_heartbeat_frame(i32 %0, i32 %1, %struct.amqp09_frame_header* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.amqp09_frame_header*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.amqp09_frame_header* %2, %struct.amqp09_frame_header** %6
ret i32 1
}

LLVM IR (-O2):
%struct.amqp09_frame_header = type opaque
define i32 @filter_heartbeat_frame(i32 %0, i32 %1, %struct.amqp09_frame_header* nocapture readnone %2) {
ret i32 1
}