xunge/DecIR huggingface dataset:
/* Variables and functions */
void *malloc(size_t);
void *json_allocator_alloc(size_t size) { return malloc(size); }


x86 assembly (clang, -O0):
<json_allocator_alloc>:
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):
<json_allocator_alloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @json_allocator_alloc(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* @json_allocator_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ suseconds_t;
struct timeval {
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
suseconds_t get_usec() {
  struct timeval tv;
  int ret = gettimeofday(&tv, NULL);
  assert(ret != -1);
  return tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_usec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
call   1040 <assert@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @get_usec() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @get_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}
int test_imm_A2uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xA2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A2uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xa2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A2uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 162
%5 = icmp ne i64 %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_A2uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 162
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test42_TestProg_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test42_TestProg_targetInit__I() {
ret void
}
short main(void) { return 42; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2a,%ax
ret

LLVM IR (-O0):
define signext i16 @main() {
ret i16 42
}

LLVM IR (-O2):
define signext i16 @main() {
ret i16 42
}
/* Variables and functions */
int createFiles(int, int);
int main() {
  int result;
  result = createFiles(40, 2000);
  return (result != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x28,%edi
mov    $0x7d0,%esi
call   1030 <createFiles@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
mov    $0x7d0,%esi
call   1030 <createFiles@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @createFiles(i32 40, i32 2000)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @createFiles(i32 40, i32 2000)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void security_inode_post_symlink(struct inode *dir, struct dentry *dentry,
                                 const char *old_name) {}


x86 assembly (clang, -O0):
<security_inode_post_symlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.dentry = type opaque
define void @security_inode_post_symlink(%struct.inode* %0, %struct.dentry* %1, i8* %2) {
%4 = alloca %struct.inode*
%5 = alloca %struct.dentry*
%6 = alloca i8*
store %struct.inode* %0, %struct.inode** %4
store %struct.dentry* %1, %struct.dentry** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.dentry = type opaque
define void @security_inode_post_symlink(%struct.inode* nocapture %0, %struct.dentry* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expon(int, int);
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n = 0, x = 0;
  scanf("%d %d", &n, &x);
  printf("%d elevado a %d, é %.0lf\n", n, x, expon(n, x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <expon@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xeb7(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <expon@plt>
lea    0xe99(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [27 x i8] c"%d elevado a %d, \C3\A9 %.0lf\0A\00"
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
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @expon(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [27 x i8] c"%d elevado a %d, \C3\A9 %.0lf\0A\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 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @expon(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SHAP_WakeDevice();
uint8_t SHAC_Wakeup() { return (SHAP_WakeDevice()); }


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

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

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

LLVM IR (-O2):
define i32 @SHAC_Wakeup() {
%1 = tail call i32 (...) @SHAP_WakeDevice()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void foo(char *s) {
  printf("Hello from foo()\n");
  printf("Received: %s\n", s);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Hello from foo()\0A\00"
@.str.1 = [14 x i8] c"Received: %s\0A\00"
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"Received: %s\0A\00"
@str = [17 x i8] c"Hello from foo()\00"
define void @foo(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct ifaddrs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getifaddrs(struct ifaddrs **ifap) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getifaddrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getifaddrs>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ifaddrs = type { i32 }
@ENOSYS = global i32 0
define i32 @__getifaddrs(%struct.ifaddrs** %0) {
%2 = alloca %struct.ifaddrs**
store %struct.ifaddrs** %0, %struct.ifaddrs*** %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
%struct.ifaddrs = type { i32 }
@ENOSYS = global i32 0
define i32 @__getifaddrs(%struct.ifaddrs** nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
struct inode **rsearch(int, struct inode **);
struct inode *search(int data, struct inode *node) {
  struct inode **res = rsearch(data, &node);
  return *res;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <rsearch@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
call   1030 <rsearch@plt>
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.inode = type { i32 }
define %struct.inode* @search(i32 %0, %struct.inode* %1) {
%3 = alloca i32
%4 = alloca %struct.inode*
%5 = alloca %struct.inode**
store i32 %0, i32* %3
store %struct.inode* %1, %struct.inode** %4
%6 = load i32, i32* %3
%7 = call %struct.inode** @rsearch(i32 %6, %struct.inode** %4)
store %struct.inode** %7, %struct.inode*** %5
%8 = load %struct.inode**, %struct.inode*** %5
%9 = load %struct.inode*, %struct.inode** %8
ret %struct.inode* %9
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define %struct.inode* @search(i32 %0, %struct.inode* %1) {
%3 = alloca %struct.inode*
store %struct.inode* %1, %struct.inode** %3
%4 = call %struct.inode** @rsearch(i32 %0, %struct.inode** %3)
%5 = load %struct.inode*, %struct.inode** %4
ret %struct.inode* %5
}
unsigned *(wcheck_unsigned_ptr)(unsigned *to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define i32* @wcheck_unsigned_ptr(i32* readnone returned %0) {
ret i32* %0
}
void ff_yuv2rgb_init_tables_ppc() {}


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

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

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

LLVM IR (-O2):
define void @ff_yuv2rgb_init_tables_ppc() {
ret void
}
int tens(int n) {
  switch (n) {
  case '0':
    return 0;
  case '2':
    return 6;
  case '3':
    return 6;
  case '4':
    return 5;
  case '5':
    return 5;
  case '6':
    return 5;
  case '7':
    return 7;
  case '8':
    return 6;
  case '9':
    return 6;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<tens>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     119c <tens+0x9c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x6,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x6,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x5,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x5,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x5,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x7,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x6,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x6,-0x4(%rbp)
jmp    11a3 <tens+0xa3>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tens>:
add    $0xffffffce,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <tens+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @tens(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 48, label %5
i32 50, label %6
i32 51, label %7
i32 52, label %8
i32 53, label %9
i32 54, label %10
i32 55, label %11
i32 56, label %12
i32 57, label %13
]
5: ; preds = %1
store i32 0, i32* %2
br label %15
6: ; preds = %1
store i32 6, i32* %2
br label %15
7: ; preds = %1
store i32 6, i32* %2
br label %15
8: ; preds = %1
store i32 5, i32* %2
br label %15
9: ; preds = %1
store i32 5, i32* %2
br label %15
10: ; preds = %1
store i32 5, i32* %2
br label %15
11: ; preds = %1
store i32 7, i32* %2
br label %15
12: ; preds = %1
store i32 6, i32* %2
br label %15
13: ; preds = %1
store i32 6, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@switch.table.tens = [8 x i32] [i32 6, i32 6, i32 5, i32 5, i32 5, i32 7, i32 6, i32 6]
define i32 @tens(i32 %0) {
%2 = add i32 %0, -50
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.tens, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int ft_gt_pt(void *e1, void *e2) {
  if (!e1 || !e2)
    return (0);
  if ((*(int *)e1) > (*(int *)e2))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_gt_pt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <ft_gt_pt+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112e <ft_gt_pt+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1153 <ft_gt_pt+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    114c <ft_gt_pt+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <ft_gt_pt+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_gt_pt>:
xor    %eax,%eax
test   %rdi,%rdi
je     1115 <ft_gt_pt+0x15>
test   %rsi,%rsi
je     1115 <ft_gt_pt+0x15>
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @ft_gt_pt(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 0, i32* %3
br label %22
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = load i8*, i8** %5
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
%19 = icmp sgt i32 %15, %18
br i1 %19, label %20, label %21
20: ; preds = %12
store i32 1, i32* %3
br label %22
21: ; preds = %12
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @ft_gt_pt(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = bitcast i8* %1 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
long gcd(long a, long b) {
  long t, r;
  if (a < b) {
    t = a;
    a = b;
    b = t;
  }
  while (r = a % b) {
    a = b;
    b = r;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1132 <gcd+0x32>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <gcd+0x37>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x20(%rbp)
cmp    $0x0,%rdx
je     1164 <gcd+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <gcd+0x37>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
cmp    %rsi,%rdi
mov    %rsi,%rdx
cmovl  %rdi,%rdx
cmovl  %rsi,%rax
jmp    112d <gcd+0x2d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1142 <gcd+0x42>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i64, i64* %3
store i64 %11, i64* %5
%12 = load i64, i64* %4
store i64 %12, i64* %3
%13 = load i64, i64* %5
store i64 %13, i64* %4
br label %14
14: ; preds = %10, %2
br label %15
15: ; preds = %20, %14
%16 = load i64, i64* %3
%17 = load i64, i64* %4
%18 = srem i64 %16, %17
store i64 %18, i64* %6
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i64, i64* %4
store i64 %21, i64* %3
%22 = load i64, i64* %6
store i64 %22, i64* %4
br label %15
23: ; preds = %15
%24 = load i64, i64* %4
ret i64 %24
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
%5 = select i1 %3, i64 %1, i64 %0
br label %6
6: ; preds = %6, %2
%7 = phi i64 [ %4, %2 ], [ %9, %6 ]
%8 = phi i64 [ %5, %2 ], [ %7, %6 ]
%9 = srem i64 %8, %7
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i64 %7
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t len = 0;
  while (string[len]) {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int errno;
int lace_compat_errno_clear() {
  int e = errno;
  errno = 0;
  return e;
}


x86 assembly (clang, -O0):
<lace_compat_errno_clear>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2ec9(%rip),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lace_compat_errno_clear>:
mov    0x2ed9(%rip),%rcx
mov    (%rcx),%eax
movl   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @lace_compat_errno_clear() {
%1 = load i32, i32* @errno
store i32 0, i32* @errno
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *error) {
  fprintf(stderr, "%s\n", error);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *new) {
  list_replace(old, new);
  INIT_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
__attribute__((nonnull(1))) ssize_t m_strputc(char *dst, ssize_t n, int c) {
  if (n > 1) {
    dst[0] = (char)c;
    dst[1] = '\0';
  }
  return 1;
}


x86 assembly (clang, -O0):
<m_strputc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    112b <m_strputc+0x2b>
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_strputc>:
cmp    $0x2,%esi
jl     110b <m_strputc+0xb>
mov    %dl,(%rdi)
movb   $0x0,0x1(%rdi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @m_strputc(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i32 %2 to i8
store i8 %6, i8* %0
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %7
br label %8
8: ; preds = %5, %3
ret i32 1
}
void post(char *path, char *message) {}


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

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

LLVM IR (-O0):
define void @post(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @post(i8* nocapture %0, i8* nocapture %1) {
ret void
}
const char *Function_Name(void) { return "Function"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Function\00"
define i8* @Function_Name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ gettid();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
void *dec(void *arg) {
  int count = *(int *)arg;
  count--;
  printf("Thread : %lu, addr(count)=%p, count=%d\n", gettid(), &count, count);
  sleep(1);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,%esi
mov    -0x14(%rbp),%ecx
lea    0xe8f(%rip),%rdi
lea    -0x14(%rbp),%rdx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%ebx
add    $0xffffffff,%ebx
mov    %ebx,0xc(%rsp)
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xea4(%rip),%rdi
lea    0xc(%rsp),%rdx
mov    %eax,%esi
mov    %ebx,%ecx
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
call   1050 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Thread : %lu, addr(count)=%p, count=%d\0A\00"
define i8* @dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = add nsw i32 %8, -1
store i32 %9, i32* %4
%10 = call i32 (...) @gettid()
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %10, i32* %4, i32 %11)
%13 = call i32 @sleep(i32 1)
%14 = call i32 @pthread_exit(i32* null)
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [40 x i8] c"Thread : %lu, addr(count)=%p, count=%d\0A\00"
define noalias i8* @dec(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = tail call i32 (...) @gettid()
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %7, i32* %2, i32 %6)
%9 = call i32 @sleep(i32 1)
%10 = call i32 @pthread_exit(i32* null)
ret i8* undef
}
void g_option_group_set_translate_func() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @board_device_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_simplemesh();
int main() {
  test_simplemesh();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_simplemesh()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_simplemesh()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void popDiv() {
  emitln("mov\t%%eax,%%ebx");
  emitln("pop\t%%eax");
  emitln("xor\t%%edx,%%edx");
  emitln("div\t%%ebx");
}


x86 assembly (clang, -O0):
<popDiv>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee9(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeeb(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<popDiv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeec(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeea(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeee(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"mov\09%%eax,%%ebx\00"
@.str.1 = [10 x i8] c"pop\09%%eax\00"
@.str.2 = [16 x i8] c"xor\09%%edx,%%edx\00"
@.str.3 = [10 x i8] c"div\09%%ebx\00"
define void @popDiv() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"mov\09%%eax,%%ebx\00"
@.str.1 = [10 x i8] c"pop\09%%eax\00"
@.str.2 = [16 x i8] c"xor\09%%edx,%%edx\00"
@.str.3 = [10 x i8] c"div\09%%ebx\00"
define void @popDiv() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t);
void *print_hello(void *data) {
  size_t thread_num = (size_t)data;
  printf("Hello world! It's me - thread %zd\n", thread_num);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Hello world! It's me - thread %zd\0A\00"
define i8* @print_hello(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* null
}

LLVM IR (-O2):
@.str = [35 x i8] c"Hello world! It's me - thread %zd\0A\00"
define noalias i8* @print_hello(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i8* null
}
/* Variables and functions */
int strcmp(char *, char *);
int verify_password(char *password) {
  int authenticated;
  authenticated = strcmp(password, "1234567");
  return authenticated;
}


x86 assembly (clang, -O0):
<verify_password>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_password>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"1234567\00"
define i32 @verify_password(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void CalibrationManager_task(void) {}


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

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

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

LLVM IR (-O2):
define void @CalibrationManager_task() {
ret void
}
int NpyOS_ascii_isalpha(char c) {
  return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}


x86 assembly (clang, -O0):
<NpyOS_ascii_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <NpyOS_ascii_isalpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <NpyOS_ascii_isalpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <NpyOS_ascii_isalpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NpyOS_ascii_isalpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @NpyOS_ascii_isalpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @NpyOS_ascii_isalpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  int i;
  signal(SIGINT, SIG_IGN);
  printf("You can't stop me\n");
  while (1) {
    printf("haha\n");
    sleep(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    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1169 <main+0x39>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@.str = [19 x i8] c"You can't stop me\0A\00"
@.str.1 = [6 x i8] c"haha\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
%7 = load i32, i32* @SIGINT
%8 = load i32, i32* @SIG_IGN
%9 = call i32 @signal(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %2, %11
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @sleep(i32 1)
br label %11
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
@str = [18 x i8] c"You can't stop me\00"
@str.2 = [5 x i8] c"haha\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* @SIG_IGN
%5 = tail call i32 @signal(i32 %3, i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %7, %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0))
%9 = tail call i32 @sleep(i32 1)
br label %7
}
void __clear_bit(long nr, volatile unsigned long *addr) {
  asm volatile("btr %1,%0"
               : "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
}


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

x86 assembly (clang, -O2):
<__clear_bit>:
btr    %rdi,(%rsi)
ret

LLVM IR (-O0):
define void @__clear_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %3
ret void
}

LLVM IR (-O2):
define void @__clear_bit(i64 %0, i64* %1) {
tail call void asm sideeffect "btr $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glIndexfv(int /*<<< orphan*/ *);
void Indexfv(GLfloat c[1]) { glIndexfv(c); }


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

x86 assembly (clang, -O2):
<Indexfv>:
jmp    1030 <glIndexfv@plt>

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

LLVM IR (-O2):
define void @Indexfv(i32* %0) {
%2 = tail call i32 @glIndexfv(i32* %0)
ret void
}
int emergency_thaw_bdev(struct super_block *sb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @emergency_thaw_bdev(%struct.super_block* nocapture readnone %0) {
ret i32 0
}
void *dummy_function(void *arg) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @dummy_function(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ flags_extract();
void cpu_386_flags_extract() { flags_extract(); }


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

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

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

LLVM IR (-O2):
define void @cpu_386_flags_extract() {
%1 = tail call i32 (...) @flags_extract()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strip(char *);
int main(int argc, char **argv) {
  if (argc < 2) {
    printf("Usage: %s filename\n", argv[0]);
    return -1;
  }
  strip(argv[1]);
  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   $0x2,-0x8(%rbp)
jge    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <main+0x53>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strip@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1040 <strip@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Usage: %s 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, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 -1, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strip(i8* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [20 x i8] c"Usage: %s filename\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strip(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ -1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
void *interface_finalize(void *);
void *class_finalize(void *class) {
  class = interface_finalize(class);
  return class;
}


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

x86 assembly (clang, -O2):
<class_finalize>:
jmp    1030 <interface_finalize@plt>

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

LLVM IR (-O2):
define i8* @class_finalize(i8* %0) {
%2 = tail call i8* @interface_finalize(i8* %0)
ret i8* %2
}