xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ yldisp_led_blink(int /*<<< orphan*/, int);
void yldisp_led_off() { yldisp_led_blink(0, 1); }


x86 assembly (clang, -O0):
<yldisp_led_off>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <yldisp_led_blink@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yldisp_led_off>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <yldisp_led_blink@plt>

LLVM IR (-O0):
define void @yldisp_led_off() {
%1 = call i32 @yldisp_led_blink(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @yldisp_led_off() {
%1 = tail call i32 @yldisp_led_blink(i32 0, i32 1)
ret void
}
void rop3_88_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = S | T;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


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

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

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

LLVM IR (-O2):
define void @rop3_88_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
void RTGetOptFetchValue(void) {}


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

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

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

LLVM IR (-O2):
define void @RTGetOptFetchValue() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Flush_Buffer(int);
scalar_t__ Get_Bits1();
int extra_bit_information() {
  int Byte_Count = 0;
  while (Get_Bits1()) {
    Flush_Buffer(8);
    Byte_Count++;
  }
  return (Byte_Count);
}


x86 assembly (clang, -O0):
<extra_bit_information>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Get_Bits1@plt>
cmp    $0x0,%rax
je     1158 <extra_bit_information+0x38>
mov    $0x8,%edi
call   1040 <Flush_Buffer@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <extra_bit_information+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extra_bit_information>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <Get_Bits1@plt>
test   %rax,%rax
je     1159 <extra_bit_information+0x39>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x8,%edi
call   1040 <Flush_Buffer@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Get_Bits1@plt>
test   %rax,%rax
jne    1140 <extra_bit_information+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @extra_bit_information() {
%1 = tail call i64 (...) @Get_Bits1()
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 @Flush_Buffer(i32 8)
%6 = add nuw nsw i32 %4, 1
%7 = tail call i64 (...) @Get_Bits1()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %0
%10 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int regcomp(int /*<<< orphan*/ *, char const *, int);
__attribute__((__weak__, __always___)) int
softboundcets_regcomp(regex_t *preg, const char *regex, int cflags) {
  return regcomp(preg, regex, cflags);
}


x86 assembly (clang, -O0):
<softboundcets_regcomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <regcomp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_regcomp>:
jmp    1030 <regcomp@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_regcomp(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 @regcomp(i32* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundcets_regcomp(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @regcomp(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct rtrb_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void **rtrb_probe(struct rtrb_table *, void *);
void(rtrb_assert_insert)(struct rtrb_table *table, void *item) {
  void **p = rtrb_probe(table, item);
  assert(p != NULL && *p == item);
}


x86 assembly (clang, -O0):
<rtrb_assert_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rtrb_probe@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1162 <rtrb_assert_insert+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrb_assert_insert>:
push   %rbx
mov    %rsi,%rbx
call   1030 <rtrb_probe@plt>
xor    %edi,%edi
test   %rax,%rax
je     1137 <rtrb_assert_insert+0x17>
cmp    %rbx,(%rax)
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.rtrb_table = type { i32 }
define void @rtrb_assert_insert(%struct.rtrb_table* %0, i8* %1) {
%3 = alloca %struct.rtrb_table*
%4 = alloca i8*
%5 = alloca i8**
store %struct.rtrb_table* %0, %struct.rtrb_table** %3
store i8* %1, i8** %4
%6 = load %struct.rtrb_table*, %struct.rtrb_table** %3
%7 = load i8*, i8** %4
%8 = call i8** @rtrb_probe(%struct.rtrb_table* %6, i8* %7)
store i8** %8, i8*** %5
%9 = load i8**, i8*** %5
%10 = icmp ne i8** %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = load i8*, i8** %4
%15 = icmp eq i8* %13, %14
br label %16
16: ; preds = %11, %2
%17 = phi i1 [ false, %2 ], [ %15, %11 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret void
}

LLVM IR (-O2):
%struct.rtrb_table = type { i32 }
define void @rtrb_assert_insert(%struct.rtrb_table* %0, i8* %1) {
%3 = tail call i8** @rtrb_probe(%struct.rtrb_table* %0, i8* %1)
%4 = icmp eq i8** %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
%11 = tail call i32 @assert(i32 %10)
ret void
}
struct zero_ring_buffer *zero_ring_buffer_attach(void *storage) {
  return (struct zero_ring_buffer *)storage;
}


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

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

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

LLVM IR (-O2):
%struct.zero_ring_buffer = type opaque
define %struct.zero_ring_buffer* @zero_ring_buffer_attach(i8* readnone %0) {
%2 = bitcast i8* %0 to %struct.zero_ring_buffer*
ret %struct.zero_ring_buffer* %2
}
/* Variables and functions */
long hex2data(int, char const *);
int /*<<< orphan*/ set_hmdl_time(long);
void eval_set_time(const char in[]) {
  long time = hex2data(8, in);
  set_hmdl_time(time);
}


x86 assembly (clang, -O0):
<eval_set_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x8,%edi
call   1040 <hex2data@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <set_hmdl_time@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_set_time>:
push   %rax
mov    %rdi,%rsi
mov    $0x8,%edi
call   1040 <hex2data@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <set_hmdl_time@plt>

LLVM IR (-O0):
define void @eval_set_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @hex2data(i32 8, i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @set_hmdl_time(i64 %6)
ret void
}

LLVM IR (-O2):
define void @eval_set_time(i8* %0) {
%2 = tail call i64 @hex2data(i32 8, i8* %0)
%3 = tail call i32 @set_hmdl_time(i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_add(uintptr_t, uintptr_t, uintptr_t);
void fiat_p384_add(uint64_t out1[6], const uint64_t arg1[6],
                   const uint64_t arg2[6]) {
  internal_fiat_p384_add((uintptr_t)out1, (uintptr_t)arg1, (uintptr_t)arg2);
}


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

x86 assembly (clang, -O2):
<fiat_p384_add>:
jmp    1030 <internal_fiat_p384_add@plt>

LLVM IR (-O0):
define void @fiat_p384_add(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 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p384_add(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_add(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p384_add(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int japi_getinsets(int, int);
int j_getinsets(int arg0, int arg1) { return (japi_getinsets(arg0, arg1)); }


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

x86 assembly (clang, -O2):
<j_getinsets>:
jmp    1030 <japi_getinsets@plt>

LLVM IR (-O0):
define i32 @j_getinsets(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 = call i32 @japi_getinsets(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @j_getinsets(i32 %0, i32 %1) {
%3 = tail call i32 @japi_getinsets(i32 %0, i32 %1)
ret i32 %3
}
int FIO_blockID_to_blockSize(int id) { return (1 << id) * (1U << 10); }


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

x86 assembly (clang, -O2):
<FIO_blockID_to_blockSize>:
mov    %edi,%ecx
mov    $0x400,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @FIO_blockID_to_blockSize(i32 %0) {
%2 = shl i32 1024, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void double_array(void **array, size_t type, size_t *size) {
  void **ptr = array;
  *size *= 2;
  *ptr = realloc(*array, *size * type);
  if (ptr) {
    array = ptr;
  } else {
    fprintf(stderr, "\nCouldn't allocate memory!");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<double_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
shl    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
imul   -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1194 <double_array+0x64>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b3 <double_array+0x83>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
lea    0xe5c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_array>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdx),%rax
add    %rax,%rax
mov    %rax,(%rdx)
mov    (%rdi),%rdi
imul   %rax,%rsi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"\0ACouldn't allocate memory!\00"
define void @double_array(i8** %0, i64 %1, i64* %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i8**
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%8 = load i8**, i8*** %4
store i8** %8, i8*** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = mul i64 %10, 2
store i64 %11, i64* %9
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = load i64*, i64** %6
%15 = load i64, i64* %14
%16 = load i64, i64* %5
%17 = mul i64 %15, %16
%18 = call i8* @realloc(i8* %13, i64 %17)
%19 = load i8**, i8*** %7
store i8* %18, i8** %19
%20 = load i8**, i8*** %7
%21 = icmp ne i8** %20, null
br i1 %21, label %22, label %24
22: ; preds = %3
%23 = load i8**, i8*** %7
store i8** %23, i8*** %4
br label %28
24: ; preds = %3
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %22
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @double_array(i8** nocapture %0, i64 %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = shl i64 %4, 1
store i64 %5, i64* %2
%6 = load i8*, i8** %0
%7 = mul i64 %5, %1
%8 = tail call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1, "Hello (via write())\n", 20);
  printf("Hello world (%s)\n", "via printf()");
  open("file", 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xeb5(%rip),%rsi
mov    $0x14,%edx
call   1030 <write@plt>
lea    0xeb9(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
mov    $0x14,%edx
call   1030 <write@plt>
lea    0xec7(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %esi,%esi
call   1050 <open@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Hello (via write())\0A\00"
@.str.1 = [18 x i8] c"Hello world (%s)\0A\00"
@.str.2 = [13 x i8] c"via printf()\00"
@.str.3 = [5 x i8] c"file\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 20)
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hello (via write())\0A\00"
@.str.1 = [18 x i8] c"Hello world (%s)\0A\00"
@.str.2 = [13 x i8] c"via printf()\00"
@.str.3 = [5 x i8] c"file\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", ((1 - 0) * (1 - 0) + (3 - 0) * (3 - 0)) < 3 * 3);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void window_restore() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @window_restore() {
%1 = tail call i32 (...) @endwin()
ret void
}
void regdummy() {}


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

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

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

LLVM IR (-O2):
define void @regdummy() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
bool cmp1(const void *a, const void *b) {
  return *(uint8_t *)a == *(uint8_t *)b;
}


x86 assembly (clang, -O0):
<cmp1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp1>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @cmp1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp eq i64 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp1(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int sommacifre(char *num) {
  int res = 0;
  char *p = num;
  while (*p != '\0') {
    res += *p - '0';
    p++;
  }
  return res;
}


x86 assembly (clang, -O0):
<sommacifre>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <sommacifre+0x48>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <sommacifre+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sommacifre>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <sommacifre+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sommacifre+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sommacifre(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
br label %6
20: ; preds = %6
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @sommacifre(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = add i32 %7, -48
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
int test01(int *p) {
  if (p)
    ;
  return *p;
}


x86 assembly (clang, -O0):
<test01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <test01+0x18>
jmp    1118 <test01+0x18>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test01(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clearScreen();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int gamestart() {
  clearScreen();
  printf("\n\t Press ENTER to start the game.\n\tEnjoy and have fun! ");
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<gamestart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clearScreen@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamestart>:
push   %rax
xor    %eax,%eax
call   1050 <clearScreen@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"\0A\09 Press ENTER to start the game.\0A\09Enjoy and have fun! \00"
define i32 @gamestart() {
%1 = call i32 (...) @clearScreen()
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
%4 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [56 x i8] c"\0A\09 Press ENTER to start the game.\0A\09Enjoy and have fun! \00"
define i32 @gamestart() {
%1 = tail call i32 (...) @clearScreen()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *const, char *const *);
int /*<<< orphan*/ perror(char *const);
int main() {
  char *const args[] = {
      "/bin/echo",
      "abc",
      "def",
      NULL,
  };
  execvp(args[0], args);
  perror(args[0]);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cc7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cc4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <execvp@plt>
mov    -0x30(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cc9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execvp@plt>
mov    (%rsp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/echo\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [4 x i8] c"def\00"
@__const.main.args = [4 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
store i32 0, i32* %1
%3 = bitcast [4 x i8*]* %2 to i8*
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%5 = load i8*, i8** %4
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%7 = call i32 @execvp(i8* %5, i8** %6)
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @perror(i8* %9)
ret i32 -1
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/echo\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [4 x i8] c"def\00"
@__const.main.args = [4 x i8*] [i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execvp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = load i8*, i8** %3
%6 = call i32 @perror(i8* %5)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ft_memset(char *, char, int /*<<< orphan*/);
int /*<<< orphan*/ ft_strlen(char *);
void ft_strclr(char *s) {
  if (s)
    ft_memset(s, '\0', ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <ft_strclr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1040 <ft_memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     113b <ft_strclr+0x1b>
push   %rbx
mov    %rdi,%rbx
call   1030 <ft_strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <ft_memset@plt>
ret

LLVM IR (-O0):
define void @ft_strclr(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 %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i32 @ft_memset(i8* %6, i8 signext 0, i32 %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @ft_memset(i8* %0, i8 signext 0, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int stat(char const *, struct stat *);
void Stat(const char *path, struct stat *info) {
  int success = stat(path, info);
  if (success == -1) {
    do {
      int e = errno;
      perror(path);
      exit(e);
    } while (0);
  }
}


x86 assembly (clang, -O0):
<Stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    117c <Stat+0x4c>
jmp    115f <Stat+0x2f>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Stat>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1147 <Stat+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
define void @Stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%7 = load i8*, i8** %3
%8 = load %struct.stat*, %struct.stat** %4
%9 = call i32 @stat(i8* %7, %struct.stat* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %20
12: ; preds = %2
br label %13
13: ; preds = %12
%14 = load i32, i32* @errno
store i32 %14, i32* %6
%15 = load i8*, i8** %3
%16 = call i32 @perror(i8* %15)
%17 = load i32, i32* %6
%18 = call i32 @exit(i32 %17)
unreachable
19: ; No predecessors!
br label %20
20: ; preds = %19, %2
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
define void @Stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @exit(i32 %6)
unreachable
9: ; preds = %2
ret void
}
int preferIPv4Stack() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @preferIPv4Stack() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ GPSSatellitesHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GPSSatellitesRequestUpdate() {
  UAVObjRequestUpdate(GPSSatellitesHandle());
}


x86 assembly (clang, -O0):
<GPSSatellitesRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GPSSatellitesHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSSatellitesRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <GPSSatellitesHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @GPSSatellitesRequestUpdate() {
%1 = call i32 (...) @GPSSatellitesHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSSatellitesRequestUpdate() {
%1 = tail call i32 (...) @GPSSatellitesHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ls(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; ++i)
    ls(argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <ls@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <ls@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @ls(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
int fun192() { return 192; }


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

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

LLVM IR (-O0):
define i32 @fun192() {
ret i32 192
}

LLVM IR (-O2):
define i32 @fun192() {
ret i32 192
}
/* Variables and functions */
int *malloc(int);
int do_an_allocation() {
  int *a = malloc(sizeof(int));
  int *b = a;
  *a = 4;
  return 48;
}


x86 assembly (clang, -O0):
<do_an_allocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
mov    $0x30,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_an_allocation>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    $0x30,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @do_an_allocation() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32* %4, i32** %2
%5 = load i32*, i32** %1
store i32 4, i32* %5
ret i32 48
}

LLVM IR (-O2):
define i32 @do_an_allocation() {
%1 = tail call i32* @malloc(i32 4)
ret i32 48
}
unsigned int hash_function(const char *str, int size) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash % size;
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x1505,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     114d <hash_function+0x4d>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <hash_function+0x13>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
mov    (%rdi),%cl
test   %cl,%cl
je     112e <hash_function+0x2e>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_function+0x10>
jmp    1133 <hash_function+0x33>
mov    $0x1505,%eax
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     114b <hash_function+0x4b>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_function(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i64 [ %12, %5 ], [ 5381, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i64 %8, 33
%11 = sext i8 %6 to i64
%12 = add i64 %10, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 5381, %2 ], [ %12, %5 ]
%17 = sext i32 %1 to i64
%18 = urem i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int my_putchar(char c) {
  write(1, &c, 1);
  return (0);
}


x86 assembly (clang, -O0):
<my_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @my_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 0
}
unsigned int test_loop_shift20(unsigned int n) {
  unsigned i;
  for (i = 0; i < 10; i++) {
    n <<= 2;
  }
  return n;
}


x86 assembly (clang, -O0):
<test_loop_shift20>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    112f <test_loop_shift20+0x2f>
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_loop_shift20+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_loop_shift20>:
mov    %edi,%eax
shl    $0x14,%eax
ret

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

LLVM IR (-O2):
define i32 @test_loop_shift20(i32 %0) {
%2 = shl i32 %0, 20
ret i32 %2
}
/* Variables and functions */
scalar_t__ tanh(double);
int main() { return tanh(3.45) != 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1030 <tanh@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <tanh@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @tanh(double 3.450000e+00)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @tanh(double 3.450000e+00)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef size_t uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void store_SINT32(int32_t *arr, uint32_t idx, int32_t value) {
  arr[idx] = value;
}


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

x86 assembly (clang, -O2):
<store_SINT32>:
mov    %edx,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @store_SINT32(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i32, i32* %8, i64 %9
store i32 %7, i32* %10
ret void
}

LLVM IR (-O2):
define void @store_SINT32(i32* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
store i32 %2, i32* %4
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
void printCharNumberV1() {
  long numberOfChar = 0;
  while (getchar() != EOF) {
    ++numberOfChar;
  }
  printf("%ld\n", numberOfChar);
}


x86 assembly (clang, -O0):
<printCharNumberV1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
je     1158 <printCharNumberV1+0x38>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <printCharNumberV1+0x10>
mov    -0x8(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCharNumberV1>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <printCharNumberV1+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define void @printCharNumberV1() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %6, %0
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i64, i64* %1
%8 = add nsw i64 %7, 1
store i64 %8, i64* %1
br label %2
9: ; preds = %2
%10 = load i64, i64* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %10)
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define void @printCharNumberV1() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret void
}
int tohex(int c) {
  if ((c >= '0') && (c <= '9')) {
    return c - '0';
  }
  if ((c >= 'a') && (c <= 'f')) {
    return c - 'a' + 10;
  }
  if ((c >= 'A') && (c <= 'F')) {
    return c - 'A' + 10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tohex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <tohex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <tohex+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <tohex+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <tohex+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <tohex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <tohex+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <tohex+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <tohex+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <tohex+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1124 <tohex+0x24>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <tohex+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%ecx
add    $0xffffffc9,%edi
xor    %eax,%eax
cmp    $0x6,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @tohex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 0, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @tohex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 0
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog_name) {
  printf("Usage:\n\t%s <num_elements_to_sort> <num_times_to_sort>", prog_name);
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"Usage:\0A\09%s <num_elements_to_sort> <num_times_to_sort>\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Usage:\0A\09%s <num_elements_to_sort> <num_times_to_sort>\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}