xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ backing_store;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_backing_store(void *_p) {
  return (int)((XWindowAttributes *)_p)->backing_store;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowAttributes_backing_store(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_XWindowAttributes_backing_store(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint_least8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t s(uint32_t x, uint_least8_t n) {
  return x >> n | x << (8 * sizeof(uint32_t) - n);
}


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):

:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @s(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %8, %12
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @s(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
int sgx_omaplfb_set(unsigned int fbix, struct sgx_omaplfb_config *data) {
  return -1;
}


x86 assembly (clang, -O0):
<sgx_omaplfb_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sgx_omaplfb_config = type opaque
define i32 @sgx_omaplfb_set(i32 %0, %struct.sgx_omaplfb_config* %1) {
%3 = alloca i32
%4 = alloca %struct.sgx_omaplfb_config*
store i32 %0, i32* %3
store %struct.sgx_omaplfb_config* %1, %struct.sgx_omaplfb_config** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.sgx_omaplfb_config = type opaque
define i32 @sgx_omaplfb_set(i32 %0, %struct.sgx_omaplfb_config* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void fread_or_die(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  if (fread(ptr, size, nmemb, stream) != nmemb) {
    perror("fread failed");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<fread_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
cmp    -0x18(%rbp),%rax
je     117d <fread_or_die+0x4d>
lea    0xe92(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread_or_die>:
push   %rbx
mov    %rdx,%rbx
call   1030 <fread@plt>
cmp    %rbx,%rax
jne    1140 <fread_or_die+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"fread failed\00"
define void @fread_or_die(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i64 @fread(i8* %9, i64 %10, i64 %11, i32* %12)
%14 = load i64, i64* %7
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"fread failed\00"
define void @fread_or_die(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, %2
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret void
}
unsigned xrop3_115_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_115_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_115_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
shl    $0x8,%esi
not    %eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_115_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, -1
%8 = or i32 %6, %7
ret i32 %8
}
/* Variables and functions */
size_t high_size_bit(int /*<<< orphan*/);
size_t red_bit_LaceKVE_joint() { return high_size_bit(0); }


x86 assembly (clang, -O0):
<red_bit_LaceKVE_joint>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <high_size_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<red_bit_LaceKVE_joint>:
xor    %edi,%edi
jmp    1030 <high_size_bit@plt>

LLVM IR (-O0):
define i64 @red_bit_LaceKVE_joint() {
%1 = call i64 @high_size_bit(i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @red_bit_LaceKVE_joint() {
%1 = tail call i64 @high_size_bit(i32 0)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Js_Free(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<Js_Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <Js_Free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Js_Free>:
test   %rdi,%rdi
je     111a <Js_Free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Js_Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int write(int, void const *, int);
int fild_Write(int fd, const void *buf, int count) {
  return write(fd, buf, count);
}


x86 assembly (clang, -O0):
<fild_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fild_Write>:
jmp    1030 <write@plt>

LLVM IR (-O0):
define i32 @fild_Write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @write(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fild_Write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int calc_print_cost(int num, int base, int cost_table[]) {
  int cost;
  cost = 0;
  while (num > 0) {
    cost += cost_table[num % base];
    num /= base;
  }
  return cost;
}


x86 assembly (clang, -O0):
<calc_print_cost>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114f <calc_print_cost+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x20(%rbp),%rax
movslq %edx,%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1115 <calc_print_cost+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_print_cost>:
test   %edi,%edi
jle    111d <calc_print_cost+0x1d>
mov    %rdx,%rcx
mov    %edi,%eax
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
cltd
idiv   %esi
add    (%rcx,%rdx,4),%edi
test   %eax,%eax
jg     1110 <calc_print_cost+0x10>
mov    %edi,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @calc_print_cost(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %7
br label %8
8: ; preds = %11, %3
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32*, i32** %6
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = srem i32 %13, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %12, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = add nsw i32 %19, %18
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = sdiv i32 %22, %21
store i32 %23, i32* %4
br label %8
24: ; preds = %8
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @calc_print_cost(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %15
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ 0, %3 ]
%7 = phi i32 [ %13, %5 ], [ %0, %3 ]
%8 = srem i32 %7, %1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %2, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, %6
%13 = sdiv i32 %7, %1
%14 = icmp sgt i32 %13, 0
br i1 %14, label %5, label %15
15: ; preds = %5, %3
%16 = phi i32 [ 0, %3 ], [ %12, %5 ]
ret i32 %16
}
sync() { ; }


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

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

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

LLVM IR (-O2):
define i32 @sync() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fun();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 10;
  fun();
  printf("%d", i);
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 10, i32* %1
%2 = call i32 (...) @fun()
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @fun()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
int count_prime_numbers_omp(int a, int b) {}


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

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

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

LLVM IR (-O2):
define i32 @count_prime_numbers_omp(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert_alloc(char *);
char *strdup(char const *);
char *safe_strdup(const char *s) {
  char *p = strdup(s);
  assert_alloc(p);
  return p;
}


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

x86 assembly (clang, -O2):
<safe_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert_alloc@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @safe_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert_alloc(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @safe_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @assert_alloc(i8* %2)
ret i8* %2
}
/* Type definitions */
struct argparse_option {
  int dummy;
};
struct argparse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ argparse_usage(struct argparse *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int argparse_help_cb(struct argparse *self,
                     const struct argparse_option *option) {
  (void)option;
  argparse_usage(self);
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<argparse_help_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <argparse_usage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<argparse_help_cb>:
push   %rax
call   1030 <argparse_usage@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* %1) {
%3 = alloca %struct.argparse*
%4 = alloca %struct.argparse_option*
store %struct.argparse* %0, %struct.argparse** %3
store %struct.argparse_option* %1, %struct.argparse_option** %4
%5 = load %struct.argparse_option*, %struct.argparse_option** %4
%6 = load %struct.argparse*, %struct.argparse** %3
%7 = call i32 @argparse_usage(%struct.argparse* %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* nocapture readnone %1) {
%3 = tail call i32 @argparse_usage(%struct.argparse* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ start_scan(char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  if (argc != 2)
    usage();
  start_scan(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)
je     1147 <main+0x27>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <start_scan@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1130 <main+0x10>
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x8(%rbx),%rdi
call   1030 <start_scan@plt>
xor    %eax,%eax
pop    %rbx
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @start_scan(i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @start_scan(i8* %8)
ret i32 0
}
unsigned int F(unsigned int X, unsigned int Y, unsigned int Z) {
  return (X & Y) | (~X & Z);
}


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @F(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @F(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
scalar_t__ fac(int);
int main(void) {
  int i;
  int s = 0;
  for (i = 0; i <= 5; i++)
    s += fac(i);
  return (s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     115a <main+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <fac@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1030 <fac@plt>
mov    %rax,%r14
mov    $0x1,%edi
call   1030 <fac@plt>
mov    %rax,%rbx
add    %r14d,%ebx
mov    $0x2,%edi
call   1030 <fac@plt>
mov    %rax,%r14
add    %ebx,%r14d
mov    $0x3,%edi
call   1030 <fac@plt>
mov    %rax,%rbx
add    %r14d,%ebx
mov    $0x4,%edi
call   1030 <fac@plt>
mov    %rax,%r14
add    %ebx,%r14d
mov    $0x5,%edi
call   1030 <fac@plt>
add    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 5
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i64 @fac(i32 %8)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %3
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @fac(i32 0)
%2 = trunc i64 %1 to i32
%3 = tail call i64 @fac(i32 1)
%4 = trunc i64 %3 to i32
%5 = add i32 %2, %4
%6 = tail call i64 @fac(i32 2)
%7 = trunc i64 %6 to i32
%8 = add i32 %5, %7
%9 = tail call i64 @fac(i32 3)
%10 = trunc i64 %9 to i32
%11 = add i32 %8, %10
%12 = tail call i64 @fac(i32 4)
%13 = trunc i64 %12 to i32
%14 = add i32 %11, %13
%15 = tail call i64 @fac(i32 5)
%16 = trunc i64 %15 to i32
%17 = add i32 %14, %16
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ api_end();
int /*<<< orphan*/ putc(char);
void HariMain(void) {
  putc('H');
  putc('e');
  putc('l');
  putc('l');
  putc('o');
  api_end();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1040 <putc@plt>
mov    $0x65,%edi
call   1040 <putc@plt>
mov    $0x6c,%edi
call   1040 <putc@plt>
mov    $0x6c,%edi
call   1040 <putc@plt>
mov    $0x6f,%edi
call   1040 <putc@plt>
mov    $0x0,%al
call   1030 <api_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
mov    $0x48,%edi
call   1040 <putc@plt>
mov    $0x65,%edi
call   1040 <putc@plt>
mov    $0x6c,%edi
call   1040 <putc@plt>
mov    $0x6c,%edi
call   1040 <putc@plt>
mov    $0x6f,%edi
call   1040 <putc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <api_end@plt>

LLVM IR (-O0):
define void @HariMain() {
%1 = call i32 @putc(i8 signext 72)
%2 = call i32 @putc(i8 signext 101)
%3 = call i32 @putc(i8 signext 108)
%4 = call i32 @putc(i8 signext 108)
%5 = call i32 @putc(i8 signext 111)
%6 = call i32 (...) @api_end()
ret void
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 @putc(i8 signext 72)
%2 = tail call i32 @putc(i8 signext 101)
%3 = tail call i32 @putc(i8 signext 108)
%4 = tail call i32 @putc(i8 signext 108)
%5 = tail call i32 @putc(i8 signext 111)
%6 = tail call i32 (...) @api_end()
ret void
}
int ILibHashtable_DefaultBucketizer(int value) {
  unsigned char tmp[4];
  int retVal = 0;
  ((unsigned int *)tmp)[0] = value;
  retVal = (int)(tmp[0] ^ tmp[1] ^ tmp[2] ^ tmp[3]);
  return (retVal);
}


x86 assembly (clang, -O0):
<ILibHashtable_DefaultBucketizer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x8(%rbp),%eax
movzbl -0x7(%rbp),%ecx
xor    %ecx,%eax
movzbl -0x6(%rbp),%ecx
xor    %ecx,%eax
movzbl -0x5(%rbp),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibHashtable_DefaultBucketizer>:
mov    %edi,%eax
shr    $0x8,%eax
mov    %edi,%ecx
shr    $0x10,%ecx
xor    %edi,%eax
shr    $0x18,%edi
xor    %ecx,%eax
movzbl %al,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @ILibHashtable_DefaultBucketizer(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %5, i32* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = xor i32 %15, %18
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = xor i32 %19, %22
store i32 %23, i32* %4
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
define i32 @ILibHashtable_DefaultBucketizer(i32 %0) {
%2 = lshr i32 %0, 8
%3 = lshr i32 %0, 16
%4 = lshr i32 %0, 24
%5 = xor i32 %2, %0
%6 = xor i32 %5, %3
%7 = and i32 %6, 255
%8 = xor i32 %7, %4
ret i32 %8
}
int registerbgifont(void *font) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @registerbgifont(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int ENODEV;
int /*<<< orphan*/ free(char *);
int readout_proc_cpufreq(unsigned int, unsigned long *, unsigned long *,
                         char **);
int proc_cpu_exists(unsigned int cpu) {
  unsigned long tmp1, tmp2;
  char *tmp3;
  int ret;
  ret = readout_proc_cpufreq(cpu, &tmp1, &tmp2, &tmp3);
  if (ret)
    return -ENODEV;
  free(tmp3);
  return 0;
}


x86 assembly (clang, -O0):
<proc_cpu_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <readout_proc_cpufreq@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115f <proc_cpu_exists+0x3f>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <proc_cpu_exists+0x4f>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_cpu_exists>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <readout_proc_cpufreq@plt>
test   %eax,%eax
je     114a <proc_cpu_exists+0x2a>
mov    0x2e9f(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x18,%rsp
ret
mov    (%rsp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @proc_cpu_exists(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @readout_proc_cpufreq(i32 %8, i64* %4, i64* %5, i8** %6)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* @ENODEV
%14 = sub nsw i32 0, %13
store i32 %14, i32* %2
br label %18
15: ; preds = %1
%16 = load i8*, i8** %6
%17 = call i32 @free(i8* %16)
store i32 0, i32* %2
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @proc_cpu_exists(i32 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = bitcast i8** %4 to i8*
%8 = call i32 @readout_proc_cpufreq(i32 %0, i64* %2, i64* %3, i8** %4)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i32, i32* @ENODEV
%12 = sub nsw i32 0, %11
br label %16
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ 0, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
scalar_t__ getpid();
int /*<<< orphan*/ new_level(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Start %d\n", (int)getpid());
  fflush(0);
  new_level(0, 2);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1060 <new_level@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
xor    %edi,%edi
mov    $0x2,%esi
call   1060 <new_level@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Start %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @fflush(i32 0)
%6 = call i32 @new_level(i32 0, i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Start %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @fflush(i32 0)
%5 = tail call i32 @new_level(i32 0, i32 2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ GL_FALSE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
GLenum key(int k, GLenum mask) {
  switch (k) {
  case 0xe004:
    exit(0);
  }
  return GL_FALSE;
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xe004,%eax
jne    1138 <key+0x28>
jmp    1131 <key+0x21>
xor    %edi,%edi
call   1030 <exit@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
cmp    $0xe004,%edi
je     1124 <key+0x14>
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@GL_FALSE = global i32 0
define i32 @key(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %8 [
i32 57348, label %6
]
6: ; preds = %2
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = load i32, i32* @GL_FALSE
ret i32 %9
}

LLVM IR (-O2):
@GL_FALSE = global i32 0
define i32 @key(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 57348
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = load i32, i32* @GL_FALSE
ret i32 %7
}
int uread(fd, b, n)
char *b;
int fd, n;
{ return (_read(fd, b, n)); }


x86 assembly (clang, -O0):
<uread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @uread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @_read to i32 (i32, i8*, i32, ...)*)(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @uread(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @_read to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_print_numbers(void) {
  int n;
  n = '0';
  while (n <= '9') {
    ft_putchar(n);
    n = n + 1;
  }
}


x86 assembly (clang, -O0):
<ft_print_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x30,-0x4(%rbp)
cmpl   $0x39,-0x4(%rbp)
jg     113f <ft_print_numbers+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ft_print_numbers+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_numbers>:
push   %rax
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
mov    $0x31,%edi
call   1030 <ft_putchar@plt>
mov    $0x32,%edi
call   1030 <ft_putchar@plt>
mov    $0x33,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x35,%edi
call   1030 <ft_putchar@plt>
mov    $0x36,%edi
call   1030 <ft_putchar@plt>
mov    $0x37,%edi
call   1030 <ft_putchar@plt>
mov    $0x38,%edi
call   1030 <ft_putchar@plt>
mov    $0x39,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_numbers() {
%1 = alloca i32
store i32 48, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 57
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @ft_putchar(i32 %6)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ft_print_numbers() {
%1 = tail call i32 @ft_putchar(i32 48)
%2 = tail call i32 @ft_putchar(i32 49)
%3 = tail call i32 @ft_putchar(i32 50)
%4 = tail call i32 @ft_putchar(i32 51)
%5 = tail call i32 @ft_putchar(i32 52)
%6 = tail call i32 @ft_putchar(i32 53)
%7 = tail call i32 @ft_putchar(i32 54)
%8 = tail call i32 @ft_putchar(i32 55)
%9 = tail call i32 @ft_putchar(i32 56)
%10 = tail call i32 @ft_putchar(i32 57)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, unsigned int);
void print_item(const char *key, unsigned int value) {
  printf("%s\t%u\n", key, value);
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s\09%u\0A\00"
define void @print_item(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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\09%u\0A\00"
define void @print_item(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, int);
void get_font_access() {
  outw(0x3c4, 0x0100);
  outw(0x3c4, 0x0402);
  outw(0x3c4, 0x0704);
  outw(0x3c4, 0x0300);
  outw(0x3ce, 0x0204);
  outw(0x3ce, 0x0005);
  outw(0x3ce, 0x0406);
}


x86 assembly (clang, -O0):
<get_font_access>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c4,%edi
mov    $0x100,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x402,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x704,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x300,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x204,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x5,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x406,%esi
call   1030 <outw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_font_access>:
push   %rax
mov    $0x3c4,%edi
mov    $0x100,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x402,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x704,%esi
call   1030 <outw@plt>
mov    $0x3c4,%edi
mov    $0x300,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x204,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x5,%esi
call   1030 <outw@plt>
mov    $0x3ce,%edi
mov    $0x406,%esi
pop    %rax
jmp    1030 <outw@plt>

LLVM IR (-O0):
define void @get_font_access() {
%1 = call i32 @outw(i32 964, i32 256)
%2 = call i32 @outw(i32 964, i32 1026)
%3 = call i32 @outw(i32 964, i32 1796)
%4 = call i32 @outw(i32 964, i32 768)
%5 = call i32 @outw(i32 974, i32 516)
%6 = call i32 @outw(i32 974, i32 5)
%7 = call i32 @outw(i32 974, i32 1030)
ret void
}

LLVM IR (-O2):
define void @get_font_access() {
%1 = tail call i32 @outw(i32 964, i32 256)
%2 = tail call i32 @outw(i32 964, i32 1026)
%3 = tail call i32 @outw(i32 964, i32 1796)
%4 = tail call i32 @outw(i32 964, i32 768)
%5 = tail call i32 @outw(i32 974, i32 516)
%6 = tail call i32 @outw(i32 974, i32 5)
%7 = tail call i32 @outw(i32 974, i32 1030)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void init_reap(int sig) {
  pid_t pid;
  while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
    ;
  }
}


x86 assembly (clang, -O0):
<init_reap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1143 <init_reap+0x33>
jmp    111b <init_reap+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_reap>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %eax,%eax
jg     1120 <init_reap+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @init_reap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* null, i32 %5)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @init_reap(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i32 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
unsigned long long popcount(unsigned long long x) {
  return __builtin_popcountll(x);
}


x86 assembly (clang, -O0):
<popcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,%rax
shr    %rax
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rax
sub    %rax,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
mov    %rcx,%rax
and    %rdx,%rax
shr    $0x2,%rcx
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rcx,%rax
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount>:
mov    %rdi,%rax
shr    %rax
movabs $0x5555555555555555,%rcx
55 55 55
and    %rax,%rcx
sub    %rcx,%rdi
movabs $0x3333333333333333,%rax
33 33 33
mov    %rdi,%rcx
and    %rax,%rcx
shr    $0x2,%rdi
and    %rdi,%rax
add    %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
add    %rax,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rcx,%rdx
movabs $0x101010101010101,%rax
01 01 01
imul   %rdx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i64 @popcount(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @llvm.ctpop.i64(i64 %3)
%5 = trunc i64 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @popcount(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
ret i64 %2
}
void VecSelfScalarDiv3iv(int v[3], int s) {
  v[0] /= s;
  v[1] /= s;
  v[2] /= s;
}


x86 assembly (clang, -O0):
<VecSelfScalarDiv3iv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x4(%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x8(%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecSelfScalarDiv3iv>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
cltd
idiv   %esi
mov    %eax,(%rdi)
mov    %ecx,%eax
cltd
idiv   %esi
mov    %eax,0x4(%rdi)
mov    0x8(%rdi),%eax
cltd
idiv   %esi
mov    %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @VecSelfScalarDiv3iv(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, %5
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = sdiv i32 %13, %10
store i32 %14, i32* %12
%15 = load i32, i32* %4
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = sdiv i32 %18, %15
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @VecSelfScalarDiv3iv(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sdiv i32 %3, %1
store i32 %4, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = sdiv i32 %6, %1
store i32 %7, i32* %5
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = sdiv i32 %9, %1
store i32 %10, i32* %8
ret void
}
int soma_diagonal_p(int mat[10][10]) {
  int i, j, soma = 0;
  for (i = 0; i < 10; i++) {
    soma += mat[i][i];
  }
  return soma;
}


x86 assembly (clang, -O0):
<soma_diagonal_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    114a <soma_diagonal_p+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <soma_diagonal_p+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma_diagonal_p>:
mov    0x2c(%rdi),%eax
add    (%rdi),%eax
add    0x58(%rdi),%eax
add    0x84(%rdi),%eax
add    0xb0(%rdi),%eax
add    0xdc(%rdi),%eax
add    0x108(%rdi),%eax
add    0x134(%rdi),%eax
add    0x160(%rdi),%eax
add    0x18c(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @soma_diagonal_p([10 x i32]* nocapture %0) {
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 1, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 2, i64 2
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 3, i64 3
%11 = load i32, i32* %10
%12 = add nsw i32 %11, %9
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 4, i64 4
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %12
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 5, i64 5
%17 = load i32, i32* %16
%18 = add nsw i32 %17, %15
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 6, i64 6
%20 = load i32, i32* %19
%21 = add nsw i32 %20, %18
%22 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 7, i64 7
%23 = load i32, i32* %22
%24 = add nsw i32 %23, %21
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 8, i64 8
%26 = load i32, i32* %25
%27 = add nsw i32 %26, %24
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 9, i64 9
%29 = load i32, i32* %28
%30 = add nsw i32 %29, %27
ret i32 %30
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int x = 1;
  if (x == 10) {
    goto win;
  } else {
    printf("its not a 10");
  }
win:
  printf("you win is called even though I didn't want it to");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    1135 <main+0x25>
jmp    1146 <main+0x36>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <main+0x36>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"its not a 10\00"
@.str.1 = [50 x i8] c"you win is called even though I didn't want it to\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %0
br label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
br label %9
9: ; preds = %8, %5
%10 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"its not a 10\00"
@.str.1 = [50 x i8] c"you win is called even though I didn't want it to\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}