xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ floats_angleaxis_to_quat(float const *, float *);
int /*<<< orphan*/ floats_quat_to_mat44(float *, float *);
void floats_angleaxis_to_mat44(const float aa[4], float r[16]) {
  float q[4];
  floats_angleaxis_to_quat(aa, q);
  floats_quat_to_mat44(q, r);
}


x86 assembly (clang, -O0):
<floats_angleaxis_to_mat44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <floats_angleaxis_to_quat@plt>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <floats_quat_to_mat44@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_angleaxis_to_mat44>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <floats_angleaxis_to_quat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <floats_quat_to_mat44@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @floats_angleaxis_to_mat44(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [4 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = getelementptr inbounds [4 x float], [4 x float]* %5, i64 0, i64 0
%8 = call i32 @floats_angleaxis_to_quat(float* %6, float* %7)
%9 = getelementptr inbounds [4 x float], [4 x float]* %5, i64 0, i64 0
%10 = load float*, float** %4
%11 = call i32 @floats_quat_to_mat44(float* %9, float* %10)
ret void
}

LLVM IR (-O2):
define void @floats_angleaxis_to_mat44(float* %0, float* %1) {
%3 = alloca [4 x float]
%4 = bitcast [4 x float]* %3 to i8*
%5 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%6 = call i32 @floats_angleaxis_to_quat(float* %0, float* %5)
%7 = call i32 @floats_quat_to_mat44(float* %5, float* %1)
ret void
}
void date_error(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @date_error(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void bit_set32(volatile uint32_t *ptr, uint8_t bit) {
  *((volatile uint32_t *)(((uintptr_t)ptr) | (1 << 27))) =
      (uint32_t)((1ul << bit));
}


x86 assembly (clang, -O0):
<bit_set32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
or     $0x8000000,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set32>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
or     $0x8000000,%rdi
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @bit_set32(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = shl i64 1, %5
%7 = load i64*, i64** %3
%8 = ptrtoint i64* %7 to i64
%9 = or i64 %8, 134217728
%10 = inttoptr i64 %9 to i64*
store volatile i64 %6, i64* %10
ret void
}

LLVM IR (-O2):
define void @bit_set32(i64* %0, i64 %1) {
%3 = shl nuw i64 1, %1
%4 = ptrtoint i64* %0 to i64
%5 = or i64 %4, 134217728
%6 = inttoptr i64 %5 to i64*
store volatile i64 %3, i64* %6
ret void
}
int main() {
  struct S {
    int x;
    int y;
  } s;
  struct S *p;
  p = &s;
  s.x = 1;
  p->y = 2;
  return p->y + p->x - 3;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
sub    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S = type { i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.S
%3 = alloca %struct.S*
store i32 0, i32* %1
store %struct.S* %2, %struct.S** %3
%4 = getelementptr inbounds %struct.S, %struct.S* %2, i32 0, i32 0
store i32 1, i32* %4
%5 = load %struct.S*, %struct.S** %3
%6 = getelementptr inbounds %struct.S, %struct.S* %5, i32 0, i32 1
store i32 2, i32* %6
%7 = load %struct.S*, %struct.S** %3
%8 = getelementptr inbounds %struct.S, %struct.S* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = load %struct.S*, %struct.S** %3
%11 = getelementptr inbounds %struct.S, %struct.S* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
%14 = sub nsw i32 %13, 3
ret i32 %14
}

LLVM IR (-O2):
%struct.S = type { i32, i32 }
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ change(int, int);
void rangechange(int a, int b, int val) {
  change(a, val);
  change(b + 1, (-1) * val);
}


x86 assembly (clang, -O0):
<rangechange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <change@plt>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
imul   $0xffffffff,-0xc(%rbp),%esi
call   1030 <change@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangechange>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edx,%esi
call   1030 <change@plt>
add    $0x1,%ebp
neg    %ebx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <change@plt>

LLVM IR (-O0):
define void @rangechange(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = call i32 @change(i32 %7, i32 %8)
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = load i32, i32* %6
%13 = mul nsw i32 -1, %12
%14 = call i32 @change(i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @rangechange(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @change(i32 %0, i32 %2)
%5 = add nsw i32 %1, 1
%6 = sub nsw i32 0, %2
%7 = tail call i32 @change(i32 %5, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  putchar('a');
  write(1, "b", 1);
  putchar('a');
  write(1, "b", 1);
  putchar('a');
  write(1, "b", 1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x1,%edx
lea    0xeab(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x1,%edx
lea    0xe8e(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x1,%edx
lea    0xe71(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x61,%edi
call   1030 <putchar@plt>
lea    0xebe(%rip),%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"b\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i8 signext 97)
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @putchar(i8 signext 97)
%5 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @putchar(i8 signext 97)
%7 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"b\00"
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 97)
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @putchar(i8 signext 97)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @putchar(i8 signext 97)
%6 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int close(int);
int io_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<io_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @io_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ protected_func();
int main(void) {
  protected_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @protected_func()
ret i32 0
}
/* Type definitions */
struct Population {
  int dummy;
};
struct Evolution {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_evolution(struct Evolution *);
int /*<<< orphan*/ destroy_evolution_state();
int /*<<< orphan*/ destroy_population(struct Population *);
void apocalypse(struct Evolution *evol, struct Population *omega) {
  destroy_population(omega);
  destroy_evolution(evol);
  destroy_evolution_state();
}


x86 assembly (clang, -O0):
<apocalypse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <destroy_population@plt>
mov    -0x8(%rbp),%rdi
call   1030 <destroy_evolution@plt>
mov    $0x0,%al
call   1040 <destroy_evolution_state@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apocalypse>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1050 <destroy_population@plt>
mov    %rbx,%rdi
call   1030 <destroy_evolution@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <destroy_evolution_state@plt>

LLVM IR (-O0):
%struct.Evolution = type { i32 }
%struct.Population = type { i32 }
define void @apocalypse(%struct.Evolution* %0, %struct.Population* %1) {
%3 = alloca %struct.Evolution*
%4 = alloca %struct.Population*
store %struct.Evolution* %0, %struct.Evolution** %3
store %struct.Population* %1, %struct.Population** %4
%5 = load %struct.Population*, %struct.Population** %4
%6 = call i32 @destroy_population(%struct.Population* %5)
%7 = load %struct.Evolution*, %struct.Evolution** %3
%8 = call i32 @destroy_evolution(%struct.Evolution* %7)
%9 = call i32 (...) @destroy_evolution_state()
ret void
}

LLVM IR (-O2):
%struct.Evolution = type { i32 }
%struct.Population = type { i32 }
define void @apocalypse(%struct.Evolution* %0, %struct.Population* %1) {
%3 = tail call i32 @destroy_population(%struct.Population* %1)
%4 = tail call i32 @destroy_evolution(%struct.Evolution* %0)
%5 = tail call i32 (...) @destroy_evolution_state()
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Fri "
         "Jun 21 14:05:20 IST 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 "
         "USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 "
         "USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Fri Jun 21 14:05:20 IST 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Fri Jun 21 14:05:20 IST 2013 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct central {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_central(struct central *cen) { free_object(8, (short *)cen); }


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

x86 assembly (clang, -O2):
<free_central>:
mov    %rdi,%rsi
mov    $0x8,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.central = type { i32 }
define void @free_central(%struct.central* %0) {
%2 = alloca %struct.central*
store %struct.central* %0, %struct.central** %2
%3 = load %struct.central*, %struct.central** %2
%4 = bitcast %struct.central* %3 to i16*
%5 = call i32 @free_object(i32 8, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.central = type { i32 }
define void @free_central(%struct.central* %0) {
%2 = bitcast %struct.central* %0 to i16*
%3 = tail call i32 @free_object(i32 8, i16* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void RTE_BUDDY_BUG(char *f, int line) {
  printf("BUDDY_BUG in %s, %d.\n", f, line);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"BUDDY_BUG in %s, %d.\0A\00"
define void @RTE_BUDDY_BUG(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"BUDDY_BUG in %s, %d.\0A\00"
define void @RTE_BUDDY_BUG(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
char *skip_nul(const char *s) {
  char *str;
  str = (char *)s;
  while (*str == '0')
    str++;
  return (str);
}


x86 assembly (clang, -O0):
<skip_nul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1131 <skip_nul+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <skip_nul+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @skip_nul(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 48
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
int checkleap(unsigned long year) {
  if (year % 400 == 0)
    return 1;
  else if (year % 100 == 0)
    return 0;
  else if (year % 4 == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkleap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x190,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    112c <checkleap+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1175 <checkleap+0x75>
mov    -0x10(%rbp),%rax
mov    $0x64,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    1150 <checkleap+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1175 <checkleap+0x75>
mov    -0x10(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
jne    116e <checkleap+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <checkleap+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkleap>:
movabs $0x8f5c28f5c28f5c29,%rax
28 5c 8f
imul   %rdi,%rax
mov    %rax,%rcx
ror    $0x4,%rcx
movabs $0xa3d70a3d70a3d8,%rdx
cmp    %rdx,%rcx
jb     1141 <checkleap+0x41>
ror    $0x2,%rax
movabs $0x28f5c28f5c28f5d,%rcx
5c 8f 02
cmp    %rcx,%rax
jb     1147 <checkleap+0x47>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @checkleap(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = urem i64 %4, 400
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %19
8: ; preds = %1
%9 = load i64, i64* %3
%10 = urem i64 %9, 100
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i64, i64* %3
%15 = urem i64 %14, 4
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %19
18: ; preds = %13
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @checkleap(i64 %0) {
%2 = urem i64 %0, 400
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = urem i64 %0, 100
%6 = icmp eq i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i64 %0, 3
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
f() {
  struct A {
    int i, j;
  } a = {};
  if (a.i != 0 || a.j != 0)
    abort();
  struct A b = {1, 2, 3};
  if (b.i != 1 || b.j != 2)
    abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
cmpl   $0x0,-0x10(%rbp)
jne    114c <f+0x2c>
cmpl   $0x0,-0xc(%rbp)
je     1153 <f+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    0xea6(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1172 <f+0x52>
cmpl   $0x2,-0x14(%rbp)
je     1179 <f+0x59>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32, i32 }
@__const.f.b = %struct.A { i32 1, i32 2 }
define i32 @f() {
%1 = alloca i32
%2 = alloca %struct.A
%3 = alloca %struct.A
%4 = bitcast %struct.A* %2 to i8*
%5 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %0
%9 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 1
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8, %0
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8
%15 = bitcast %struct.A* %3 to i8*
%16 = getelementptr inbounds %struct.A, %struct.A* %3, i32 0, i32 0
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 1
br i1 %18, label %23, label %19
19: ; preds = %14
%20 = getelementptr inbounds %struct.A, %struct.A* %3, i32 0, i32 1
%21 = load i32, i32* %20
%22 = icmp ne i32 %21, 2
br i1 %22, label %23, label %25
23: ; preds = %19, %14
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %19
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Variables and functions */
unsigned int strlen(char *);
char tolower(char);
char *lowercase(char *str) {
  unsigned int i;
  for (i = 0; i < strlen(str); ++i)
    str[i] = tolower(str[i]);
  return str;
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    1179 <lowercase+0x59>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <lowercase+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
je     1161 <lowercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jb     1140 <lowercase+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @lowercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp ult i32 %5, %7
br i1 %8, label %9, label %23
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call signext i8 @tolower(i8 signext %14)
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @lowercase(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = zext i32 %10 to i64
%12 = icmp ult i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
uint32_t CRCResultRead(uint32_t ui32Base, bool bPPResult) {
  ;
  if (bPPResult) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000418))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000410))));
  }
}


x86 assembly (clang, -O0):
<CRCResultRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1129 <CRCResultRead+0x29>
mov    -0x10(%rbp),%rax
mov    0x418(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <CRCResultRead+0x38>
mov    -0x10(%rbp),%rax
mov    0x410(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRCResultRead>:
mov    %rdi,-0x8(%rsp)
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    -0x8(%rsp),%rcx
mov    0x410(%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
define i64 @CRCResultRead(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store volatile i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load volatile i64, i64* %4
%10 = add nsw i64 %9, 1048
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
store i64 %12, i64* %3
br label %18
13: ; preds = %2
%14 = load volatile i64, i64* %4
%15 = add nsw i64 %14, 1040
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
store i64 %17, i64* %3
br label %18
18: ; preds = %13, %8
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @CRCResultRead(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = icmp eq i32 %1, 0
%5 = load volatile i64, i64* %3
%6 = select i1 %4, i64 1040, i64 1048
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ crc64_big_init();
int /*<<< orphan*/ crc64_little_init();
void crc64_init_once(void) {
  crc64_little_init();
  crc64_big_init();
}


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

x86 assembly (clang, -O2):
<crc64_init_once>:
push   %rax
xor    %eax,%eax
call   1030 <crc64_little_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <crc64_big_init@plt>

LLVM IR (-O0):
define void @crc64_init_once() {
%1 = call i32 (...) @crc64_little_init()
%2 = call i32 (...) @crc64_big_init()
ret void
}

LLVM IR (-O2):
define void @crc64_init_once() {
%1 = tail call i32 (...) @crc64_little_init()
%2 = tail call i32 (...) @crc64_big_init()
ret void
}
void null_debug_directive(const char *directive, const char *params) {
  (void)directive;
  (void)params;
}


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

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

LLVM IR (-O0):
define void @null_debug_directive(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 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
define void @null_debug_directive(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int main() {
  int i, j;
  i = 5;
  j = 6;
  return i + j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 11
}
/* Type definitions */
struct mibinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void const *, size_t);
int string_format(struct mibinfo *m, const void *data, size_t data_size,
                  char *buf, size_t len) {
  if (data_size < len)
    len = data_size;
  memcpy(buf, data, data_size);
  buf[data_size] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<string_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1142 <string_format+0x32>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_format>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rcx,%rdi
call   1030 <memcpy@plt>
movb   $0x0,(%r14,%rbx,1)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.mibinfo = type { i32 }
define i32 @string_format(%struct.mibinfo* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca %struct.mibinfo*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store %struct.mibinfo* %0, %struct.mibinfo** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i64, i64* %8
%12 = load i64, i64* %10
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %5
%15 = load i64, i64* %8
store i64 %15, i64* %10
br label %16
16: ; preds = %14, %5
%17 = load i8*, i8** %9
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
%21 = load i8*, i8** %9
%22 = load i64, i64* %8
%23 = getelementptr inbounds i8, i8* %21, i64 %22
store i8 0, i8* %23
ret i32 0
}

LLVM IR (-O2):
%struct.mibinfo = type { i32 }
define i32 @string_format(%struct.mibinfo* nocapture readnone %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i32 @memcpy(i8* %3, i8* %1, i64 %2)
%7 = getelementptr inbounds i8, i8* %3, i64 %2
store i8 0, i8* %7
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_short;

/* Variables and functions */
int /*<<< orphan*/ ip_check_ext(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
u_short ip_compute_csum(u_short *addr, int len) {
  return ip_check_ext(addr, len, 0);
}


x86 assembly (clang, -O0):
<ip_compute_csum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <ip_check_ext@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_compute_csum>:
xor    %edx,%edx
jmp    1030 <ip_check_ext@plt>

LLVM IR (-O0):
define i32 @ip_compute_csum(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 @ip_check_ext(i32* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ip_compute_csum(i32* %0, i32 %1) {
%3 = tail call i32 @ip_check_ext(i32* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int do_chirp_acl_check(char const *, char const *, int, int);
int chirp_acl_check(const char *filename, const char *subject, int flags) {
  return do_chirp_acl_check(filename, subject, flags, 1);
}


x86 assembly (clang, -O0):
<chirp_acl_check>:
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
mov    $0x1,%ecx
call   1030 <do_chirp_acl_check@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_acl_check>:
mov    $0x1,%ecx
jmp    1030 <do_chirp_acl_check@plt>

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

LLVM IR (-O2):
define i32 @chirp_acl_check(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @do_chirp_acl_check(i8* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
void xor (char *x, char *y) {
  if (x != y) {
    *x ^= *y;
    *y ^= *x;
    *x ^= *y;
  }
}


x86 assembly (clang, -O0):
<xor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1150 <xor+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor>:
cmp    %rsi,%rdi
je     1111 <xor+0x11>
mov    (%rdi),%al
xor    (%rsi),%al
mov    %al,(%rdi)
xor    (%rsi),%al
mov    %al,(%rsi)
xor    %al,(%rdi)
ret

LLVM IR (-O0):
define void @xor(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 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
br i1 %7, label %8, label %33
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = xor i32 %14, %11
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
%17 = load i8*, i8** %3
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = xor i32 %22, %19
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = load i8*, i8** %3
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = xor i32 %30, %27
%32 = trunc i32 %31 to i8
store i8 %32, i8* %28
br label %33
33: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @xor(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = load i8, i8* %0
%7 = xor i8 %6, %5
store i8 %7, i8* %0
%8 = load i8, i8* %1
%9 = xor i8 %8, %7
store i8 %9, i8* %1
%10 = load i8, i8* %0
%11 = xor i8 %10, %9
store i8 %11, i8* %0
br label %12
12: ; preds = %4, %2
ret void
}
__attribute__((visibility("default"))) int
httplib_atomic_inc(volatile int *addr) {
  return __sync_add_and_fetch(addr, 1);
}


x86 assembly (clang, -O0):
<httplib_atomic_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
lock xadd %eax,(%rcx)
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<httplib_atomic_inc>:
mov    $0x1,%eax
lock xadd %eax,(%rdi)
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @httplib_atomic_inc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = atomicrmw add i32* %3, i32 1 seq_cst
%5 = add i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @httplib_atomic_inc(i32* nocapture %0) {
%2 = atomicrmw add i32* %0, i32 1 seq_cst
%3 = add i32 %2, 1
ret i32 %3
}
/* Variables and functions */
void tft_invert(bool invert) { (void)invert; }


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

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

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

LLVM IR (-O2):
define void @tft_invert(i32 %0) {
ret void
}
void linnea_cb_server_started_listening(struct state *state) {}


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

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

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

LLVM IR (-O2):
%struct.state = type opaque
define void @linnea_cb_server_started_listening(%struct.state* nocapture %0) {
ret void
}
int f0(int x, int y) {
  asm volatile("" : : : "memory");
  return x + y;
}


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

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

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

LLVM IR (-O2):
define i32 @f0(i32 %0, i32 %1) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%3 = add nsw i32 %1, %0
ret i32 %3
}
void custom_timeout_handling(struct event_base *base, struct timeval *tv) {}


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

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

LLVM IR (-O0):
%struct.event_base = type opaque
%struct.timeval = type opaque
define void @custom_timeout_handling(%struct.event_base* %0, %struct.timeval* %1) {
%3 = alloca %struct.event_base*
%4 = alloca %struct.timeval*
store %struct.event_base* %0, %struct.event_base** %3
store %struct.timeval* %1, %struct.timeval** %4
ret void
}

LLVM IR (-O2):
%struct.event_base = type opaque
%struct.timeval = type opaque
define void @custom_timeout_handling(%struct.event_base* nocapture %0, %struct.timeval* nocapture %1) {
ret void
}
void g(int *x, int y) {
  if (y > 0) {
    g(x, y - 1);
    *x = *x + 2;
  } else
    *x = *x + 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114c <g+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <g@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
jmp    115b <g+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
jle    112a <g+0x1a>
add    $0xffffffff,%esi
mov    %rbx,%rdi
call   1030 <g@plt>
mov    $0x2,%eax
jmp    112f <g+0x1f>
mov    $0x1,%eax
add    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @g(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = add nsw i32 %1, -1
tail call void @g(i32* %0, i32 %5)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 2, %4 ], [ 1, %2 ]
%8 = load i32, i32* %0
%9 = add nsw i32 %8, %7
store i32 %9, i32* %0
ret void
}
void g_cclosure_marshal_VOID__FLAGS() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__FLAGS() {
ret void
}
void ff_hevc_put_hevc_uni_qpel_h32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h32_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_close();
void net_abort(void) { net_close(); }


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

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

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

LLVM IR (-O2):
define void @net_abort() {
%1 = tail call i32 (...) @net_close()
ret void
}
void everytrace_init() {}


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

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

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

LLVM IR (-O2):
define void @everytrace_init() {
ret void
}
void XtInsertRawEventHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtInsertRawEventHandler() {
ret void
}
int IsHigherDegree(int first, int second) { return first > second; }


x86 assembly (clang, -O0):
<IsHigherDegree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsHigherDegree>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @IsHigherDegree(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @IsHigherDegree(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hook(char *);
void shutdown(void) { hook("shutdown() called inside all-good."); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"shutdown() called inside all-good.\00"
define void @shutdown() {
%1 = call i32 @hook(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"shutdown() called inside all-good.\00"
define void @shutdown() {
%1 = tail call i32 @hook(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
int ft_ispos(long n) {
  if (n >= 0)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_ispos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     111f <ft_ispos+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <ft_ispos+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ispos>:
mov    %rdi,%rax
shr    $0x3f,%rax
xor    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_ispos(i64 %0) {
%2 = lshr i64 %0, 63
%3 = trunc i64 %2 to i32
%4 = xor i32 %3, 1
ret i32 %4
}
void terminate_queue(void) {
  ;
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @terminate_queue() {
ret void
}
extern unsigned short get_fs_word(const unsigned short *addr) {
  unsigned short _v;
  __asm__("movw %%fs:%1,%0" : "=r"(_v) : "m"(*addr));
  return _v;
}


x86 assembly (clang, -O0):
<get_fs_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %fs:(%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs_word>:
mov    %fs:(%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @get_fs_word(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = call i16 asm "movw %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @get_fs_word(i16* %0) {
%2 = tail call i16 asm "movw %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %0)
ret i16 %2
}
sgr(ps) char *ps;
{ brcstr(ps, 'm'); }


x86 assembly (clang, -O0):
<sgr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x6d,%esi
mov    $0x0,%al
call   1030 <brcstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgr>:
mov    $0x6d,%esi
xor    %eax,%eax
jmp    1030 <brcstr@plt>

LLVM IR (-O0):
define i32 @sgr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @brcstr to i32 (i8*, i32, ...)*)(i8* %4, i32 109)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @sgr(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @brcstr to i32 (i8*, i32, ...)*)(i8* %0, i32 109)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sleep_forever() {
  int a = 0;
  while (1) {
    usleep(1000);
    a++;
    a++;
  }
}


x86 assembly (clang, -O0):
<sleep_forever>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
call   1030 <usleep@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    111f <sleep_forever+0xf>

x86 assembly (clang, -O2):
<sleep_forever>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <usleep@plt>
jmp    1120 <sleep_forever+0x10>

LLVM IR (-O0):
define void @sleep_forever() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @usleep(i32 1000)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %2
}

LLVM IR (-O2):
define void @sleep_forever() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @usleep(i32 1000)
br label %1
}
void _backlight_on(void) { (*(volatile unsigned long *)0x80000330) |= 0x10; }


x86 assembly (clang, -O0):
<_backlight_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000330,%eax
mov    (%rax),%rcx
or     $0x10,%rcx
mov    $0x80000330,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_backlight_on>:
mov    $0x80000330,%eax
orq    $0x10,(%rax)
ret

LLVM IR (-O0):
define void @_backlight_on() {
%1 = load volatile i64, i64* inttoptr (i64 2147484464 to i64*)
%2 = or i64 %1, 16
store volatile i64 %2, i64* inttoptr (i64 2147484464 to i64*)
ret void
}

LLVM IR (-O2):
define void @_backlight_on() {
%1 = load volatile i64, i64* inttoptr (i64 2147484464 to i64*)
%2 = or i64 %1, 16
store volatile i64 %2, i64* inttoptr (i64 2147484464 to i64*)
ret void
}