xunge/DecIR huggingface dataset:
struct iam_lentry *lvar_lentry(const struct lvar_leaf_entry *ent) {
  return (struct iam_lentry *)ent;
}


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

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

LLVM IR (-O0):
%struct.iam_lentry = type opaque
%struct.lvar_leaf_entry = type opaque
define %struct.iam_lentry* @lvar_lentry(%struct.lvar_leaf_entry* %0) {
%2 = alloca %struct.lvar_leaf_entry*
store %struct.lvar_leaf_entry* %0, %struct.lvar_leaf_entry** %2
%3 = load %struct.lvar_leaf_entry*, %struct.lvar_leaf_entry** %2
%4 = bitcast %struct.lvar_leaf_entry* %3 to %struct.iam_lentry*
ret %struct.iam_lentry* %4
}

LLVM IR (-O2):
%struct.iam_lentry = type opaque
%struct.lvar_leaf_entry = type opaque
define %struct.iam_lentry* @lvar_lentry(%struct.lvar_leaf_entry* readnone %0) {
%2 = bitcast %struct.lvar_leaf_entry* %0 to %struct.iam_lentry*
ret %struct.iam_lentry* %2
}
/* Variables and functions */
int /*<<< orphan*/ i2cslave_SetAddr(int /*<<< orphan*/, unsigned char);
void i2c0slave_SetAddr(unsigned char addr) { i2cslave_SetAddr(0, addr); }


x86 assembly (clang, -O0):
<i2c0slave_SetAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movzbl -0x1(%rbp),%esi
call   1030 <i2cslave_SetAddr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c0slave_SetAddr>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <i2cslave_SetAddr@plt>

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

LLVM IR (-O2):
define void @i2c0slave_SetAddr(i8 zeroext %0) {
%2 = tail call i32 @i2cslave_SetAddr(i32 0, i8 zeroext %0)
ret void
}
void init_int_ref(int *p) { *p = 5; }


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

x86 assembly (clang, -O2):
<init_int_ref>:
movl   $0x5,(%rdi)
ret

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

LLVM IR (-O2):
define void @init_int_ref(i32* nocapture writeonly %0) {
store i32 5, i32* %0
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ style;
};
typedef TYPE_1__ XIMPreeditCaretCallbackStruct;

/* Variables and functions */
int get_XIMPreeditCaretCallbackStruct_style(void *_p) {
  return (int)((XIMPreeditCaretCallbackStruct *)_p)->style;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XIMPreeditCaretCallbackStruct_style(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void imx_scu_map_io(void) {}


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

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

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

LLVM IR (-O2):
define void @imx_scu_map_io() {
ret void
}
int *test2(int aa, int bb, int cc) {
  printf("%s: enter\n", __FUNCTION__);
  printf("%s: exit\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeec(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s: enter\0A\00"
@__FUNCTION__.test2 = [6 x i8] c"test2\00"
@.str.1 = [10 x i8] c"%s: exit\0A\00"
define noalias i32* @test2(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.test2, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.test2, i64 0, i64 0))
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int print_hex(int n) {
  fprintf(stderr, "0x%08X\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rax
mov    %edi,%edx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"0x%08X\0A\00"
define i32 @print_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"0x%08X\0A\00"
define i32 @print_hex(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
void *dllmalloc(size_t);
void *__wrap_malloc(size_t size) { return dllmalloc(size); }


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

x86 assembly (clang, -O2):
<__wrap_malloc>:
jmp    1030 <dllmalloc@plt>

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

LLVM IR (-O2):
define i8* @__wrap_malloc(i64 %0) {
%2 = tail call i8* @dllmalloc(i64 %0)
ret i8* %2
}
void initializeString(char *ptr_str, unsigned arr_size) {
  char *ptr_str_tmp = ptr_str;
  while (arr_size) {
    *ptr_str_tmp = '\0';
    ptr_str_tmp++;
    arr_size--;
  }
}


x86 assembly (clang, -O0):
<initializeString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <initializeString+0x3e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <initializeString+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initializeString>:
test   %esi,%esi
je     1122 <initializeString+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initializeString(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *MALLOC(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ split_dir_and_file(char const *, char *, char *);
int strlen(char const *);
char *get_filename(const char *in) {
  char *dir = MALLOC(sizeof(char) * (strlen(in) + 2));
  char *file = MALLOC(sizeof(char) * (strlen(in) + 2));
  split_dir_and_file(in, dir, file);
  free(dir);
  return file;
}


x86 assembly (clang, -O0):
<get_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <MALLOC@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <MALLOC@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <split_dir_and_file@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
lea    0x2(%rax),%edi
call   1050 <MALLOC@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    0x2(%rax),%edi
call   1050 <MALLOC@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1060 <split_dir_and_file@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @get_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 2
%8 = sext i32 %7 to i64
%9 = mul i64 1, %8
%10 = trunc i64 %9 to i32
%11 = call i8* @MALLOC(i32 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %13, 2
%15 = sext i32 %14 to i64
%16 = mul i64 1, %15
%17 = trunc i64 %16 to i32
%18 = call i8* @MALLOC(i32 %17)
store i8* %18, i8** %4
%19 = load i8*, i8** %2
%20 = load i8*, i8** %3
%21 = load i8*, i8** %4
%22 = call i32 @split_dir_and_file(i8* %19, i8* %20, i8* %21)
%23 = load i8*, i8** %3
%24 = call i32 @free(i8* %23)
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @get_filename(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 2
%4 = tail call i8* @MALLOC(i32 %3)
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 2
%7 = tail call i8* @MALLOC(i32 %6)
%8 = tail call i32 @split_dir_and_file(i8* %0, i8* %4, i8* %7)
%9 = tail call i32 @free(i8* %4)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ test_empty();
int /*<<< orphan*/ test_fstat();
int /*<<< orphan*/ test_getpid();
int /*<<< orphan*/ test_mmap();
int main(int argc, char *argv[]) {
  test_empty();
  test_getpid();
  test_fstat();
  test_mmap();
  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   1040 <test_empty@plt>
mov    $0x0,%al
call   1060 <test_getpid@plt>
mov    $0x0,%al
call   1030 <test_fstat@plt>
mov    $0x0,%al
call   1050 <test_mmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_empty@plt>
xor    %eax,%eax
call   1060 <test_getpid@plt>
xor    %eax,%eax
call   1030 <test_fstat@plt>
xor    %eax,%eax
call   1050 <test_mmap@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 (...) @test_empty()
%7 = call i32 (...) @test_getpid()
%8 = call i32 (...) @test_fstat()
%9 = call i32 (...) @test_mmap()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_empty()
%4 = tail call i32 (...) @test_getpid()
%5 = tail call i32 (...) @test_fstat()
%6 = tail call i32 (...) @test_mmap()
ret i32 0
}
/* Type definitions */
struct ptr_region {
  int dummy;
};

/* Variables and functions */
struct ptr_region **__dl_fpp_defer_list();
struct ptr_region **defer_list_addr(void) {
  return __dl_fpp_defer_list();
}


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

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

LLVM IR (-O0):
%struct.ptr_region = type { i32 }
define %struct.ptr_region** @defer_list_addr() {
%1 = call %struct.ptr_region** (...) @__dl_fpp_defer_list()
ret %struct.ptr_region** %1
}

LLVM IR (-O2):
%struct.ptr_region = type { i32 }
define %struct.ptr_region** @defer_list_addr() {
%1 = tail call %struct.ptr_region** (...) @__dl_fpp_defer_list()
ret %struct.ptr_region** %1
}
int test_imm_A5int8_mem(signed char *val) {
  return ((*val) & (0xA5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A5int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xa5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A5int8_mem>:
testb  $0xa5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -91
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  int x;
  int y;
  while (1) {
    if (x == 0)
      x++;
    else
      y++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1123 <main+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <main+0x2c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %13
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %7
br label %4
}

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ vsnprintf(char *, int, char *, int /*<<< orphan*/);
int max(char *a) {
  char buf[1024];
  char *c = a;
  va_list ap;
  vsnprintf(buf, 1023, c, ap);
  printf("buf = %s\n", buf);
  return (0);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x418(%rbp),%rdx
mov    -0x41c(%rbp),%ecx
mov    $0x3ff,%esi
call   1030 <vsnprintf@plt>
lea    -0x410(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
call   1030 <vsnprintf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"buf = %s\0A\00"
define i32 @max(i8* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @vsnprintf(i8* %3, i32 1023, i8* %0, i32 undef)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ system(char *);
int main(void) {
  char ch;
  system("stty raw");
  while ((ch = getchar()) != '#') {
    printf("Input %c", ch);
  }
  system("stty cooked");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x23,%eax
je     1176 <main+0x46>
lea    0xea1(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1040 <printf@plt>
jmp    114b <main+0x1b>
lea    0xe95(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x23,%al
je     1166 <main+0x36>
lea    0xeba(%rip),%rbx
nop
movsbl %al,%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x23,%al
jne    1150 <main+0x20>
lea    0xea5(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"stty raw\00"
@.str.1 = [9 x i8] c"Input %c\00"
@.str.2 = [12 x i8] c"stty cooked\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 35
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i8, i8* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %9)
br label %4
11: ; preds = %4
%12 = call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"stty raw\00"
@.str.1 = [9 x i8] c"Input %c\00"
@.str.2 = [12 x i8] c"stty cooked\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 35
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %7, %4 ], [ %2, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %5)
%7 = tail call signext i8 (...) @getchar()
%8 = icmp eq i8 %7, 35
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 @system(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int assert(int p) { return (p); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @umaFuncaoQueNaoFazNada() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
void tp1(int *a) { printf("in TP1 ptr=%p, value=%d\n", a, *a); }


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"in TP1 ptr=%p, value=%d\0A\00"
define void @tp1(i32* %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void error(char *msg, int len) {
  write(0, msg, len);
  exit(1);
  return;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @write(i32 0, i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @write(i32 0, i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void genldl() {}


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

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

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

LLVM IR (-O2):
define void @genldl() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump_nums(int *nums, int nums_size) {
  int i;
  for (i = 0; i < nums_size; i++) {
    printf("%d ", nums[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_nums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <dump_nums+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dump_nums+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_nums>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <dump_nums+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dump_nums+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @dump_nums(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @dump_nums(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
double tanh(double x) { return 4; }


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @tanh(double %0) {
ret double 4.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ display_write_char(char, char);
void display_write_string(char *s, char mode) {
  for (; *s; s++)
    display_write_char(*s, mode);
}


x86 assembly (clang, -O0):
<display_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <display_write_string+0x42>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
movsbl %al,%edi
movsbl -0x9(%rbp),%esi
call   1030 <display_write_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1122 <display_write_string+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_write_string>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <display_write_string+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
movsbl %sil,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <display_write_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <display_write_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @display_write_string(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %14, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = load i8, i8* %4
%13 = call i32 @display_write_char(i8 signext %11, i8 signext %12)
br label %14
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @display_write_string(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = tail call i32 @display_write_char(i8 signext %6, i8 signext %1)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
int check_endian() {
  int a = 1;
  char *b = (char *)&a;
  return 1 == *b;
}


x86 assembly (clang, -O0):
<check_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @check_endian() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 1, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @check_endian() {
ret i32 1
}
void XChangeWindowAttributes() {}


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

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

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

LLVM IR (-O2):
define void @XChangeWindowAttributes() {
ret void
}
int is_gl_than_sign(char c) { return c == '<' || c == '>'; }


x86 assembly (clang, -O0):
<is_gl_than_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3c,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_gl_than_sign+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x3e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_gl_than_sign>:
and    $0xfd,%dil
xor    %eax,%eax
cmp    $0x3c,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_gl_than_sign(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 60
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, 62
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 @is_gl_than_sign(i8 signext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 60
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int getquest(void) {
  int result;
  int c;
  result = 0;
  while ((c = getchar()) != EOF)
    result += c;
  return (result);
}


x86 assembly (clang, -O0):
<getquest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%eax
je     1146 <getquest+0x36>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    111f <getquest+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getquest>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
xor    %ecx,%ecx
nopl   (%rax)
mov    %ecx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
lea    (%rax,%rbx,1),%ecx
cmp    (%r14),%eax
jne    1120 <getquest+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @getquest() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %8
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getquest() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = add nsw i32 %3, %2
br i1 %5, label %7, label %1
7: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ funcao2(int *);
void funcao1(int *var) { funcao2(var); }


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

x86 assembly (clang, -O2):
<funcao1>:
jmp    1030 <funcao2@plt>

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

LLVM IR (-O2):
define void @funcao1(i32* %0) {
%2 = tail call i32 @funcao2(i32* %0)
ret void
}
int pureFfiDep(int a) { return a * 2; }


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

x86 assembly (clang, -O2):
<pureFfiDep>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @pureFfiDep(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
int Settings_GetInt(char *KeyName) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Settings_GetInt(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int Max(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("THe max of 7 and 5 is %d\n", Max(7, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
mov    $0x5,%esi
call   1030 <Max@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
mov    $0x5,%esi
call   1030 <Max@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"THe max of 7 and 5 is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @Max(i32 7, i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"THe max of 7 and 5 is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Max(i32 7, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_tests(int);
int main(void) {
  do_tests(14);
  do_tests(31);
  do_tests(32);
  do_tests(33);
  do_tests(60);
  do_tests(160);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xe,%edi
call   1030 <do_tests@plt>
mov    $0x1f,%edi
call   1030 <do_tests@plt>
mov    $0x20,%edi
call   1030 <do_tests@plt>
mov    $0x21,%edi
call   1030 <do_tests@plt>
mov    $0x3c,%edi
call   1030 <do_tests@plt>
mov    $0xa0,%edi
call   1030 <do_tests@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xe,%edi
call   1030 <do_tests@plt>
mov    $0x1f,%edi
call   1030 <do_tests@plt>
mov    $0x20,%edi
call   1030 <do_tests@plt>
mov    $0x21,%edi
call   1030 <do_tests@plt>
mov    $0x3c,%edi
call   1030 <do_tests@plt>
mov    $0xa0,%edi
call   1030 <do_tests@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @do_tests(i32 14)
%3 = call i32 @do_tests(i32 31)
%4 = call i32 @do_tests(i32 32)
%5 = call i32 @do_tests(i32 33)
%6 = call i32 @do_tests(i32 60)
%7 = call i32 @do_tests(i32 160)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @do_tests(i32 14)
%2 = tail call i32 @do_tests(i32 31)
%3 = tail call i32 @do_tests(i32 32)
%4 = tail call i32 @do_tests(i32 33)
%5 = tail call i32 @do_tests(i32 60)
%6 = tail call i32 @do_tests(i32 160)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t WatchdogReloadGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000000))));
}


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

x86 assembly (clang, -O2):
<WatchdogReloadGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
define i64 @WatchdogReloadGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add nsw i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @WatchdogReloadGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
ret i64 %5
}
/* Variables and functions */
int floatToRawIntBits(float);
float intBitsToFloat(int);
float xfabsf(float x) {
  return intBitsToFloat(0x7fffffffL & floatToRawIntBits(x));
}


x86 assembly (clang, -O0):
<xfabsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <floatToRawIntBits@plt>
cltq
and    $0x7fffffff,%rax
mov    %eax,%edi
call   1030 <intBitsToFloat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfabsf>:
push   %rax
call   1040 <floatToRawIntBits@plt>
and    $0x7fffffff,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <intBitsToFloat@plt>

LLVM IR (-O0):
define float @xfabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @floatToRawIntBits(float %3)
%5 = sext i32 %4 to i64
%6 = and i64 2147483647, %5
%7 = trunc i64 %6 to i32
%8 = call float @intBitsToFloat(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @xfabsf(float %0) {
%2 = tail call i32 @floatToRawIntBits(float %0)
%3 = and i32 %2, 2147483647
%4 = tail call float @intBitsToFloat(i32 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void error(char const *msg) {
  fputs(msg, stderr);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void print_null(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @print_null(i8* nocapture %0) {
ret void
}
int main() {
  int i = 0;
  int count = 0;
  for (i = 0; i < 10; i++) {
    count = i;
    *(int *)0x07FC = count;
  }
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1148 <main+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x7fc,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1120 <main+0x20>
jmp    114d <main+0x4d>
jmp    114d <main+0x4d>

x86 assembly (clang, -O2):
<main>:
movl   $0x9,0x7fc
nopl   0x0(%rax,%rax,1)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
store i32 %8, i32* %3
%9 = load i32, i32* %3
store i32 %9, i32* inttoptr (i64 2044 to i32*)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
br label %14
14: ; preds = %13, %14
br label %14
}

LLVM IR (-O2):
define i32 @main() {
store i32 9, i32* inttoptr (i64 2044 to i32*)
br label %1
1: ; preds = %0, %1
br label %1
}
char __ocl_select_char_char(char a, char b, char c) { return c ? b : a; }


x86 assembly (clang, -O0):
<__ocl_select_char_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0x0,%eax
je     112e <__ocl_select_char_char+0x2e>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <__ocl_select_char_char+0x35>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_select_char_char>:
mov    %edi,%eax
test   %dl,%dl
cmovne %esi,%eax
ret

LLVM IR (-O0):
define signext i8 @__ocl_select_char_char(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
br label %16
13: ; preds = %3
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @__ocl_select_char_char(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = icmp eq i8 %2, 0
%5 = select i1 %4, i8 %0, i8 %1
ret i8 %5
}
void NmiSR(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @NmiSR() {
br label %1
1: ; preds = %0, %1
br label %1
}
void null_log(int type, char *s1, char *s2, int socket_fd) {}


x86 assembly (clang, -O0):
<null_log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @null_log(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @null_log(i32 %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int acos(int);
int internal_acos_i(int value) { return acos(value); }


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

x86 assembly (clang, -O2):
<internal_acos_i>:
jmp    1030 <acos@plt>

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

LLVM IR (-O2):
define i32 @internal_acos_i(i32 %0) {
%2 = tail call i32 @acos(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
char *_itoa(int /*<<< orphan*/);
int strlen(char const *);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char const *, int);
int main(int argc, char *argv[]) {
  const char *p = _itoa(sysconf(_SC_PAGESIZE));
  write(1, p, strlen(p));
  write(1, "\n", 1);
  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)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    %eax,%edi
call   1060 <_itoa@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe64(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1050 <sysconf@plt>
mov    %eax,%edi
call   1060 <_itoa@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xe89(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @_SC_PAGESIZE
%8 = call i32 @sysconf(i32 %7)
%9 = call i8* @_itoa(i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @write(i32 1, i8* %10, i32 %12)
%14 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @_SC_PAGESIZE
%4 = tail call i32 @sysconf(i32 %3)
%5 = tail call i8* @_itoa(i32 %4)
%6 = tail call i32 @strlen(i8* %5)
%7 = tail call i32 @write(i32 1, i8* %5, i32 %6)
%8 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}