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

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int posix_fallocate64(int fd, __off64_t offset, __off64_t len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<posix_fallocate64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_fallocate64>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @posix_fallocate64(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @posix_fallocate64(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
void swap(long **s, unsigned int *len_s, long **t, unsigned int *len_t) {
  long *aux;
  unsigned int len_aux;
  aux = *t;
  len_aux = *len_t;
  *t = *s;
  *len_t = *len_s;
  *s = aux;
  *len_s = len_aux;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdx),%r9
mov    (%rcx),%r8d
mov    (%rdi),%rax
mov    %rax,(%rdx)
mov    (%rsi),%eax
mov    %eax,(%rcx)
mov    %r9,(%rdi)
mov    %r8d,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i64** nocapture %0, i32* nocapture %1, i64** nocapture %2, i32* nocapture %3) {
%5 = load i64*, i64** %2
%6 = load i32, i32* %3
%7 = load i64*, i64** %0
store i64* %7, i64** %2
%8 = load i32, i32* %1
store i32 %8, i32* %3
store i64* %5, i64** %0
store i32 %6, i32* %1
ret void
}
/* Type definitions */
struct binfield_stream {
  int dummy;
};
struct binfield {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct binfield_stream *);
void binfield_stream_free(struct binfield *self,
                          struct binfield_stream *field) {
  free(field);
}


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

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

LLVM IR (-O0):
%struct.binfield = type { i32 }
%struct.binfield_stream = type { i32 }
define void @binfield_stream_free(%struct.binfield* %0, %struct.binfield_stream* %1) {
%3 = alloca %struct.binfield*
%4 = alloca %struct.binfield_stream*
store %struct.binfield* %0, %struct.binfield** %3
store %struct.binfield_stream* %1, %struct.binfield_stream** %4
%5 = load %struct.binfield_stream*, %struct.binfield_stream** %4
%6 = call i32 @free(%struct.binfield_stream* %5)
ret void
}

LLVM IR (-O2):
%struct.binfield = type { i32 }
%struct.binfield_stream = type { i32 }
define void @binfield_stream_free(%struct.binfield* nocapture readnone %0, %struct.binfield_stream* nocapture %1) {
%3 = tail call i32 @free(%struct.binfield_stream* %1)
ret void
}
/* Variables and functions */
int ERR_isError(size_t);
unsigned ZBUFFv06_isError(size_t errorCode) { return ERR_isError(errorCode); }


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

x86 assembly (clang, -O2):
<ZBUFFv06_isError>:
jmp    1030 <ERR_isError@plt>

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

LLVM IR (-O2):
define i32 @ZBUFFv06_isError(i64 %0) {
%2 = tail call i32 @ERR_isError(i64 %0)
ret i32 %2
}
unsigned byte_addr(const unsigned cfgbit) { return (cfgbit | ((1 << 3) - 1)); }


x86 assembly (clang, -O0):
<byte_addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_addr>:
mov    %edi,%eax
or     $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @byte_addr(i32 %0) {
%2 = or i32 %0, 7
ret i32 %2
}
void ftk_dlclose(void *handle) {}


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

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

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

LLVM IR (-O2):
define void @ftk_dlclose(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swap(char *, char *);
void left_shift_row(char *a) {
  int i;
  char c = *a;
  for (i = 0; i < 3; i++) {
    swap(a + i, a + i + 1);
  }
}


x86 assembly (clang, -O0):
<left_shift_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1163 <left_shift_row+0x53>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
add    $0x1,%rsi
call   1030 <swap@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <left_shift_row+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_shift_row>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0x1(%rdi),%r14
mov    %r14,%rsi
call   1030 <swap@plt>
lea    0x2(%rbx),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <swap@plt>
add    $0x3,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <swap@plt>

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

LLVM IR (-O2):
define void @left_shift_row(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @swap(i8* %0, i8* %2)
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = tail call i32 @swap(i8* %2, i8* %4)
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = tail call i32 @swap(i8* %6, i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[200];
  scanf("%s", word);
  hash(word);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fabs(float);
scalar_t__ pow(int /*<<< orphan*/, int);
float sqrt(scalar_t__);
float distance(float x1, float y1, float x2, float y2) {
  return sqrt(pow(fabs(x1 - x2), 2) + pow(fabs(y1 - y2), 2));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    -0x18(%rbp),%rdi
add    %rax,%rdi
call   1050 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm3,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
subss  %xmm2,%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
subss  0xc(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <sqrt@plt>

LLVM IR (-O0):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = fsub float %9, %10
%12 = call i32 @fabs(float %11)
%13 = call i64 @pow(i32 %12, i32 2)
%14 = load float, float* %6
%15 = load float, float* %8
%16 = fsub float %14, %15
%17 = call i32 @fabs(float %16)
%18 = call i64 @pow(i32 %17, i32 2)
%19 = add nsw i64 %13, %18
%20 = call float @sqrt(i64 %19)
ret float %20
}

LLVM IR (-O2):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = tail call i32 @fabs(float %5)
%7 = tail call i64 @pow(i32 %6, i32 2)
%8 = fsub float %1, %3
%9 = tail call i32 @fabs(float %8)
%10 = tail call i64 @pow(i32 %9, i32 2)
%11 = add nsw i64 %10, %7
%12 = tail call float @sqrt(i64 %11)
ret float %12
}
void _plfit_i_unused() {}


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

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

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

LLVM IR (-O2):
define void @_plfit_i_unused() {
ret void
}
float range(float value, float lower, float upper) {
  if (value > upper) {
    value = upper;
  } else if (value < lower) {
    value = lower;
  }
  return value;
}


x86 assembly (clang, -O0):
<range>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <range+0x31>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <range+0x53>
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114e <range+0x4e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <range+0x53>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<range>:
ucomiss %xmm2,%xmm0
ja     1110 <range+0x10>
ucomiss %xmm0,%xmm1
movaps %xmm0,%xmm2
jbe    1110 <range+0x10>
movaps %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @range(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %6
store float %11, float* %4
br label %19
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %5
%15 = fcmp olt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %5
store float %17, float* %4
br label %18
18: ; preds = %16, %12
br label %19
19: ; preds = %18, %10
%20 = load float, float* %4
ret float %20
}

LLVM IR (-O2):
define float @range(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %2
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = fcmp olt float %0, %1
br i1 %6, label %7, label %8
7: ; preds = %5
br label %8
8: ; preds = %3, %5, %7
%9 = phi float [ %1, %7 ], [ %0, %5 ], [ %2, %3 ]
ret float %9
}
int sif_platform_irq_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sif_platform_irq_init() {
ret i32 0
}
/* Type definitions */
struct iso_point {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct iso_point *);
void iso_media_close(struct iso_point *iso_p) {
  kfree(iso_p);
  return;
}


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

x86 assembly (clang, -O2):
<iso_media_close>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.iso_point = type { i32 }
define void @iso_media_close(%struct.iso_point* %0) {
%2 = tail call i32 @kfree(%struct.iso_point* %0)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t size, size_t len) {
  void *p = malloc(size * len);
  if (!p)
    return p;
  return memset(p, 0, len);
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115a <calloc+0x3a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <calloc+0x55>
mov    -0x20(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
imul   %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1145 <calloc+0x25>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %2
tail call void @llvm.memset.p0i8.i64(i8* align 1 %4, i8 0, i64 %1, i1 false)
br label %7
7: ; preds = %2, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, unsigned int);
float ret_float(double a, double b) {
  float ret = (float)(a + b);
  unsigned int *ui;
  ui = (unsigned int *)&ret;
  printf("// return %e, %X\n", ret, *ui);
  return ret;
}


x86 assembly (clang, -O0):
<ret_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret_float>:
push   %rax
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
movd   %xmm0,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"// return %e, %X\0A\00"
define float @ret_float(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca float
%6 = alloca i32*
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fadd double %7, %8
%10 = fptrunc double %9 to float
store float %10, float* %5
%11 = bitcast float* %5 to i32*
store i32* %11, i32** %6
%12 = load float, float* %5
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %12, i32 %14)
%16 = load float, float* %5
ret float %16
}

LLVM IR (-O2):
@.str = [18 x i8] c"// return %e, %X\0A\00"
define float @ret_float(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fptrunc double %3 to float
%5 = bitcast float %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %4, i32 %5)
ret float %4
}
/* Variables and functions */
scalar_t__ isdigit(unsigned char);
unsigned char toupper(unsigned char);
char ishex(unsigned char c) {
  c = toupper(c);
  return isdigit(c) || (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117a <ishex+0x5a>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1174 <ishex+0x54>
movzbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
push   %rbx
call   1040 <toupper@plt>
movzbl %al,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %cl
add    $0xbf,%bl
cmp    $0x6,%bl
setb   %al
or     %cl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @ishex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @toupper(i8 zeroext %3)
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = call i64 @isdigit(i8 zeroext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %1
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 70
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ false, %8 ], [ %15, %12 ]
br label %18
18: ; preds = %16, %1
%19 = phi i1 [ true, %1 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
%21 = trunc i32 %20 to i8
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @ishex(i8 zeroext %0) {
%2 = tail call zeroext i8 @toupper(i8 zeroext %0)
%3 = tail call i64 @isdigit(i8 zeroext %2)
%4 = icmp ne i64 %3, 0
%5 = add i8 %2, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %4, %6
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_set_key_usage(void) {
  printf("\nUsage : key_material <MAC_ADDRESS> <KEY> [KEY_ID]\n");
  printf("\n MAC_ADDRESS: station mac address or ff:ff:ff:ff:ff:ff");
  printf("\n KEY: hex string, valid length 32 or 64\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_set_key_usage>:
push   %rax
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf2b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0AUsage : key_material <MAC_ADDRESS> <KEY> [KEY_ID]\0A\00"
@.str.1 = [56 x i8] c"\0A MAC_ADDRESS: station mac address or ff:ff:ff:ff:ff:ff\00"
@.str.2 = [42 x i8] c"\0A KEY: hex string, valid length 32 or 64\0A\00"
define void @print_set_key_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [56 x i8] c"\0A MAC_ADDRESS: station mac address or ff:ff:ff:ff:ff:ff\00"
@str = [51 x i8] c"\0AUsage : key_material <MAC_ADDRESS> <KEY> [KEY_ID]\00"
@str.3 = [41 x i8] c"\0A KEY: hex string, valid length 32 or 64\00"
define void @print_set_key_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
ret void
}
void readFromFilePath(const char *path) {
  printf("%s:%d->%s\n", __func__, 12, path);
}


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

x86 assembly (clang, -O2):
<readFromFilePath>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0xc,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s:%d->%s\0A\00"
@__func__.readFromFilePath = [17 x i8] c"readFromFilePath\00"
define void @readFromFilePath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.readFromFilePath, i64 0, i64 0), i32 12, i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s:%d->%s\0A\00"
@__func__.readFromFilePath = [17 x i8] c"readFromFilePath\00"
define void @readFromFilePath(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.readFromFilePath, i64 0, i64 0), i32 12, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inb(int);
int /*<<< orphan*/ outb(int, int);
void vgahw_screen_enable(void) {
  inb(0x3da);
  outb(0x20, 0x3c0);
}


x86 assembly (clang, -O0):
<vgahw_screen_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3da,%edi
call   1040 <inb@plt>
mov    $0x20,%edi
mov    $0x3c0,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vgahw_screen_enable>:
push   %rax
mov    $0x3da,%edi
call   1040 <inb@plt>
mov    $0x20,%edi
mov    $0x3c0,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @vgahw_screen_enable() {
%1 = call i32 @inb(i32 986)
%2 = call i32 @outb(i32 32, i32 960)
ret void
}

LLVM IR (-O2):
define void @vgahw_screen_enable() {
%1 = tail call i32 @inb(i32 986)
%2 = tail call i32 @outb(i32 32, i32 960)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ tr_hex_to_binary(char const *, int /*<<< orphan*/ *, int);
void tr_hex_to_sha1(uint8_t *sha1, const char *hex) {
  tr_hex_to_binary(hex, sha1, 20);
}


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

x86 assembly (clang, -O2):
<tr_hex_to_sha1>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x14,%edx
jmp    1030 <tr_hex_to_binary@plt>

LLVM IR (-O0):
define void @tr_hex_to_sha1(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32*, i32** %3
%7 = call i32 @tr_hex_to_binary(i8* %5, i32* %6, i32 20)
ret void
}

LLVM IR (-O2):
define void @tr_hex_to_sha1(i32* %0, i8* %1) {
%3 = tail call i32 @tr_hex_to_binary(i8* %1, i32* %0, i32 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRDELETECOLORSPACE_print(const char *contents) {
  core3_print("U_EMRDELETECOLORSPACE", "ihCS:", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRDELETECOLORSPACE_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef5(%rip),%rsi
jmp    1030 <core3_print@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"U_EMRDELETECOLORSPACE\00"
@.str.1 = [6 x i8] c"ihCS:\00"
define void @U_EMRDELETECOLORSPACE_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void g_type_interface_peek_parent() {}


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

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

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

LLVM IR (-O2):
define void @g_type_interface_peek_parent() {
ret void
}
/* Variables and functions */
int **free_arrayN(void *, int);
int **free_int(int **array, int first) { return free_arrayN((void *)array, 2); }


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

x86 assembly (clang, -O2):
<free_int>:
mov    $0x2,%esi
jmp    1030 <free_arrayN@plt>

LLVM IR (-O0):
define i32** @free_int(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 = bitcast i32** %5 to i8*
%7 = call i32** @free_arrayN(i8* %6, i32 2)
ret i32** %7
}

LLVM IR (-O2):
define i32** @free_int(i32** %0, i32 %1) {
%3 = bitcast i32** %0 to i8*
%4 = tail call i32** @free_arrayN(i8* %3, i32 2)
ret i32** %4
}
double calculate_ph(double Vad, double temperature) {
  double E, E0, C, T;
  const double R = 8.31441, N = 1, F = 96484.6;
  T = (273.15) + temperature;
  C = 2.3 * ((R * T) / (N * F));
  E0 = 7 * C;
  E = (2.5 - Vad) / 4.745;
  return ((E0 - E) / C);
}


x86 assembly (clang, -O0):
<calculate_ph>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xf12(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xf15(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xef3(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xed9(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  0xec4(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe97(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe7d(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xe68(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_ph>:
addsd  0xef8(%rip),%xmm1
mulsd  0xef8(%rip),%xmm1
divsd  0xef8(%rip),%xmm1
mulsd  0xef8(%rip),%xmm1
movsd  0xef8(%rip),%xmm3
mulsd  %xmm1,%xmm3
movsd  0xef4(%rip),%xmm2
subsd  %xmm0,%xmm2
divsd  0xef0(%rip),%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @calculate_ph(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 8.314410e+00, double* %9
store double 1.000000e+00, double* %10
store double 9.648460e+04, double* %11
%12 = load double, double* %4
%13 = fadd double 2.731500e+02, %12
store double %13, double* %8
%14 = load double, double* %8
%15 = fmul double 8.314410e+00, %14
%16 = fdiv double %15, 9.648460e+04
%17 = fmul double 2.300000e+00, %16
store double %17, double* %7
%18 = load double, double* %7
%19 = fmul double 7.000000e+00, %18
store double %19, double* %6
%20 = load double, double* %3
%21 = fsub double 2.500000e+00, %20
%22 = fdiv double %21, 4.745000e+00
store double %22, double* %5
%23 = load double, double* %6
%24 = load double, double* %5
%25 = fsub double %23, %24
%26 = load double, double* %7
%27 = fdiv double %25, %26
ret double %27
}

LLVM IR (-O2):
define double @calculate_ph(double %0, double %1) {
%3 = fadd double %1, 2.731500e+02
%4 = fmul double %3, 8.314410e+00
%5 = fdiv double %4, 9.648460e+04
%6 = fmul double %5, 2.300000e+00
%7 = fmul double %6, 7.000000e+00
%8 = fsub double 2.500000e+00, %0
%9 = fdiv double %8, 4.745000e+00
%10 = fsub double %7, %9
%11 = fdiv double %10, %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ cpc_key_press(int);
int /*<<< orphan*/ cpc_key_unpress(int);
void Joy_Omega_Down(int value) {
  if (value) {
    cpc_key_press(0x51);
  } else {
    cpc_key_unpress(0x51);
  };
}


x86 assembly (clang, -O0):
<Joy_Omega_Down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Omega_Down+0x24>
mov    $0x51,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Omega_Down+0x2e>
mov    $0x51,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Omega_Down>:
test   %edi,%edi
je     112e <Joy_Omega_Down+0xe>
mov    $0x51,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x51,%edi
jmp    1040 <cpc_key_unpress@plt>

LLVM IR (-O0):
define void @Joy_Omega_Down(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 @cpc_key_press(i32 81)
br label %9
7: ; preds = %1
%8 = call i32 @cpc_key_unpress(i32 81)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @Joy_Omega_Down(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 81)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 81)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ o(int);
int /*<<< orphan*/ oad(int, int);
void gadd_sp(int val) {
  if (val == (char)val) {
    o(0xc483);
    g(val);
  } else {
    oad(0xc481, val);
  }
}


x86 assembly (clang, -O0):
<gadd_sp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1163 <gadd_sp+0x33>
mov    $0xc483,%edi
call   1050 <o@plt>
mov    -0x4(%rbp),%edi
call   1040 <g@plt>
jmp    1170 <gadd_sp+0x40>
mov    -0x4(%rbp),%esi
mov    $0xc481,%edi
call   1030 <oad@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gadd_sp>:
push   %rbx
mov    %edi,%ebx
movsbl %bl,%eax
cmp    %edi,%eax
jne    114c <gadd_sp+0x1c>
mov    $0xc483,%edi
call   1050 <o@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <g@plt>
mov    $0xc481,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <oad@plt>

LLVM IR (-O0):
define void @gadd_sp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %3, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @o(i32 50307)
%10 = load i32, i32* %2
%11 = call i32 @g(i32 %10)
br label %15
12: ; preds = %1
%13 = load i32, i32* %2
%14 = call i32 @oad(i32 50305, i32 %13)
br label %15
15: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
define void @gadd_sp(i32 %0) {
%2 = add i32 %0, 128
%3 = icmp ult i32 %2, 256
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @o(i32 50307)
%6 = tail call i32 @g(i32 %0)
br label %9
7: ; preds = %1
%8 = tail call i32 @oad(i32 50305, i32 %0)
br label %9
9: ; preds = %7, %4
ret void
}
void __config_locale_restore(void) {}


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

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

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

LLVM IR (-O2):
define void @__config_locale_restore() {
ret void
}
/* Variables and functions */
bool nrf51_errata_39(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_39() {
ret i32 0
}
char *rtrim(cp)
char *cp;
{
  register char *cp1;
  cp1 = cp + strlen(cp) - 1;
  if (*cp1 == '\n')
    *cp1 = 0;
  while (*--cp1 == ' ')
    ;
  *++cp1 = 0;
  return (cp);
}


x86 assembly (clang, -O0):
<rtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1156 <rtrim+0x46>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    115b <rtrim+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
jne    117c <rtrim+0x6c>
jmp    115b <rtrim+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    (%rbx,%rax,1),%rcx
cmpb   $0xa,-0x1(%rbx,%rax,1)
jne    1130 <rtrim+0x20>
movb   $0x0,-0x1(%rcx)
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,-0x2(%rcx)
lea    -0x1(%rcx),%rcx
je     1130 <rtrim+0x20>
movb   $0x0,(%rcx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @rtrim(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %4
br label %8
8: ; preds = %7, %1
br label %9
9: ; preds = %8, %9
%10 = phi i8* [ %11, %9 ], [ %4, %8 ]
%11 = getelementptr inbounds i8, i8* %10, i64 -1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 32
br i1 %13, label %9, label %14
14: ; preds = %9
store i8 0, i8* %10
ret i8* %0
}
void clear_vector(double *vector, int size) {
  int i;
  for (i = 0; i < size; ++i)
    vector[i] = 0.0;
}


x86 assembly (clang, -O0):
<clear_vector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <clear_vector+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clear_vector+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @clear_vector(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compnum(int /*<<< orphan*/);
int /*<<< orphan*/ compword(char *);
int /*<<< orphan*/ popc();
void again() {
  compword("bra");
  compnum(popc());
}


x86 assembly (clang, -O0):
<again>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <compword@plt>
mov    $0x0,%al
call   1050 <popc@plt>
mov    %eax,%edi
call   1040 <compnum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<again>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <compword@plt>
xor    %eax,%eax
call   1050 <popc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <compnum@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"bra\00"
define void @again() {
%1 = call i32 @compword(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @popc()
%3 = call i32 @compnum(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"bra\00"
define void @again() {
%1 = tail call i32 @compword(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @popc()
%3 = tail call i32 @compnum(i32 %2)
ret void
}
unsigned long osip_hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<osip_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <osip_hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <osip_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<osip_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <osip_hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <osip_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @osip_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int m = 0, n = 9;
  int k = m + n;
  printf("k is %d\n", k);
  m = k + n;
  printf("m is %d\n", m);
  n = m - n;
  printf("n is %d\n", n);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"k is %d\0A\00"
@.str.1 = [9 x i8] c"m is %d\0A\00"
@.str.2 = [9 x i8] c"n is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 9, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
store i32 %17, i32* %3
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"k is %d\0A\00"
@.str.1 = [9 x i8] c"m is %d\0A\00"
@.str.2 = [9 x i8] c"n is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 18)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
unsigned int increment_char_marshal_outputs_x(unsigned int, char *);
unsigned int increment_char_marshal_outputs(char *x) {
  unsigned int _camkes_length_391 = 0;
  _camkes_length_391 = increment_char_marshal_outputs_x(_camkes_length_391, x);
  if (_camkes_length_391 == 0xffffffffU) {
    return 0xffffffffU;
  }
  (void)0;
  return _camkes_length_391;
}


x86 assembly (clang, -O0):
<increment_char_marshal_outputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <increment_char_marshal_outputs_x@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1148 <increment_char_marshal_outputs+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <increment_char_marshal_outputs+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_char_marshal_outputs>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <increment_char_marshal_outputs_x@plt>

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

LLVM IR (-O2):
define i32 @increment_char_marshal_outputs(i8* %0) {
%2 = tail call i32 @increment_char_marshal_outputs_x(i32 0, i8* %0)
ret i32 %2
}
int __ompc_task_false_cond() { return 0; }


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

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

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

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