xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xnoexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xnoexpose_type(void *_p, int _v) {
  ((XEvent *)_p)->xnoexpose.type = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xnoexpose_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int recvFd(int sockfd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @recvFd(i32 %0) {
ret i32 -1
}
void kernel_fpu_begin(void) {}


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

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

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

LLVM IR (-O2):
define void @kernel_fpu_begin() {
ret void
}
int clamp(int val, int min, int max) {
  if (val > max)
    return max;
  if (val < min)
    return min;
  return val;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1124 <clamp+0x24>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %1, i32 %0
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
void foo658() {}


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

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

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

LLVM IR (-O2):
define void @foo658() {
ret void
}
double **(wcheck_double_ptr_ptr)(double **to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define double** @wcheck_double_ptr_ptr(double** readnone returned %0) {
ret double** %0
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t cvtInt64ToZigZag(const int64_t value) {
  return ((uint64_t)value << 1) ^ (uint64_t)(value >> 63);
}


x86 assembly (clang, -O0):
<cvtInt64ToZigZag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    $0x3f,%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cvtInt64ToZigZag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 63
%7 = xor i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @cvtInt64ToZigZag(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int get_sub2(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_sub2(int a, int b, int mask) {
  int f, r;
  f = get_sub2(a, b, &r);
  f &= mask;
  printf("sub"
         " 2"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_sub2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1040 <get_sub2@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sub2>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1040 <get_sub2@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"sub 2 %08x %08x %08x %08x %08x\0A\00"
define void @print_sub2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_sub2(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"sub 2 %08x %08x %08x %08x %08x\0A\00"
define void @print_sub2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_sub2(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
int test_imm_BAint8_reg(signed char val) {
  return ((val) & (0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xba,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BAint8_reg>:
test   $0xba,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BAint8_reg(i8 signext %0) {
%2 = and i8 %0, -70
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_E7uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xE7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E7uint64_lowword_reg>:
test   $0xe7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E7uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 231
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int MCL_CURRENT;
int MCL_FUTURE;
scalar_t__ mlockall(int);
int /*<<< orphan*/ perror(char *);
__attribute__((constructor)) void mlockall_init(void) {
  if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) {
    perror("mlockall failed");
  }
}


x86 assembly (clang, -O0):
<mlockall_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
or     (%rax),%edi
call   1030 <mlockall@plt>
cmp    $0x0,%rax
je     1151 <mlockall_init+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlockall_init>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <mlockall@plt>
test   %rax,%rax
jne    113f <mlockall_init+0x1f>
pop    %rax
ret
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@.str = [16 x i8] c"mlockall failed\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @mlockall_init, i8* null }]
define void @mlockall_init() {
%1 = load i32, i32* @MCL_CURRENT
%2 = load i32, i32* @MCL_FUTURE
%3 = or i32 %1, %2
%4 = call i64 @mlockall(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@.str = [16 x i8] c"mlockall failed\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @mlockall_init, i8* null }]
define void @mlockall_init() {
%1 = load i32, i32* @MCL_CURRENT
%2 = load i32, i32* @MCL_FUTURE
%3 = or i32 %2, %1
%4 = tail call i64 @mlockall(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ randombytes_weak(void *, int);
int secrand(void) {
  int ret;
  randombytes_weak((void *)&ret, sizeof(ret));
  return ret;
}


x86 assembly (clang, -O0):
<secrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <randombytes_weak@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secrand>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <randombytes_weak@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @secrand() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @randombytes_weak(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @secrand() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @randombytes_weak(i8* %2, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
void regular_array(int foo[], int n) {
  printf("%s has array value %p\n", __func__, foo);
  printf("%s has array size %zu\n", __func__, sizeof foo);
}


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

x86 assembly (clang, -O2):
<regular_array>:
push   %rbx
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0xef5(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x8,%edx
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s has array value %p\0A\00"
@__func__.regular_array = [14 x i8] c"regular_array\00"
@.str.1 = [23 x i8] c"%s has array size %zu\0A\00"
define void @regular_array(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.regular_array, i64 0, i64 0), i32* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.regular_array, i64 0, i64 0), i64 8)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s has array value %p\0A\00"
@__func__.regular_array = [14 x i8] c"regular_array\00"
@.str.1 = [23 x i8] c"%s has array size %zu\0A\00"
define void @regular_array(i32* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.regular_array, i64 0, i64 0), i32* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.regular_array, i64 0, i64 0), i64 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ModelicaFormatWarning(char *, char const *);
void ModelicaWarning(const char *string) {
  ModelicaFormatWarning("%s", string);
}


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

x86 assembly (clang, -O2):
<ModelicaWarning>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <ModelicaFormatWarning@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @ModelicaWarning(i8* %0) {
%2 = tail call i32 @ModelicaFormatWarning(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float log10f(float);
float to_dB(float g) { return (10.f * log10f(g)); }


x86 assembly (clang, -O0):
<to_dB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <log10f@plt>
movaps %xmm0,%xmm1
movss  0xece(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_dB>:
push   %rax
call   1030 <log10f@plt>
mulss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @to_dB(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @log10f(float %3)
%5 = fmul float 1.000000e+01, %4
ret float %5
}

LLVM IR (-O2):
define float @to_dB(float %0) {
%2 = tail call float @log10f(float %0)
%3 = fmul float %2, 1.000000e+01
ret float %3
}
void setup() {}


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

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

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

LLVM IR (-O2):
define void @setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void badman() {
  printf("I am the bad man\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"I am the bad man\0A\00"
define void @badman() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"I am the bad man\00"
define void @badman() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
void fk524m(ra, dec, rapm, decpm) double *ra;
double *dec;
double *rapm;
double *decpm;
{
  double parallax = 0.0;
  double rv = 0.0;
  fk524pv(ra, dec, rapm, decpm, &parallax, &rv);
  return;
}


x86 assembly (clang, -O0):
<fk524m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
mov    $0x0,%al
call   1030 <fk524pv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fk524m>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
xor    %eax,%eax
call   1030 <fk524pv@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @fk524m(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
%11 = load double*, double** %5
%12 = load double*, double** %6
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = call i32 (double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @fk524pv to i32 (double*, double*, double*, double*, double*, double*, ...)*)(double* %11, double* %12, double* %13, double* %14, double* %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @fk524m(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%8 = bitcast double* %6 to i8*
store double 0.000000e+00, double* %6
%9 = call i32 (double*, double*, double*, double*, double*, double*, ...) bitcast (i32 (...)* @fk524pv to i32 (double*, double*, double*, double*, double*, double*, ...)*)(double* %0, double* %1, double* %2, double* %3, double* %5, double* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void call_omp_set_num_threads(int num_threads) {
  fputs("WARNING: OpenMP not enabled: call_omp_set_num_threads\n", stderr);
  (void)num_threads;
}


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

x86 assembly (clang, -O2):
<call_omp_set_num_threads>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"WARNING: OpenMP not enabled: call_omp_set_num_threads\0A\00"
@stderr = global i32 0
define void @call_omp_set_num_threads(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"WARNING: OpenMP not enabled: call_omp_set_num_threads\0A\00"
@stderr = global i32 0
define void @call_omp_set_num_threads(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int Sequential_Search(int *a, int n, int key) {
  int i;
  for (i = 1; i <= n; i++) {
    if (a[i] == key) {
      return i;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<Sequential_Search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1153 <Sequential_Search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <Sequential_Search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <Sequential_Search+0x5a>
jmp    1145 <Sequential_Search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <Sequential_Search+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sequential_Search>:
xor    %eax,%eax
test   %esi,%esi
jle    111e <Sequential_Search+0x1e>
add    $0x1,%esi
mov    $0x1,%ecx
xchg   %ax,%ax
cmp    %edx,(%rdi,%rcx,4)
je     111f <Sequential_Search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <Sequential_Search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Sequential_Search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 1
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
br label %8
8: ; preds = %5, %13
%9 = phi i64 [ 1, %5 ], [ %14, %13 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, %2
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %18, label %8
16: ; preds = %8
%17 = trunc i64 %9 to i32
br label %18
18: ; preds = %13, %16, %3
%19 = phi i32 [ 0, %3 ], [ %17, %16 ], [ 0, %13 ]
ret i32 %19
}
void mus_bshort_to_char(unsigned char *j, short x) {
  unsigned char *ox = (unsigned char *)&x;
  j[0] = ox[1];
  j[1] = ox[0];
}


x86 assembly (clang, -O0):
<mus_bshort_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_bshort_to_char>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @mus_bshort_to_char(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = bitcast i16* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @mus_bshort_to_char(i8* nocapture writeonly %0, i16 signext %1) {
%3 = trunc i16 %1 to i8
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
store i8 %5, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %6
ret void
}
/* Variables and functions */
unsigned long long factorial(int);
unsigned long long binom(int m, int n) {
  return factorial(m) / (factorial(n) * factorial(m - n));
}


x86 assembly (clang, -O0):
<binom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
imul   %rdx,%rcx
xor    %edx,%edx
div    %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binom>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <factorial@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %rax,%r15
sub    %ebp,%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
imul   %r15,%rcx
mov    %r14,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1153 <binom+0x43>
mov    %r14,%rax
xor    %edx,%edx
div    %rcx
jmp    115a <binom+0x4a>
mov    %r14d,%eax
xor    %edx,%edx
div    %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @binom(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 = call i64 @factorial(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @factorial(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i64 @factorial(i32 %11)
%13 = mul i64 %8, %12
%14 = udiv i64 %6, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @binom(i32 %0, i32 %1) {
%3 = tail call i64 @factorial(i32 %0)
%4 = tail call i64 @factorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i64 @factorial(i32 %5)
%7 = mul i64 %6, %4
%8 = udiv i64 %3, %7
ret i64 %8
}
char *taConfigSeekToEndOfLineComment(char *configString) {
  while (*configString != '\0') {
    if (*configString++ == '\n') {
      break;
    }
  }
  return configString;
}


x86 assembly (clang, -O0):
<taConfigSeekToEndOfLineComment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <taConfigSeekToEndOfLineComment+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1138 <taConfigSeekToEndOfLineComment+0x38>
jmp    113d <taConfigSeekToEndOfLineComment+0x3d>
jmp    1108 <taConfigSeekToEndOfLineComment+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<taConfigSeekToEndOfLineComment>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1120 <taConfigSeekToEndOfLineComment+0x20>
add    $0x1,%rax
cmp    $0xa,%cl
jne    1110 <taConfigSeekToEndOfLineComment+0x10>
ret

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

LLVM IR (-O2):
define i8* @taConfigSeekToEndOfLineComment(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 10
br i1 %8, label %9, label %2
9: ; preds = %6, %2
%10 = phi i8* [ %7, %6 ], [ %3, %2 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ffts_aligned_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<ffts_aligned_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ffts_aligned_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ islower(char);
scalar_t__ toupper(char);
char upper(char c) {
  if (islower(c))
    return (char)toupper(c);
  else
    return c;
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1152 <upper+0x32>
movsbl -0x2(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,-0x1(%rbp)
jmp    1158 <upper+0x38>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
test   %rax,%rax
je     1138 <upper+0x18>
movsbl %bl,%edi
call   1040 <toupper@plt>
mov    %rax,%rbx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @upper(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @islower(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @toupper(i8 signext %8)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %2
br label %13
11: ; preds = %1
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %13
13: ; preds = %11, %7
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @upper(i8 signext %0) {
%2 = tail call i64 @islower(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @toupper(i8 signext %0)
%6 = trunc i64 %5 to i8
br label %7
7: ; preds = %1, %4
%8 = phi i8 [ %6, %4 ], [ %0, %1 ]
ret i8 %8
}
/* Type definitions */
struct country_st {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display_country_info(struct country_st *, char *);
void display_country_not_added(struct country_st *country) {
  display_country_info(country, "not added, record already exist!");
}


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

x86 assembly (clang, -O2):
<display_country_not_added>:
lea    0xee9(%rip),%rsi
jmp    1030 <display_country_info@plt>

LLVM IR (-O0):
%struct.country_st = type { i32 }
@.str = [33 x i8] c"not added, record already exist!\00"
define void @display_country_not_added(%struct.country_st* %0) {
%2 = alloca %struct.country_st*
store %struct.country_st* %0, %struct.country_st** %2
%3 = load %struct.country_st*, %struct.country_st** %2
%4 = call i32 @display_country_info(%struct.country_st* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.country_st = type { i32 }
@.str = [33 x i8] c"not added, record already exist!\00"
define void @display_country_not_added(%struct.country_st* %0) {
%2 = tail call i32 @display_country_info(%struct.country_st* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
void func(int i) {
  i;
  int j = i;
}


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

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

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

LLVM IR (-O2):
define void @func(i32 %0) {
ret void
}
double duration_to_degrees(double ms, double RPM) {
  return (ms / 1000) * 6 * RPM;
}


x86 assembly (clang, -O0):
<duration_to_degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeed(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<duration_to_degrees>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @duration_to_degrees(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fdiv double %5, 1.000000e+03
%7 = fmul double %6, 6.000000e+00
%8 = load double, double* %4
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @duration_to_degrees(double %0, double %1) {
%3 = fdiv double %0, 1.000000e+03
%4 = fmul double %3, 6.000000e+00
%5 = fmul double %4, %1
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_arbitrary() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_arbitrary"
         "\n");
}


x86 assembly (clang, -O0):
<pa_tagstruct_get_arbitrary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_arbitrary\0A\00"
define i32 @pa_tagstruct_get_arbitrary() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_arbitrary\00"
define i32 @pa_tagstruct_get_arbitrary() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gpio_toggle_heartbeat_led();
void leds_heartbeat(void) { gpio_toggle_heartbeat_led(); }


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

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

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

LLVM IR (-O2):
define void @leds_heartbeat() {
%1 = tail call i32 (...) @gpio_toggle_heartbeat_led()
ret void
}
/* Variables and functions */
int f23(int *);
int f24(int *p) { return f23(p); }


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

x86 assembly (clang, -O2):
<f24>:
jmp    1030 <f23@plt>

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

LLVM IR (-O2):
define i32 @f24(i32* %0) {
%2 = tail call i32 @f23(i32* %0)
ret i32 %2
}
/* Variables and functions */
double ln_get_lunar_earth_dist(double);
double lunar_neg_distance(double jd, double *arg) {
  return -ln_get_lunar_earth_dist(jd);
}


x86 assembly (clang, -O0):
<lunar_neg_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ln_get_lunar_earth_dist@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lunar_neg_distance>:
push   %rax
call   1030 <ln_get_lunar_earth_dist@plt>
xorps  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @lunar_neg_distance(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = call double @ln_get_lunar_earth_dist(double %5)
%7 = fneg double %6
ret double %7
}

LLVM IR (-O2):
define double @lunar_neg_distance(double %0, double* nocapture readnone %1) {
%3 = tail call double @ln_get_lunar_earth_dist(double %0)
%4 = fneg double %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ info_putchar(char);
void info_hex(unsigned int d, int digits) {
  while (digits > 0) {
    info_putchar("0123456789abcdef"[(d >> (4 * (--digits))) & 0xF]);
  }
}


x86 assembly (clang, -O0):
<info_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1155 <info_hex+0x45>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
shl    $0x2,%ecx
shr    %cl,%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0xeb9(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <info_putchar@plt>
jmp    111e <info_hex+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_hex>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    115f <info_hex+0x4f>
mov    %edi,%r14d
mov    %esi,%ebx
add    $0x1,%ebx
lea    -0x4(,%rsi,4),%ebp
lea    0xecf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14d,%eax
mov    %ebp,%ecx
shr    %cl,%eax
and    $0xf,%eax
movsbl (%rax,%r15,1),%edi
call   1030 <info_putchar@plt>
add    $0xffffffff,%ebx
add    $0xfffffffc,%ebp
cmp    $0x1,%ebx
ja     1140 <info_hex+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @info_hex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = mul nsw i32 4, %11
%13 = lshr i32 %9, %12
%14 = and i32 %13, 15
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @info_putchar(i8 signext %17)
br label %5
19: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @info_hex(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = shl nsw i32 %6, 2
%8 = lshr i32 %0, %7
%9 = and i32 %8, 15
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @info_putchar(i8 signext %12)
%14 = icmp ugt i32 %5, 1
br i1 %14, label %4, label %15
15: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xe4() {
  Assert_real((islower(228) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1145, ("islower should be 0 for 0xe4"));
}


x86 assembly (clang, -O0):
<t_islower_0xe4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe4,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x479,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xe4>:
push   %rax
mov    $0xe4,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x479,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe4\00"
define void @t_islower_0xe4() {
%1 = call i64 @islower(i32 228)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xe4\00"
define void @t_islower_0xe4() {
%1 = tail call i64 @islower(i32 228)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char isInQuote() {
  extern char quotestate;
  return quotestate;
}


x86 assembly (clang, -O0):
<isInQuote>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInQuote>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%al
ret

LLVM IR (-O0):
@quotestate = external global i8
define signext i8 @isInQuote() {
%1 = load i8, i8* @quotestate
ret i8 %1
}

LLVM IR (-O2):
@quotestate = external global i8
define signext i8 @isInQuote() {
%1 = load i8, i8* @quotestate
ret i8 %1
}
int main() {
  if (15 < 8)
    return 7;
  else
    return 8;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
void shift(int *c, char ***v) {
  (*c)--;
  (*v)++;
}


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

x86 assembly (clang, -O2):
<shift>:
addl   $0xffffffff,(%rdi)
addq   $0x8,(%rsi)
ret

LLVM IR (-O0):
define void @shift(i32* %0, i8*** %1) {
%3 = alloca i32*
%4 = alloca i8***
store i32* %0, i32** %3
store i8*** %1, i8**** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = add nsw i32 %6, -1
store i32 %7, i32* %5
%8 = load i8***, i8**** %4
%9 = load i8**, i8*** %8
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %8
ret void
}

LLVM IR (-O2):
define void @shift(i32* nocapture %0, i8*** nocapture %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
store i32 %4, i32* %0
%5 = load i8**, i8*** %1
%6 = getelementptr inbounds i8*, i8** %5, i64 1
store i8** %6, i8*** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldswtch(int n) { lgen("%s\t$%c%d,%%edx", "movl", n); }


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

x86 assembly (clang, -O2):
<cgldswtch>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s\09$%c%d,%%edx\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgldswtch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s\09$%c%d,%%edx\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgldswtch(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __hash32(int /*<<< orphan*/, int);
uint32_t hash64(uint64_t val) { return __hash32((uint32_t)val, 10); }


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

x86 assembly (clang, -O2):
<hash64>:
mov    $0xa,%esi
jmp    1030 <__hash32@plt>

LLVM IR (-O0):
define i32 @hash64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @__hash32(i32 %4, i32 10)
ret i32 %5
}

LLVM IR (-O2):
define i32 @hash64(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @__hash32(i32 %2, i32 10)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float, float);
int /*<<< orphan*/ getch();
float pedir_float();
int /*<<< orphan*/ stdout;
int main() {
  float a, b;
  a = pedir_float();
  b = pedir_float();
  fprintf(stdout, "has dicho %f y luego %f\n", a, b);
  getch();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pedir_float@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <pedir_float@plt>
movss  %xmm0,-0xc(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pedir_float@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <pedir_float@plt>
movaps %xmm0,%xmm1
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
movss  0x4(%rsp),%xmm0
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [25 x i8] c"has dicho %f y luego %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call float (...) @pedir_float()
store float %4, float* %2
%5 = call float (...) @pedir_float()
store float %5, float* %3
%6 = load i32, i32* @stdout
%7 = load float, float* %2
%8 = load float, float* %3
%9 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %7, float %8)
%10 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [25 x i8] c"has dicho %f y luego %f\0A\00"
define i32 @main() {
%1 = tail call float (...) @pedir_float()
%2 = tail call float (...) @pedir_float()
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), float %1, float %2)
%5 = tail call i32 (...) @getch()
ret i32 0
}