xunge/DecIR huggingface dataset:
/* Variables and functions */
float asin(float);
float get(char *);
int /*<<< orphan*/ printf(char *, float);
void findAsin() {
  float num = get("Enter your number");
  float result = asin(num);
  printf("Result: %f", result);
}


x86 assembly (clang, -O0):
<findAsin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <get@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <asin@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAsin>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <get@plt>
call   1040 <asin@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAsin() {
%1 = alloca float
%2 = alloca float
%3 = call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store float %3, float* %1
%4 = load float, float* %1
%5 = call float @asin(float %4)
store float %5, float* %2
%6 = load float, float* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter your number\00"
@.str.1 = [11 x i8] c"Result: %f\00"
define void @findAsin() {
%1 = tail call float @get(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call float @asin(float %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ log_msg(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void log_msg_arg1(FILE *f, char *msg, int arg1) {
  char buf[128];
  sprintf(buf, msg, arg1);
  log_msg(f, buf);
}


x86 assembly (clang, -O0):
<log_msg_arg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1030 <log_msg@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_msg_arg1>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <log_msg@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @log_msg_arg1(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [128 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @sprintf(i8* %8, i8* %9, i32 %10)
%12 = load i32*, i32** %4
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%14 = call i32 @log_msg(i32* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @log_msg_arg1(i32* %0, i8* nocapture %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) %1, i32 %2)
%7 = call i32 @log_msg(i32* %0, i8* %5)
ret void
}
int kgsl_process_init_debugfs(struct kgsl_process_private *pri) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.kgsl_process_private = type opaque
define i32 @kgsl_process_init_debugfs(%struct.kgsl_process_private* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int getpid();
int /*<<< orphan*/ printf(char *, int);
void main() {
  printf("Hello from the program exec with PID: %d\n", getpid());
  execl("exec2", "", NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0xed2(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0xed5(%rip),%rsi
xor    %edx,%edx
pop    %rax
jmp    1050 <execl@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Hello from the program exec with PID: %d\0A\00"
@.str.1 = [6 x i8] c"exec2\00"
@.str.2 = [1 x i8] zeroinitializer
define void @main() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @execl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"Hello from the program exec with PID: %d\0A\00"
@.str.1 = [6 x i8] c"exec2\00"
@.str.2 = [1 x i8] zeroinitializer
define void @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @execl(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}
/* Type definitions */
struct beeversion {
  int dummy;
};

/* Variables and functions */
scalar_t__ compare_beepackages(struct beeversion *, struct beeversion *);
int compare_beepackages_gen(const void *a, const void *b) {
  return (
      (int)compare_beepackages((struct beeversion *)a, (struct beeversion *)b));
}


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

x86 assembly (clang, -O2):
<compare_beepackages_gen>:
jmp    1030 <compare_beepackages@plt>

LLVM IR (-O0):
%struct.beeversion = type { i32 }
define i32 @compare_beepackages_gen(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 %struct.beeversion*
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to %struct.beeversion*
%9 = call i64 @compare_beepackages(%struct.beeversion* %6, %struct.beeversion* %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.beeversion = type { i32 }
define i32 @compare_beepackages_gen(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.beeversion*
%4 = bitcast i8* %1 to %struct.beeversion*
%5 = tail call i64 @compare_beepackages(%struct.beeversion* %3, %struct.beeversion* %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void XtAugmentTranslations() {}


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

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

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

LLVM IR (-O2):
define void @XtAugmentTranslations() {
ret void
}
int initialize_light_sensor(struct ssp_data *data) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @initialize_light_sensor(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __explicit_bzero_hook(void *, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
__attribute__((optimize("O0"))) void explicit_bzero(void *buf, size_t len) {
  memset(buf, 0, len);
  __explicit_bzero_hook(buf, len);
}


x86 assembly (clang, -O0):
<explicit_bzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__explicit_bzero_hook@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explicit_bzero>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__explicit_bzero_hook@plt>

LLVM IR (-O0):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i32 0, i64 %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @__explicit_bzero_hook(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
%4 = tail call i32 @__explicit_bzero_hook(i8* %0, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ guitp(char *, int);
void g_dev_t() { guitp("dev_t", sizeof(dev_t)); }


x86 assembly (clang, -O0):
<g_dev_t>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <guitp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_dev_t>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <guitp@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"dev_t\00"
define void @g_dev_t() {
%1 = call i32 @guitp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"dev_t\00"
define void @g_dev_t() {
%1 = tail call i32 @guitp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matrix_get_translation(float *, float const, float const,
                                          float const);
int /*<<< orphan*/ matrix_multiply_ext(float const *, float *, float *);
float *matrix_translate_ext(const float matrix[4 * 4], const float x,
                            const float y, const float z,
                            float matrix_out[4 * 4]) {
  float matrix_tmp[4 * 4];
  matrix_get_translation(matrix_tmp, x, y, z);
  matrix_multiply_ext(matrix, matrix_tmp, matrix_out);
  return matrix_out;
}


x86 assembly (clang, -O0):
<matrix_translate_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <matrix_get_translation@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <matrix_multiply_ext@plt>
mov    -0x20(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_translate_ext>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <matrix_get_translation@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <matrix_multiply_ext@plt>
mov    %rbx,%rax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float* @matrix_translate_ext(float* %0, float %1, float %2, float %3, float* %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float*
%11 = alloca [16 x float]
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float* %4, float** %10
%12 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = call i32 @matrix_get_translation(float* %12, float %13, float %14, float %15)
%17 = load float*, float** %6
%18 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%19 = load float*, float** %10
%20 = call i32 @matrix_multiply_ext(float* %17, float* %18, float* %19)
%21 = load float*, float** %10
ret float* %21
}

LLVM IR (-O2):
define float* @matrix_translate_ext(float* %0, float %1, float %2, float %3, float* returned %4) {
%6 = alloca [16 x float]
%7 = bitcast [16 x float]* %6 to i8*
%8 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%9 = call i32 @matrix_get_translation(float* %8, float %1, float %2, float %3)
%10 = call i32 @matrix_multiply_ext(float* %0, float* %8, float* %4)
ret float* %4
}
int do_476() { return 476; }


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

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

LLVM IR (-O0):
define i32 @do_476() {
ret i32 476
}

LLVM IR (-O2):
define i32 @do_476() {
ret i32 476
}
int generate_random_number() { return 42; }


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

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

LLVM IR (-O0):
define i32 @generate_random_number() {
ret i32 42
}

LLVM IR (-O2):
define i32 @generate_random_number() {
ret i32 42
}
int test_02(volatile int *x, unsigned int y) { return x[y]; }


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

x86 assembly (clang, -O2):
<test_02>:
mov    %esi,%eax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @test_02(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 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load volatile i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_02(i32* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ ft_isalpha(int);
scalar_t__ ft_isdigit(int);
int ft_isalnum(int c) {
  if (ft_isdigit(c))
    return (1);
  else if (ft_isalpha(c))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x0,%rax
je     1149 <ft_isalnum+0x29>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isalnum+0x4e>
mov    -0x8(%rbp),%edi
call   1040 <ft_isalpha@plt>
cmp    $0x0,%rax
je     1167 <ft_isalnum+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isalnum+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isalnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <ft_isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @ft_isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i64 @ft_isalpha(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = tail call i64 @ft_isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ft_isalpha(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, int);
__attribute__((cold)) void my_cold_memset(void *a, int b, int c) {
  memset(a, b, c);
}


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

x86 assembly (clang, -O2):
<my_cold_memset>:
jmp    1030 <memset@plt>
cs nopw 0x0(%rax,%rax,1)
nop

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

LLVM IR (-O2):
define void @my_cold_memset(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fnDispArray(int X[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf(" %4d \n", X[i]);
}


x86 assembly (clang, -O0):
<fnDispArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <fnDispArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fnDispArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnDispArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <fnDispArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <fnDispArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c" %4d \0A\00"
define void @fnDispArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
float logf(float);
void sLog_process(float bIn, float *bOut) {
  *bOut = (bIn > 0.0f) ? logf(bIn) : 0.0f;
}


x86 assembly (clang, -O0):
<sLog_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1146 <sLog_process+0x36>
movss  -0x4(%rbp),%xmm0
call   1030 <logf@plt>
movss  %xmm0,-0x14(%rbp)
jmp    1153 <sLog_process+0x43>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1153 <sLog_process+0x43>
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sLog_process>:
push   %rbx
mov    %rdi,%rbx
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jbe    1127 <sLog_process+0x17>
movaps %xmm1,%xmm0
call   1030 <logf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sLog_process(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
%5 = load float, float* %3
%6 = fcmp ogt float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load float, float* %3
%9 = call float @logf(float %8)
br label %11
10: ; preds = %2
br label %11
11: ; preds = %10, %7
%12 = phi float [ %9, %7 ], [ 0.000000e+00, %10 ]
%13 = load float*, float** %4
store float %12, float* %13
ret void
}

LLVM IR (-O2):
define void @sLog_process(float %0, float* nocapture writeonly %1) {
%3 = fcmp ogt float %0, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call float @logf(float %0)
br label %6
6: ; preds = %2, %4
%7 = phi float [ %5, %4 ], [ 0.000000e+00, %2 ]
store float %7, float* %1
ret void
}
/* Variables and functions */
bool nrf53_errata_95(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_95() {
ret i32 0
}
/* Variables and functions */
int time(int /*<<< orphan*/ *);
int getSeed() { return time(NULL); }


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

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

LLVM IR (-O0):
define i32 @getSeed() {
%1 = call i32 @time(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getSeed() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
int ioctl(int __fd, unsigned long int __request, ...) {
  ;
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @ioctl(i32 %0, i64 %1, ...) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @ioctl(i32 %0, i64 %1, ...) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *src) {
  if (src == NULL) {
    return NULL;
  }
  char *dest = xmalloc(strlen(src) + sizeof(char));
  strcpy(dest, src);
  return dest;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <xstrdup+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <xstrdup+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <xstrdup+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add i64 %10, 1
%12 = call i8* @xmalloc(i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %8, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i8* @xmalloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_write() { printw("\n\rwrite command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0A\0Dwrite command\0A\0D\0A\0D\00"
define void @ion_cmd_write() {
%1 = call i32 @printw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0A\0Dwrite command\0A\0D\0A\0D\00"
define void @ion_cmd_write() {
%1 = tail call i32 @printw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _scanf_getl(char *, int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ safe_gets(char *, int);
unsigned getudec() {
  char buf[80];
  safe_gets(buf, 80);
  unsigned x = 0;
  _scanf_getl(buf, (int *)&x, 10, 80, 0);
  return x;
}


x86 assembly (clang, -O0):
<getudec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
mov    $0x50,%esi
call   1040 <safe_gets@plt>
movl   $0x0,-0x54(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x54(%rbp),%rsi
mov    $0xa,%edx
mov    $0x50,%ecx
xor    %r8d,%r8d
call   1030 <_scanf_getl@plt>
mov    -0x54(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getudec>:
push   %rbx
sub    $0x60,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <safe_gets@plt>
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
mov    $0x50,%ecx
xor    %r8d,%r8d
call   1030 <_scanf_getl@plt>
mov    0xc(%rsp),%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getudec() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @safe_gets(i8* %3, i32 80)
store i32 0, i32* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 @_scanf_getl(i8* %5, i32* %2, i32 10, i32 80, i32 0)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @getudec() {
%1 = alloca [80 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @safe_gets(i8* %3, i32 80)
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = call i32 @_scanf_getl(i8* %3, i32* %2, i32 10, i32 80, i32 0)
%7 = load i32, i32* %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void version(void) { puts("secril-database-extractor 1.0"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"secril-database-extractor 1.0\00"
define void @version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"secril-database-extractor 1.0\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned min(unsigned a, unsigned b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 ult i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ FAIL(char *);
int /*<<< orphan*/ PASS(char *);
scalar_t__ check_dylib_interposing();
int main() {
  if (check_dylib_interposing())
    PASS("interpose-basic");
  else
    FAIL("interpose-basic");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_dylib_interposing@plt>
cmp    $0x0,%rax
je     1161 <main+0x31>
lea    0xea9(%rip),%rdi
call   1040 <PASS@plt>
jmp    116d <main+0x3d>
lea    0xe98(%rip),%rdi
call   1050 <FAIL@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_dylib_interposing@plt>
lea    0xec1(%rip),%rdi
test   %rax,%rax
je     114b <main+0x1b>
call   1040 <PASS@plt>
jmp    1150 <main+0x20>
call   1050 <FAIL@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"interpose-basic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @check_dylib_interposing()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @PASS(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @FAIL(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [16 x i8] c"interpose-basic\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @check_dylib_interposing()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @PASS(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @FAIL(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
float atanf(float);
__attribute__((const)) float bark(float x) {
  return 13.1f * atanf(0.00074f * x) + 2.24f * atanf(0.0000000185f * (x * x)) +
         0.0001f * x;
}


x86 assembly (clang, -O0):
<bark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xeeb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <atanf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xec6(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <atanf@plt>
movss  -0x8(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  0xea9(%rip),%xmm0
mulss  %xmm2,%xmm0
movss  0xe99(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
movss  0xe80(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bark>:
push   %rax
movaps %xmm0,%xmm1
movss  %xmm0,(%rsp)
movss  0xedf(%rip),%xmm0
mulss  %xmm1,%xmm0
call   1030 <atanf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
mulss  %xmm0,%xmm0
mulss  0xec3(%rip),%xmm0
call   1030 <atanf@plt>
mulss  0xeba(%rip),%xmm0
movss  0x4(%rsp),%xmm1
mulss  0xeb0(%rip),%xmm1
addss  %xmm1,%xmm0
movss  (%rsp),%xmm1
mulss  0xea3(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @bark(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0x3F483F91E0000000, %3
%5 = call float @atanf(float %4)
%6 = load float, float* %2
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = fmul float 0x3E53DD3DC0000000, %8
%10 = call float @atanf(float %9)
%11 = fmul float 0x4001EB8520000000, %10
%12 = call float @llvm.fmuladd.f32(float 0x402A333340000000, float %5, float %11)
%13 = load float, float* %2
%14 = call float @llvm.fmuladd.f32(float 0x3F1A36E2E0000000, float %13, float %12)
ret float %14
}

LLVM IR (-O2):
define float @bark(float %0) {
%2 = fmul float %0, 0x3F483F91E0000000
%3 = tail call float @atanf(float %2)
%4 = fmul float %0, %0
%5 = fmul float %4, 0x3E53DD3DC0000000
%6 = tail call float @atanf(float %5)
%7 = fmul float %6, 0x4001EB8520000000
%8 = tail call float @llvm.fmuladd.f32(float %3, float 0x402A333340000000, float %7)
%9 = tail call float @llvm.fmuladd.f32(float %0, float 0x3F1A36E2E0000000, float %8)
ret float %9
}
/* Variables and functions */
char io_in8(int);
int /*<<< orphan*/ wait_8042();
char read_8042(void) {
  wait_8042();
  return io_in8(0x60);
}


x86 assembly (clang, -O0):
<read_8042>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wait_8042@plt>
mov    $0x60,%edi
call   1040 <io_in8@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_8042>:
push   %rax
xor    %eax,%eax
call   1030 <wait_8042@plt>
mov    $0x60,%edi
pop    %rax
jmp    1040 <io_in8@plt>

LLVM IR (-O0):
define signext i8 @read_8042() {
%1 = call i32 (...) @wait_8042()
%2 = call signext i8 @io_in8(i32 96)
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @read_8042() {
%1 = tail call i32 (...) @wait_8042()
%2 = tail call signext i8 @io_in8(i32 96)
ret i8 %2
}
/* Variables and functions */
int getnpar(int /*<<< orphan*/, char *, char *, unsigned short *);
int getparushort(char *name, unsigned short *ptr) {
  return getnpar(0, name, "u", ptr);
}


x86 assembly (clang, -O0):
<getparushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
xor    %edi,%edi
lea    0xecf(%rip),%rdx
call   1030 <getnpar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getparushort>:
mov    %rsi,%rcx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdx
xor    %edi,%edi
jmp    1030 <getnpar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"u\00"
define i32 @getparushort(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = load i16*, i16** %4
%7 = call i32 @getnpar(i32 0, i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i16* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"u\00"
define i32 @getparushort(i8* %0, i16* %1) {
%3 = tail call i32 @getnpar(i32 0, i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i16* %1)
ret i32 %3
}
void create_tilepro64() { return; }


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

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

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

LLVM IR (-O2):
define void @create_tilepro64() {
ret void
}
/* Variables and functions */
void *malloc(int);
void *gl_malloc(int size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @gl_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void waitmics(int musec) {
  struct timespec delay;
  delay.tv_sec = 0;
  delay.tv_nsec = musec * 1000L;
  if (nanosleep(&delay, NULL)) {
    perror("nanosleep");
  }
}


x86 assembly (clang, -O0):
<waitmics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x3e8,%rax,%rax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
je     1164 <waitmics+0x44>
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitmics>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
imul   $0x3e8,%edi,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
test   %rax,%rax
jne    114d <waitmics+0x2d>
add    $0x18,%rsp
ret
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@.str = [10 x i8] c"nanosleep\00"
define void @waitmics(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul nsw i64 %6, 1000
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = call i64 @nanosleep(%struct.timespec* %3, i32* null)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@.str = [10 x i8] c"nanosleep\00"
define void @waitmics(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = mul i32 %0, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %5, i32* %6
%7 = call i64 @nanosleep(%struct.timespec* %2, i32* null)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  write(1, "hello\n", 6);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Type definitions */
struct bookmark {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ psylbm_free_bookmark(struct bookmark *);
struct bookmark *psylbm_make_bookmark();
int make_bookmark_test(void) {
  struct bookmark *bookmark = psylbm_make_bookmark();
  psylbm_free_bookmark(bookmark);
  return 0;
}


x86 assembly (clang, -O0):
<make_bookmark_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <psylbm_make_bookmark@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <psylbm_free_bookmark@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_bookmark_test>:
push   %rax
xor    %eax,%eax
call   1040 <psylbm_make_bookmark@plt>
mov    %rax,%rdi
call   1030 <psylbm_free_bookmark@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bookmark = type { i32 }
define i32 @make_bookmark_test() {
%1 = alloca %struct.bookmark*
%2 = call %struct.bookmark* (...) @psylbm_make_bookmark()
store %struct.bookmark* %2, %struct.bookmark** %1
%3 = load %struct.bookmark*, %struct.bookmark** %1
%4 = call i32 @psylbm_free_bookmark(%struct.bookmark* %3)
ret i32 0
}

LLVM IR (-O2):
%struct.bookmark = type { i32 }
define i32 @make_bookmark_test() {
%1 = tail call %struct.bookmark* (...) @psylbm_make_bookmark()
%2 = tail call i32 @psylbm_free_bookmark(%struct.bookmark* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(size_t const);
int /*<<< orphan*/ memcpy(void *const, void const *const, size_t const);
void *cloneBytes(const void *const ptr, const size_t bytes) {
  assert(((ptr)) && "Unexpected null pointer.");
  ;
  void *const ret = malloc(bytes);
  if (!ret)
    return NULL;
  memcpy(ret, ptr, bytes);
  return ret;
}


x86 assembly (clang, -O0):
<cloneBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x21(%rbp)
je     115a <cloneBytes+0x2a>
mov    $0x1,%al
mov    %al,-0x21(%rbp)
jmp    115a <cloneBytes+0x2a>
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    118c <cloneBytes+0x5c>
movq   $0x0,-0x8(%rbp)
jmp    11a5 <cloneBytes+0x75>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cloneBytes>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
mov    %r14,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1167 <cloneBytes+0x37>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Unexpected null pointer.\00"
define i8* @cloneBytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %2
%11 = phi i1 [ false, %2 ], [ true, %9 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %5
%15 = call i8* @malloc(i64 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %10
store i8* null, i8** %3
br label %25
19: ; preds = %10
%20 = load i8*, i8** %6
%21 = load i8*, i8** %4
%22 = load i64, i64* %5
%23 = call i32 @memcpy(i8* %20, i8* %21, i64 %22)
%24 = load i8*, i8** %6
store i8* %24, i8** %3
br label %25
25: ; preds = %19, %18
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @cloneBytes(i8* %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i8* @malloc(i64 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %1)
br label %10
10: ; preds = %2, %8
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2CSlaveDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(0x40002000 + 0x00000004))) = 0x0;
  (*((volatile unsigned long
          *)(((unsigned long)(0x40002000 + 0x00000820) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40002000 + 0x00000820) & 0x000FFFFF) << 5) |
             ((5) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<I2CSlaveDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40002004,%eax
movq   $0x0,(%rax)
mov    $0x42050414,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveDisable>:
movq   $0x0,0x40002004
movq   $0x0,0x42050414
ret

LLVM IR (-O0):
define void @I2CSlaveDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i64 0, i64* inttoptr (i64 1073750020 to i64*)
store volatile i64 0, i64* inttoptr (i64 1107624980 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2CSlaveDisable(i32 %0) {
store volatile i64 0, i64* inttoptr (i64 1073750020 to i64*)
store volatile i64 0, i64* inttoptr (i64 1107624980 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ le32_to_cpu(int /*<<< orphan*/ const);
uint32_t le32_to_cpup(const uint32_t *p) { return le32_to_cpu(*p); }


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

x86 assembly (clang, -O2):
<le32_to_cpup>:
mov    (%rdi),%edi
jmp    1030 <le32_to_cpu@plt>

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

LLVM IR (-O2):
define i32 @le32_to_cpup(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @le32_to_cpu(i32 %2)
ret i32 %3
}
int label_init(void) {
  int r = 0;
  return r;
}


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

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

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

LLVM IR (-O2):
define i32 @label_init() {
ret i32 0
}
int greaterOf(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<greaterOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <greaterOf+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <greaterOf+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greaterOf>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @greaterOf(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
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @greaterOf(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}