xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
mode_t get_mode(const char *path) {
  struct stat st;
  if (stat(path, &st) == 0)
    return st.st_mode;
  return 0;
}


x86 assembly (clang, -O0):
<get_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113e <get_mode+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <get_mode+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mode>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <get_mode+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_mode(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_mode(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
char const *vp_file_close(char *);
const char *vp_pipe_close(char *args) { return vp_file_close(args); }


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

x86 assembly (clang, -O2):
<vp_pipe_close>:
jmp    1030 <vp_file_close@plt>

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

LLVM IR (-O2):
define i8* @vp_pipe_close(i8* %0) {
%2 = tail call i8* @vp_file_close(i8* %0)
ret i8* %2
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *prv_memcpy(void *dest, const void *src, size_t n) {
  return memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<prv_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @prv_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
const char *uv_version_string(void) {
  return "0"
         "."
         "10"
         "."
         "3";
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"0.10.3\00"
define i8* @uv_version_string() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int english_compare_natural(char *, char *);
int compare_strings(const void *l, const void *r) {
  return english_compare_natural(*((char **)l), *((char **)r));
}


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

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

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

LLVM IR (-O2):
define i32 @compare_strings(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @english_compare_natural(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, ...);
int main(void) {
  int f = 4;
  int g = 5;
  float h = 5.0f;
  printf("%d\n", f, g);
  printf("%d %d\n", f);
  printf("%d %d\n", h, g);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
mov    -0xc(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef3(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rbx
mov    %rbx,%rdi
movss  0xec2(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xeb7(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 4, i32* %2
store i32 5, i32* %3
store float 5.000000e+00, float* %4
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to float
%7 = load i32, i32* %3
%8 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6, i32 %7)
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to float
%11 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %10)
%12 = load float, float* %4
%13 = load i32, i32* %3
%14 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 4.000000e+00, i32 5)
%2 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float 4.000000e+00)
%3 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float 5.000000e+00, i32 5)
ret i32 0
}
/* Type definitions */
struct slaveControlBlock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eFree(struct slaveControlBlock *);
extern void freeSlaveControlBlock(struct slaveControlBlock *cb) { eFree(cb); }


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

x86 assembly (clang, -O2):
<freeSlaveControlBlock>:
jmp    1030 <eFree@plt>

LLVM IR (-O0):
%struct.slaveControlBlock = type { i32 }
define void @freeSlaveControlBlock(%struct.slaveControlBlock* %0) {
%2 = alloca %struct.slaveControlBlock*
store %struct.slaveControlBlock* %0, %struct.slaveControlBlock** %2
%3 = load %struct.slaveControlBlock*, %struct.slaveControlBlock** %2
%4 = call i32 @eFree(%struct.slaveControlBlock* %3)
ret void
}

LLVM IR (-O2):
%struct.slaveControlBlock = type { i32 }
define void @freeSlaveControlBlock(%struct.slaveControlBlock* %0) {
%2 = tail call i32 @eFree(%struct.slaveControlBlock* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int main() {
  alarm(1);
  return 0;
}


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

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

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

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

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, long);
void forf_proc_sub(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b - a);
}


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

x86 assembly (clang, -O2):
<forf_proc_sub>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <forf_pop_num@plt>
sub    %r14,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_sub(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = sub nsw i64 %10, %11
%13 = call i32 @forf_push_num(%struct.forf_env* %9, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_sub(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = sub nsw i64 %3, %2
%5 = tail call i32 @forf_push_num(%struct.forf_env* %0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsr(char *, unsigned int);
void wsr_2(unsigned v) { __builtin_arm_wsr("0:1:2:3:4", v); }


x86 assembly (clang, -O0):
<wsr_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <__builtin_arm_wsr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsr_2>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <__builtin_arm_wsr@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"0:1:2:3:4\00"
define void @wsr_2(i32 %0) {
%2 = tail call i32 @__builtin_arm_wsr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void HSMMCSDSystemConfig(unsigned int baseAddr, unsigned int config) {
  (*((volatile unsigned int *)(baseAddr + (0x110)))) &=
      ~((0x00003000u) | (0x00000300u) | (0x00000018u) | (0x00000004u) |
        (0x00000001u));
  (*((volatile unsigned int *)(baseAddr + (0x110)))) |= config;
}


x86 assembly (clang, -O0):
<HSMMCSDSystemConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffcce2,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x110,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDSystemConfig>:
add    $0x110,%edi
andl   $0xffffcce2,(%rdi)
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @HSMMCSDSystemConfig(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 = add i32 %5, 272
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -13086
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add i32 %12, 272
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = or i32 %16, %11
store volatile i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @HSMMCSDSystemConfig(i32 %0, i32 %1) {
%3 = add i32 %0, 272
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -13086
store volatile i32 %7, i32* %5
%8 = load volatile i32, i32* %5
%9 = or i32 %8, %1
store volatile i32 %9, i32* %5
ret void
}
void gator_event_sampling_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @gator_event_sampling_stop() {
ret void
}
/* Variables and functions */
int fun(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d\n", fun(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <fun@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fun(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int condition_asterisk(char c) { return c == '*'; }


x86 assembly (clang, -O0):
<condition_asterisk>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_asterisk>:
xor    %eax,%eax
cmp    $0x2a,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_asterisk(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 42
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_asterisk(i8 signext %0) {
%2 = icmp eq i8 %0, 42
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ rterror(int);
void *SafeMalloc(long size) {
  void *ptr;
  ptr = malloc(size);
  if (!ptr)
    rterror(33);
  return ptr;
}


x86 assembly (clang, -O0):
<SafeMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <SafeMalloc+0x2e>
mov    $0x21,%edi
call   1030 <rterror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeMalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1138 <SafeMalloc+0x18>
mov    $0x21,%edi
call   1030 <rterror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @SafeMalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @rterror(i32 33)
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @SafeMalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @rterror(i32 33)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ cc32xx_binary_file_delete(char *);
void ext_configuration_delete(void) {
  cc32xx_binary_file_delete("kaa_configuration.bin");
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = call i32 @cc32xx_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = tail call i32 @cc32xx_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double floor(double);
unsigned int roundui(double val) {
  double base = floor(val);
  return (unsigned int)((val - base) < 0.5 ? base : base + 1);
}


x86 assembly (clang, -O0):
<roundui>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xec2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1157 <roundui+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1169 <roundui+0x59>
movsd  0xea9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundui>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
call   1030 <floor@plt>
movapd (%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0xed1(%rip),%xmm1
addsd  %xmm0,%xmm1
cmpltsd 0xecc(%rip),%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm0,%xmm2
cvttsd2si %xmm2,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @roundui(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.floor.f64(double %4)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = fcmp olt double %8, 5.000000e-01
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load double, double* %3
br label %15
12: ; preds = %1
%13 = load double, double* %3
%14 = fadd double %13, 1.000000e+00
br label %15
15: ; preds = %12, %10
%16 = phi double [ %11, %10 ], [ %14, %12 ]
%17 = fptoui double %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @roundui(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
%4 = fcmp olt double %3, 5.000000e-01
%5 = fadd double %2, 1.000000e+00
%6 = select i1 %4, double %2, double %5
%7 = fptoui double %6 to i32
ret i32 %7
}
/* Variables and functions */
void Reserved_Handler6(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Reserved_Handler6() {
br label %1
1: ; preds = %0, %1
br label %1
}
void reset(int array[], int len) {
  for (len--; len >= 0; len--) {
    array[len] = 0;
  }
}


x86 assembly (clang, -O0):
<reset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113b <reset+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <reset+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset>:
test   %esi,%esi
jle    1126 <reset+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @reset(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 = add nsw i32 %5, -1
store i32 %6, i32* %4
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %4
%17 = add nsw i32 %16, -1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @reset(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
typedef int src;

/* Variables and functions */
void cpy_net16(uint16_t src, uint16_t *dst) {
  uint8_t *d = (uint8_t *)dst;
  d[1] = (src)&0xFF;
  d[0] = (src >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<cpy_net16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy_net16>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,0x4(%rsi)
movzbl %ah,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @cpy_net16(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
store i32* %6, i32** %5
%7 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 1
store i32 %8, i32* %10
%11 = load i32, i32* %3
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
define void @cpy_net16(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
%4 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %3, i32* %4
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
char *DVBGenreCode(unsigned char);
char *dvb_genre_string(unsigned char code) { return DVBGenreCode(code); }


x86 assembly (clang, -O0):
<dvb_genre_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <DVBGenreCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvb_genre_string>:
jmp    1030 <DVBGenreCode@plt>

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

LLVM IR (-O2):
define i8* @dvb_genre_string(i8 zeroext %0) {
%2 = tail call i8* @DVBGenreCode(i8 zeroext %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void podpunkt_b(int x) {
  int y, z;
  printf("\nSprawdzenie_2, Sprawdzenie_3:\n");
  y = (x += 2);
  z = (x %= 3) + (x %= 4);
  printf("x=%d, y=%d, z=%d\n", x, y, z);
}


x86 assembly (clang, -O0):
<podpunkt_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x10(%rbp),%edx
mov    %eax,-0x4(%rbp)
add    %eax,%edx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<podpunkt_b>:
push   %rbx
mov    %edi,%ebx
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
add    $0x2,%ebx
movslq %ebx,%rdx
imul   $0x55555556,%rdx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
mov    %edx,%esi
sub    %eax,%esi
lea    (%rsi,%rsi,1),%ecx
lea    0xea6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0ASprawdzenie_2, Sprawdzenie_3:\0A\00"
@.str.1 = [18 x i8] c"x=%d, y=%d, z=%d\0A\00"
define void @podpunkt_b(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 2
store i32 %7, i32* %2
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = srem i32 %8, 3
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = srem i32 %10, 4
store i32 %11, i32* %2
%12 = add nsw i32 %9, %11
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"x=%d, y=%d, z=%d\0A\00"
@str = [31 x i8] c"\0ASprawdzenie_2, Sprawdzenie_3:\00"
define void @podpunkt_b(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = add nsw i32 %0, 2
%4 = srem i32 %3, 3
%5 = shl nsw i32 %4, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ htableClear(void *);
void htableClearInterface(void *table) { htableClear(table); }


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

x86 assembly (clang, -O2):
<htableClearInterface>:
jmp    1030 <htableClear@plt>

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

LLVM IR (-O2):
define void @htableClearInterface(i8* %0) {
%2 = tail call i32 @htableClear(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void write_reg32(volatile uint32_t *reg, uint32_t val) {
  (*((volatile uint32_t *)(reg))) = val;
}


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

x86 assembly (clang, -O2):
<write_reg32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write_reg32(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Variables and functions */
void glmDiv3fv_(float x[3], const float y[3]) {
  for (size_t i = 0; i < 3; ++i)
    x[i] /= y[i];
}


x86 assembly (clang, -O0):
<glmDiv3fv_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1153 <glmDiv3fv_+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <glmDiv3fv_+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDiv3fv_>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
divss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
divss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
divss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmDiv3fv_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %19, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = load float*, float** %3
%15 = load i64, i64* %5
%16 = getelementptr inbounds float, float* %14, i64 %15
%17 = load float, float* %16
%18 = fdiv float %17, %13
store float %18, float* %16
br label %19
19: ; preds = %9
%20 = load i64, i64* %5
%21 = add i64 %20, 1
store i64 %21, i64* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmDiv3fv_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fdiv float %4, %3
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fdiv float %9, %7
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fdiv float %14, %12
store float %15, float* %13
ret void
}
char *attr_string(str)
char *str;
{ return str; }


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

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

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

LLVM IR (-O2):
define i8* @attr_string(i8* readnone returned %0) {
ret i8* %0
}
int md_notify_reboot(struct notifier_block *this, unsigned long code, void *x) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.notifier_block = type opaque
define i32 @md_notify_reboot(%struct.notifier_block* %0, i64 %1, i8* %2) {
%4 = alloca %struct.notifier_block*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
store %struct.notifier_block* %0, %struct.notifier_block** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @md_notify_reboot(%struct.notifier_block* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ delay_x();
int /*<<< orphan*/ gic_check();
void gic_watch(void) {
  for (;;) {
    delay_x();
    delay_x();
    gic_check();
  }
}


x86 assembly (clang, -O0):
<gic_watch>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <gic_watch+0x9>
mov    $0x0,%al
call   1030 <delay_x@plt>
mov    $0x0,%al
call   1030 <delay_x@plt>
mov    $0x0,%al
call   1040 <gic_check@plt>
jmp    1129 <gic_watch+0x9>

x86 assembly (clang, -O2):
<gic_watch>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <delay_x@plt>
xor    %eax,%eax
call   1030 <delay_x@plt>
xor    %eax,%eax
call   1040 <gic_check@plt>
jmp    1130 <gic_watch+0x10>

LLVM IR (-O0):
define void @gic_watch() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @delay_x()
%3 = call i32 (...) @delay_x()
%4 = call i32 (...) @gic_check()
br label %1
}

LLVM IR (-O2):
define void @gic_watch() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @delay_x()
%3 = tail call i32 (...) @delay_x()
%4 = tail call i32 (...) @gic_check()
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int islower(int /*<<< orphan*/);
int iswlower(wint_t c) { return islower(c); }


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

x86 assembly (clang, -O2):
<iswlower>:
jmp    1030 <islower@plt>

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

LLVM IR (-O2):
define i32 @iswlower(i32 %0) {
%2 = tail call i32 @islower(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void verify(int testcase) {
  if (testcase) {
    puts("  Pass.");
  } else {
    puts("  Fail!");
  }
}


x86 assembly (clang, -O0):
<verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <verify+0x26>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
jmp    1142 <verify+0x32>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify>:
test   %edi,%edi
lea    0xeef(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" Pass.\00"
@.str.1 = [8 x i8] c" Fail!\00"
define void @verify(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" Pass.\00"
@.str.1 = [8 x i8] c" Fail!\00"
define void @verify(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
int main(int argc __attribute__((__unused__)),
         char *argv[] __attribute__((__unused__))) {
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bufcat(struct html *, char const *);
void bufcat_style(struct html *h, const char *key, const char *val) {
  bufcat(h, key);
  bufcat(h, ":");
  bufcat(h, val);
  bufcat(h, ";");
}


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

x86 assembly (clang, -O2):
<bufcat_style>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <bufcat@plt>
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <bufcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <bufcat@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <bufcat@plt>

LLVM IR (-O0):
%struct.html = type { i32 }
@.str = [2 x i8] c":\00"
@.str.1 = [2 x i8] c";\00"
define void @bufcat_style(%struct.html* %0, i8* %1, i8* %2) {
%4 = alloca %struct.html*
%5 = alloca i8*
%6 = alloca i8*
store %struct.html* %0, %struct.html** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.html*, %struct.html** %4
%8 = load i8*, i8** %5
%9 = call i32 @bufcat(%struct.html* %7, i8* %8)
%10 = load %struct.html*, %struct.html** %4
%11 = call i32 @bufcat(%struct.html* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load %struct.html*, %struct.html** %4
%13 = load i8*, i8** %6
%14 = call i32 @bufcat(%struct.html* %12, i8* %13)
%15 = load %struct.html*, %struct.html** %4
%16 = call i32 @bufcat(%struct.html* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.html = type { i32 }
@.str = [2 x i8] c":\00"
@.str.1 = [2 x i8] c";\00"
define void @bufcat_style(%struct.html* %0, i8* %1, i8* %2) {
%4 = tail call i32 @bufcat(%struct.html* %0, i8* %1)
%5 = tail call i32 @bufcat(%struct.html* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @bufcat(%struct.html* %0, i8* %2)
%7 = tail call i32 @bufcat(%struct.html* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void SocketStartUp(void) {}


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

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

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

LLVM IR (-O2):
define void @SocketStartUp() {
ret void
}
const char *vde_chain_nm2_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  case 2:
    return "o2";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<vde_chain_nm2_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <vde_chain_nm2_name_out+0x3c>
jmp    111a <vde_chain_nm2_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <vde_chain_nm2_name_out+0x4c>
jmp    112b <vde_chain_nm2_name_out+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <vde_chain_nm2_name_out+0x5c>
jmp    116c <vde_chain_nm2_name_out+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm2_name_out+0x74>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm2_name_out+0x74>
lea    0xea3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1174 <vde_chain_nm2_name_out+0x74>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm2_name_out>:
cmp    $0x2,%edi
ja     1117 <vde_chain_nm2_name_out+0x17>
movslq %edi,%rax
lea    0xefd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
@.str.2 = [3 x i8] c"o2\00"
define i8* @vde_chain_nm2_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
@.str.2 = [3 x i8] c"o2\00"
@reltable.vde_chain_nm2_name_out = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.vde_chain_nm2_name_out to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.vde_chain_nm2_name_out to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.vde_chain_nm2_name_out to i64)) to i32)]
define i8* @vde_chain_nm2_name_out(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.vde_chain_nm2_name_out to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
__attribute__((always_)) void debug_show_held_locks(struct task_struct *task) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @debug_show_held_locks(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ load_snapshot_file_type(char *, int);
int /*<<< orphan*/ put_msg(char *);
char *spif_get_filename();
void load_snapshot(void) {
  char *name;
  put_msg("Enter name of snapshot file to load:");
  name = spif_get_filename();
  if (name == NULL)
    return;
  load_snapshot_file_type(name, -1);
}


x86 assembly (clang, -O0):
<load_snapshot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <put_msg@plt>
mov    $0x0,%al
call   1030 <spif_get_filename@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115f <load_snapshot+0x2f>
jmp    116d <load_snapshot+0x3d>
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1040 <load_snapshot_file_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_snapshot>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <put_msg@plt>
xor    %eax,%eax
call   1030 <spif_get_filename@plt>
test   %rax,%rax
je     1157 <load_snapshot+0x27>
mov    %rax,%rdi
mov    $0xffffffff,%esi
pop    %rax
jmp    1040 <load_snapshot_file_type@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Enter name of snapshot file to load:\00"
define void @load_snapshot() {
%1 = alloca i8*
%2 = call i32 @put_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i8* (...) @spif_get_filename()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
br label %10
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = call i32 @load_snapshot_file_type(i8* %8, i32 -1)
br label %10
10: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Enter name of snapshot file to load:\00"
define void @load_snapshot() {
%1 = tail call i32 @put_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @spif_get_filename()
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @load_snapshot_file_type(i8* %2, i32 -1)
br label %6
6: ; preds = %0, %4
ret void
}
void __board_deassert_mem_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @__board_deassert_mem_reset() {
ret void
}
int ctoi(char ch) {
  if (ch >= '0' && ch <= '9') {
    return (int)(ch - '0');
  }
  return 0;
}


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <ctoi+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <ctoi+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <ctoi+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoi>:
lea    -0x30(%rdi),%ecx
lea    -0x30(%rdi),%edx
xor    %eax,%eax
cmp    $0xa,%cl
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @ctoi(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %16
15: ; preds = %7, %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ctoi(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}