xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int st103_get_epreg(int /*<<< orphan*/);
int /*<<< orphan*/ st103_set_epreg(int /*<<< orphan*/, int);
void st103_ep_set_rx_status(uint8_t ep_num, uint16_t st_rx) {
  uint16_t value = st103_get_epreg(ep_num);
  value &= (((0x8000) | (0x0800) | (0x0600) | (0x0100) | (0x0080) | (0x000F)) |
            (0x3000));
  value ^= ((0x1000) & st_rx);
  value ^= ((0x2000) & st_rx);
  value |= (0x8000) | (0x0080);
  st103_set_epreg(ep_num, value);
}


x86 assembly (clang, -O0):
<st103_ep_set_rx_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <st103_get_epreg@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xbf8f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1000,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x2000,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x8080,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <st103_set_epreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_ep_set_rx_status>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <st103_get_epreg@plt>
and    $0x3f0f,%eax
and    $0x3000,%ebx
xor    %eax,%ebx
or     $0x8080,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <st103_set_epreg@plt>

LLVM IR (-O0):
define void @st103_ep_set_rx_status(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @st103_get_epreg(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = and i32 %8, 49039
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = and i32 4096, %10
%12 = load i32, i32* %5
%13 = xor i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = and i32 8192, %14
%16 = load i32, i32* %5
%17 = xor i32 %16, %15
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = or i32 %18, 32896
store i32 %19, i32* %5
%20 = load i32, i32* %3
%21 = load i32, i32* %5
%22 = call i32 @st103_set_epreg(i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @st103_ep_set_rx_status(i32 %0, i32 %1) {
%3 = tail call i32 @st103_get_epreg(i32 %0)
%4 = and i32 %3, 16143
%5 = and i32 %1, 12288
%6 = xor i32 %4, %5
%7 = or i32 %6, 32896
%8 = tail call i32 @st103_set_epreg(i32 %0, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int);
int raise(int);
int eraise(int sig) {
  int ret;
  if ((ret = raise(sig)) != 0)
    die("failed to raise signal %d", sig);
  return ret;
}


x86 assembly (clang, -O0):
<eraise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <raise@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     114e <eraise+0x2e>
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eraise>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <raise@plt>
mov    %eax,%ebp
test   %eax,%eax
je     113e <eraise+0x1e>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
call   1040 <die@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"failed to raise signal %d\00"
define i32 @eraise(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @raise(i32 %4)
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"failed to raise signal %d\00"
define i32 @eraise(i32 %0) {
%2 = tail call i32 @raise(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Type definitions */
struct timespec {
  long long tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
signed long long tsdiff(struct timespec *new, struct timespec *old) {
  return (new->tv_sec - old->tv_sec) * (long long)(1000 * 1000 * 1000) +
         new->tv_nsec - old->tv_nsec;
}


x86 assembly (clang, -O0):
<tsdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%rax
imul   $0x3b9aca00,%rax,%rax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
mov    -0x10(%rbp),%rcx
sub    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsdiff>:
mov    (%rdi),%rax
sub    (%rsi),%rax
imul   $0x3b9aca00,%rax,%rax
add    0x8(%rdi),%rax
sub    0x8(%rsi),%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @tsdiff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = mul nsw i64 %11, 1000000000
%13 = load %struct.timespec*, %struct.timespec** %3
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 1
%15 = load i64, i64* %14
%16 = add nsw i64 %12, %15
%17 = load %struct.timespec*, %struct.timespec** %4
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
ret i64 %20
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @tsdiff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = mul nsw i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
ret i64 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t inverse_adjust_seed_8(uint32_t seed) {
  return seed ^ (seed << 8) ^ (seed << 16) ^ (seed << 24);
}


x86 assembly (clang, -O0):
<inverse_adjust_seed_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse_adjust_seed_8>:
mov    %edi,%ecx
shl    $0x8,%ecx
xor    %edi,%ecx
mov    %edi,%eax
shl    $0x10,%eax
shl    $0x18,%edi
xor    %edi,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @inverse_adjust_seed_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 8
%6 = xor i32 %3, %5
%7 = load i32, i32* %2
%8 = shl i32 %7, 16
%9 = xor i32 %6, %8
%10 = load i32, i32* %2
%11 = shl i32 %10, 24
%12 = xor i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @inverse_adjust_seed_8(i32 %0) {
%2 = shl i32 %0, 8
%3 = xor i32 %2, %0
%4 = shl i32 %0, 16
%5 = xor i32 %3, %4
%6 = shl i32 %0, 24
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ handle_61(int /*<<< orphan*/);
int gen_61() {
  handle_61(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_61() {
%1 = call i32 @handle_61(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_61() {
%1 = tail call i32 @handle_61(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Menus_OpenByName(char *);
void CG_ShowRadioMenus(void) { Menus_OpenByName("ingame_radio"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"ingame_radio\00"
define void @CG_ShowRadioMenus() {
%1 = call i32 @Menus_OpenByName(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"ingame_radio\00"
define void @CG_ShowRadioMenus() {
%1 = tail call i32 @Menus_OpenByName(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t set64_H_0(uint64_t x) { return x &= 0x3FFFFFFFFFFFFFFF; }


x86 assembly (clang, -O0):
<set64_H_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0x3fffffffffffffff,%rcx
ff ff 3f
and    %rcx,%rax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @set64_H_0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 4611686018427387903
%6 = trunc i64 %5 to i32
store i32 %6, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @set64_H_0(i32 returned %0) {
ret i32 %0
}
unsigned int call_destroy(unsigned int descriptor) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @call_destroy(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ d();
void c() { d(); }


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

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

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

LLVM IR (-O2):
define void @c() {
%1 = tail call i32 (...) @d()
ret void
}
/* Variables and functions */
int atoi(char const *);
int jw_atoi(const char *a, int def) {
  if (a == NULL) {
    return def;
  }
  return atoi(a);
}


x86 assembly (clang, -O0):
<jw_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <jw_atoi+0x25>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <jw_atoi+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jw_atoi>:
test   %rdi,%rdi
je     111a <jw_atoi+0xa>
jmp    1030 <atoi@plt>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @jw_atoi(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @atoi(i8* %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
ret i32 %7
}
int test_imm_F5uint8_mem(unsigned char *val) {
  return ((*val) & (0xF5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -11
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int fgetc(int /*<<< orphan*/ *);
unsigned int fget1(FILE *stream) { return fgetc(stream); }


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

x86 assembly (clang, -O2):
<fget1>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @fget1(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret i32 %2
}
void reset_kcd_buffer(unsigned char *buffer) {
  int i;
  for (i = 0; i < 64; i++) {
    buffer[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<reset_kcd_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1133 <reset_kcd_buffer+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <reset_kcd_buffer+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_kcd_buffer>:
xorps  %xmm0,%xmm0
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @reset_kcd_buffer(i8* nocapture writeonly %0) {
ret void
}
int mus_big_endian_int(unsigned char *inp) {
  int o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[0];
  outp[1] = inp[1];
  outp[2] = inp[2];
  outp[3] = inp[3];
  return (o);
}


x86 assembly (clang, -O0):
<mus_big_endian_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mus_big_endian_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw i32 %9, 24
%11 = zext i8 %6 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = zext i8 %4 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = zext i8 %2 to i32
%16 = or i32 %14, %15
%17 = or i32 %16, %12
%18 = or i32 %17, %10
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage_error() {
  printf("Usage: hotelgwclient list <hostname>\n");
  printf("       hotelgwclient book <hostname> [type] <guest>\n");
  printf("       hotelgwclient guests <hostname>\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: hotelgwclient list <hostname>\0A\00"
@.str.1 = [53 x i8] c" hotelgwclient book <hostname> [type] <guest>\0A\00"
@.str.2 = [40 x i8] c" hotelgwclient guests <hostname>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [37 x i8] c"Usage: hotelgwclient list <hostname>\00"
@str.3 = [52 x i8] c" hotelgwclient book <hostname> [type] <guest>\00"
@str.4 = [39 x i8] c" hotelgwclient guests <hostname>\00"
define void @usage_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int btshas_blzst0_log2up(int v) {
  int i, j;
  i = 0;
  j = v;
  while (j > 1) {
    i++;
    j = (j + 1) >> 1;
  }
  return (i);
}


x86 assembly (clang, -O0):
<btshas_blzst0_log2up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1138 <btshas_blzst0_log2up+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <btshas_blzst0_log2up+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btshas_blzst0_log2up>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111f <btshas_blzst0_log2up+0x1f>
xor    %eax,%eax
nopl   0x0(%rax)
add    $0x1,%eax
lea    0x1(%rdi),%ecx
shr    %ecx
cmp    $0x2,%edi
mov    %ecx,%edi
ja     1110 <btshas_blzst0_log2up+0x10>
ret

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

LLVM IR (-O2):
define i32 @btshas_blzst0_log2up(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = lshr i32 %7, 1
%9 = icmp ugt i32 %4, 2
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          void *(*)(void *), void *);
void create_thread(void *(*funct)(void *), void *obj) {
  pthread_t thread;
  if (pthread_create(&thread, NULL, funct, obj))
    fatal("Thread creation failed");
}


x86 assembly (clang, -O0):
<create_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_create@plt>
cmp    $0x0,%rax
je     115b <create_thread+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_thread>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <pthread_create@plt>
test   %rax,%rax
je     1144 <create_thread+0x24>
lea    0xec1(%rip),%rdi
call   1040 <fatal@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Thread creation failed\00"
define void @create_thread(i8* (i8*)* %0, i8* %1) {
%3 = alloca i8* (i8*)*
%4 = alloca i8*
%5 = alloca i32
store i8* (i8*)* %0, i8* (i8*)** %3
store i8* %1, i8** %4
%6 = load i8* (i8*)*, i8* (i8*)** %3
%7 = load i8*, i8** %4
%8 = call i64 @pthread_create(i32* %5, i32* null, i8* (i8*)* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Thread creation failed\00"
define void @create_thread(i8* (i8*)* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @pthread_create(i32* %3, i32* null, i8* (i8*)* %0, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @fatal(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret void
}
extern void gui_ksys_delete_title_window(void) {
  __asm__ __volatile__("int $0x40" : : "a"(71), "b"(1), "c"(0));
}


x86 assembly (clang, -O0):
<gui_ksys_delete_title_window>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x47,%eax
mov    $0x1,%ebx
xor    %ecx,%ecx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_delete_title_window>:
push   %rbx
mov    $0x47,%eax
mov    $0x1,%ebx
xor    %ecx,%ecx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gui_ksys_delete_title_window() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 71, i32 1, i32 0)
ret void
}
/* Variables and functions */
void *malloc(unsigned int);
void *libc_malloc(unsigned int size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @libc_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
void __outw(unsigned short value, unsigned short port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
}


x86 assembly (clang, -O0):
<__outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

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

LLVM IR (-O2):
define void @__outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"Hello\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
void isr_int_TSS_error(long error_code) {}


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

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

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

LLVM IR (-O2):
define void @isr_int_TSS_error(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char *, size_t);
void sd_array_pop(void *mem, size_t item_size, int *num_size, void *old_item) {
  (*num_size)--;
  if (old_item != NULL) {
    memcpy(old_item, (char *)mem + item_size * (*num_size), item_size);
  }
}


x86 assembly (clang, -O0):
<sd_array_pop>:
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    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1161 <sd_array_pop+0x51>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
imul   %rcx,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_array_pop>:
mov    %rsi,%rax
mov    %rdi,%rsi
movslq (%rdx),%rdi
add    $0xffffffffffffffff,%rdi
mov    %edi,(%rdx)
test   %rcx,%rcx
je     1136 <sd_array_pop+0x26>
imul   %rax,%rdi
add    %rdi,%rsi
mov    %rcx,%rdi
mov    %rax,%rdx
jmp    1030 <memcpy@plt>
ret

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

LLVM IR (-O2):
define void @sd_array_pop(i8* %0, i64 %1, i32* nocapture %2, i8* %3) {
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp eq i8* %3, null
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = sext i32 %6 to i64
%10 = mul i64 %9, %1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = tail call i32 @memcpy(i8* %3, i8* %11, i64 %1)
br label %13
13: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DisplayHelpServer() {
  printf("---------------------------------------------------------\n"
         "To invoke the Traceroute server please enter:\n"
         "./traceroute PORT <port_no> RATE <no_requests,duration>"
         " MAX_USERS <max_user> STRICT_DEST <0/1>\n"
         "Any or all of these parameters are optional\n"
         "<port_no> should be between 1025 and 65536\n"
         "--------------------------------------------------------\n");
}


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

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

LLVM IR (-O0):
@.str = [344 x i8] c"---------------------------------------------------------\0ATo invoke the Traceroute server please enter:\0A./traceroute PORT <port_no> RATE <no_requests,duration> MAX_USERS <max_user> STRICT_DEST <0/1>\0AAny or all of these parameters are optional\0A<port_no> should be between 1025 and 65536\0A--------------------------------------------------------\0A\00"
define void @DisplayHelpServer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [343 x i8] c"---------------------------------------------------------\0ATo invoke the Traceroute server please enter:\0A./traceroute PORT <port_no> RATE <no_requests,duration> MAX_USERS <max_user> STRICT_DEST <0/1>\0AAny or all of these parameters are optional\0A<port_no> should be between 1025 and 65536\0A--------------------------------------------------------\00"
define void @DisplayHelpServer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([343 x i8], [343 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xconfigurerequest_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xconfigurerequest.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xconfigurerequest_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xconfigurerequest_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *tableAlloc(void *closure, size_t size) {
  ((void)closure);
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<tableAlloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @tableAlloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @tableAlloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
void IRCR_writew(unsigned short value) { ; }


x86 assembly (clang, -O0):
<IRCR_writew>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @IRCR_writew(i16 zeroext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0, b = 0, i = 0;
  a++;
  while (i < 5) {
    b++;
    i++;
    a++;
  };
  printf("%i\n", a);
  printf("%i\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1167 <main+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x2d>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\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 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_sub_int16_t(int /*<<< orphan*/ *, int);
int16_t atomic_dec_int16_t(int16_t *var) { return atomic_sub_int16_t(var, 1); }


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

x86 assembly (clang, -O2):
<atomic_dec_int16_t>:
mov    $0x1,%esi
jmp    1030 <atomic_sub_int16_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_dec_int16_t(i32* %0) {
%2 = tail call i32 @atomic_sub_int16_t(i32* %0, i32 1)
ret i32 %2
}
int OR(int a, int b) {
  int output = a | b;
  return output;
}


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

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

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

LLVM IR (-O2):
define i32 @OR(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_clear_quaddobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(387, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_clear_quaddobl_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x183,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_clear_quaddobl_system>:
mov    $0x183,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_clear_quaddobl_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 387, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_clear_quaddobl_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 387, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ end_measurement();
int fib(int);
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ start_measurement();
int main() {
  start_measurement();
  int res = fib(15);
  end_measurement();
  print_int(res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <start_measurement@plt>
mov    $0xf,%edi
call   1050 <fib@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <end_measurement@plt>
mov    -0x8(%rbp),%edi
call   1040 <print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <start_measurement@plt>
mov    $0xf,%edi
call   1050 <fib@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <end_measurement@plt>
mov    %ebx,%edi
call   1040 <print_int@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @start_measurement()
%4 = call i32 @fib(i32 15)
store i32 %4, i32* %2
%5 = call i32 (...) @end_measurement()
%6 = load i32, i32* %2
%7 = call i32 @print_int(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_measurement()
%2 = tail call i32 @fib(i32 15)
%3 = tail call i32 (...) @end_measurement()
%4 = tail call i32 @print_int(i32 %2)
ret i32 0
}
int test_imm_DAuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xDA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DAuint64_highword_reg>:
movabs $0xda00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DAuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 936302870528
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void MemManage_Handler() {
  while (true)
    ;
}


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

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

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

LLVM IR (-O2):
define void @MemManage_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ pA(char *, char *);
int /*<<< orphan*/ pop_callstack(char *);
int /*<<< orphan*/ pop_labelstack();
int /*<<< orphan*/ pop_stackframe();
int /*<<< orphan*/ push_stack(char *);
void __define_user_function_return(void) {
  pop_stackframe();
  pop_callstack("stack_head");
  push_stack("fixA");
  pop_labelstack();
  pA("PCP(P3F, %s);", "P03");
}


x86 assembly (clang, -O0):
<__define_user_function_return>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pop_stackframe@plt>
lea    0xe9e(%rip),%rdi
call   1050 <pop_callstack@plt>
lea    0xe9d(%rip),%rdi
call   1060 <push_stack@plt>
mov    $0x0,%al
call   1040 <pop_labelstack@plt>
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
call   1070 <pA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__define_user_function_return>:
push   %rax
xor    %eax,%eax
call   1030 <pop_stackframe@plt>
lea    0xea1(%rip),%rdi
call   1050 <pop_callstack@plt>
lea    0xea0(%rip),%rdi
call   1060 <push_stack@plt>
xor    %eax,%eax
call   1040 <pop_labelstack@plt>
lea    0xe92(%rip),%rdi
lea    0xe99(%rip),%rsi
pop    %rax
jmp    1070 <pA@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"stack_head\00"
@.str.1 = [5 x i8] c"fixA\00"
@.str.2 = [14 x i8] c"PCP(P3F, %s);\00"
@.str.3 = [4 x i8] c"P03\00"
define void @__define_user_function_return() {
%1 = call i32 (...) @pop_stackframe()
%2 = call i32 @pop_callstack(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @push_stack(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @pop_labelstack()
%5 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"stack_head\00"
@.str.1 = [5 x i8] c"fixA\00"
@.str.2 = [14 x i8] c"PCP(P3F, %s);\00"
@.str.3 = [4 x i8] c"P03\00"
define void @__define_user_function_return() {
%1 = tail call i32 (...) @pop_stackframe()
%2 = tail call i32 @pop_callstack(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @push_stack(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @pop_labelstack()
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_if(int);
int main() {
  test_if(1);
  test_if(2);
  test_if(3);
  test_if(4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <test_if@plt>
mov    $0x2,%edi
call   1030 <test_if@plt>
mov    $0x3,%edi
call   1030 <test_if@plt>
mov    $0x4,%edi
call   1030 <test_if@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test_if@plt>
mov    $0x2,%edi
call   1030 <test_if@plt>
mov    $0x3,%edi
call   1030 <test_if@plt>
mov    $0x4,%edi
call   1030 <test_if@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test_if(i32 1)
%2 = call i32 @test_if(i32 2)
%3 = call i32 @test_if(i32 3)
%4 = call i32 @test_if(i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_if(i32 1)
%2 = tail call i32 @test_if(i32 2)
%3 = tail call i32 @test_if(i32 3)
%4 = tail call i32 @test_if(i32 4)
ret i32 0
}
unsigned long long max_2(unsigned bit_start, unsigned bit_end) {
  int bits = (bit_end) - (bit_start) + 1;
  return ((0x1ULL << (bits - 1ULL)) - 1ULL) | (0xFULL << (bits - 4ULL));
}


x86 assembly (clang, -O0):
<max_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
sub    $0x1,%rcx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
movslq -0xc(%rbp),%rcx
sub    $0x4,%rcx
mov    $0xf,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_2>:
mov    %esi,%ecx
sub    %edi,%ecx
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
not    %rdx
add    $0xfffffffd,%ecx
mov    $0xf,%eax
shl    %cl,%rax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @max_2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = add i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = sub i64 %11, 1
%13 = shl i64 1, %12
%14 = sub i64 %13, 1
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = sub i64 %16, 4
%18 = shl i64 15, %17
%19 = or i64 %14, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @max_2(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, -1
%7 = shl nsw i64 -1, %6
%8 = xor i64 %7, -1
%9 = add nsw i64 %5, -4
%10 = shl i64 15, %9
%11 = or i64 %10, %8
ret i64 %11
}
void RTThreadNativeSelf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTThreadNativeSelf() {
ret void
}
long return_long_3() { return 1073741824; }


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

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

LLVM IR (-O0):
define i64 @return_long_3() {
ret i64 1073741824
}

LLVM IR (-O2):
define i64 @return_long_3() {
ret i64 1073741824
}
int __VbArchInit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__VbArchInit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @__VbArchInit() {
ret i32 0
}