xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ sqrt(float);
float racine(float numb) { return (float)sqrt(numb); }


x86 assembly (clang, -O0):
<racine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<racine>:
push   %rax
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @racine(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @sqrt(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @racine(float %0) {
%2 = tail call i64 @sqrt(float %0)
%3 = sitofp i64 %2 to float
ret float %3
}
int add_a_b_c(int a, int b, char c) {
  int ab1, ab2;
  ab1 = a + b;
  ab2 = ab1 + c;
  return (ab2);
}


x86 assembly (clang, -O0):
<add_a_b_c>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movsbl -0x9(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @add_a_b_c(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = add nsw i32 %12, %14
store i32 %15, i32* %8
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
define i32 @add_a_b_c(i32 %0, i32 %1, i8 signext %2) {
%4 = add nsw i32 %1, %0
%5 = sext i8 %2 to i32
%6 = add nsw i32 %4, %5
ret i32 %6
}
long __syscall1(long n, long a1) {
  unsigned long __ret;
  __asm__ __volatile__("call __vsyscall"
                       : "=a"(__ret)
                       : "a"(n), "d"(a1)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdx
call   1030 <__vsyscall@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall1>:
mov    %rsi,%rdx
mov    %rdi,%rax
call   1030 <__vsyscall@plt>
ret

LLVM IR (-O0):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @__syscall1(i64 %0, i64 %1) {
%3 = tail call i64 asm sideeffect "call __vsyscall", "={ax},{ax},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_gps_detect_receiver();
void roadmap_start_detect_receiver(void) { roadmap_gps_detect_receiver(); }


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

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

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

LLVM IR (-O2):
define void @roadmap_start_detect_receiver() {
%1 = tail call i32 (...) @roadmap_gps_detect_receiver()
ret void
}
/* Type definitions */
struct lineFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lineFileClose(struct lineFile **);
char *lineFileReadAll(struct lineFile *);
struct lineFile *netLineFileSilentOpen(char *);
char *netReadTextFileIfExists(char *url) {
  struct lineFile *lf = netLineFileSilentOpen(url);
  if (lf == NULL)
    return NULL;
  char *text = lineFileReadAll(lf);
  lineFileClose(&lf);
  return text;
}


x86 assembly (clang, -O0):
<netReadTextFileIfExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <netLineFileSilentOpen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <netReadTextFileIfExists+0x31>
movq   $0x0,-0x8(%rbp)
jmp    117f <netReadTextFileIfExists+0x4f>
mov    -0x18(%rbp),%rdi
call   1040 <lineFileReadAll@plt>
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <lineFileClose@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netReadTextFileIfExists>:
push   %rbx
sub    $0x10,%rsp
call   1050 <netLineFileSilentOpen@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     115e <netReadTextFileIfExists+0x2e>
mov    %rax,%rdi
call   1040 <lineFileReadAll@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1030 <lineFileClose@plt>
mov    %rbx,%rax
jmp    1160 <netReadTextFileIfExists+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.lineFile = type { i32 }
define i8* @netReadTextFileIfExists(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.lineFile*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call %struct.lineFile* @netLineFileSilentOpen(i8* %6)
store %struct.lineFile* %7, %struct.lineFile** %4
%8 = load %struct.lineFile*, %struct.lineFile** %4
%9 = icmp eq %struct.lineFile* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %16
11: ; preds = %1
%12 = load %struct.lineFile*, %struct.lineFile** %4
%13 = call i8* @lineFileReadAll(%struct.lineFile* %12)
store i8* %13, i8** %5
%14 = call i32 @lineFileClose(%struct.lineFile** %4)
%15 = load i8*, i8** %5
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
%struct.lineFile = type { i32 }
define i8* @netReadTextFileIfExists(i8* %0) {
%2 = alloca %struct.lineFile*
%3 = bitcast %struct.lineFile** %2 to i8*
%4 = tail call %struct.lineFile* @netLineFileSilentOpen(i8* %0)
store %struct.lineFile* %4, %struct.lineFile** %2
%5 = icmp eq %struct.lineFile* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i8* @lineFileReadAll(%struct.lineFile* %4)
%8 = call i32 @lineFileClose(%struct.lineFile** %2)
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %10
}
float nx_max_s(float x, float y) { return (x > y) ? x : y; }


x86 assembly (clang, -O0):
<nx_max_s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <nx_max_s+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <nx_max_s+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nx_max_s>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @nx_max_s(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, scalar_t__);
char *malloc(scalar_t__);
char *readBytes(char *, char *, scalar_t__);
char *readInt(char *, scalar_t__ *);
char *readString(char *buf, char **out) {
  uint32_t len = 0;
  buf = readInt(buf, &len);
  char *temp = malloc(len + 1);
  bzero(temp, len + 1);
  buf = readBytes(buf, temp, len);
  *out = temp;
  return buf;
}


x86 assembly (clang, -O0):
<readString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <readInt@plt>
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1060 <bzero@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <readBytes@plt>
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readString>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1030 <readInt@plt>
mov    %rax,%r15
mov    0x8(%rsp),%r12
lea    0x1(%r12),%r13
mov    %r13,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r13,%rsi
call   1060 <bzero@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1050 <readBytes@plt>
mov    %rbx,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @readString(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i64 0, i64* %5
%7 = load i8*, i8** %3
%8 = call i8* @readInt(i8* %7, i64* %5)
store i8* %8, i8** %3
%9 = load i64, i64* %5
%10 = add nsw i64 %9, 1
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i64, i64* %5
%14 = add nsw i64 %13, 1
%15 = call i32 @bzero(i8* %12, i64 %14)
%16 = load i8*, i8** %3
%17 = load i8*, i8** %6
%18 = load i64, i64* %5
%19 = call i8* @readBytes(i8* %16, i8* %17, i64 %18)
store i8* %19, i8** %3
%20 = load i8*, i8** %6
%21 = load i8**, i8*** %4
store i8* %20, i8** %21
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @readString(i8* %0, i8** nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%5 = call i8* @readInt(i8* %0, i64* %3)
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
%9 = call i32 @bzero(i8* %8, i64 %7)
%10 = call i8* @readBytes(i8* %5, i8* %8, i64 %6)
store i8* %8, i8** %1
ret i8* %10
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_0c(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x1A550E1E;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_0c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1a550e1e,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_0c>:
xor    $0x1a550e1e,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_0c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = xor i32 %6, 441781790
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_0c(i32 %0, i32 %1) {
%3 = xor i32 %0, 441781790
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ TtlWrite(int /*<<< orphan*/, int /*<<< orphan*/ *,
                            int /*<<< orphan*/);
uint32_t TtlWriteLock(uint32_t index) {
  do {
  } while (0);
  return TtlWrite(index, NULL, 0);
}


x86 assembly (clang, -O0):
<TtlWriteLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
jmp    1120 <TtlWriteLock+0x10>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <TtlWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TtlWriteLock>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <TtlWrite@plt>

LLVM IR (-O0):
define i32 @TtlWriteLock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
%5 = load i32, i32* %2
%6 = call i32 @TtlWrite(i32 %5, i32* null, i32 0)
ret i32 %6
}

LLVM IR (-O2):
define i32 @TtlWriteLock(i32 %0) {
%2 = tail call i32 @TtlWrite(i32 %0, i32* null, i32 0)
ret i32 %2
}
INSTR(OCBP) { NEXT_INSTR(); }


x86 assembly (clang, -O0):
<INSTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <NEXT_INSTR@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (...) @NEXT_INSTR()
ret i32 undef
}
void test1() {
  {
    int i;
    i = i + 1;
    int j;
  }
  {
    __extension__ int i;
    i = i + 1;
    int j;
  }
  {
    int i;
    i = i + 1;
    __extension__ int j;
  }
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
long inv_q29_mult(long a, long b) {
  long long temp;
  long result;
  temp = (long long)a * b;
  result = (long)(temp >> 29);
  return result;
}


x86 assembly (clang, -O0):
<inv_q29_mult>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sar    $0x1d,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_q29_mult>:
mov    %rdi,%rax
imul   %rsi,%rax
sar    $0x1d,%rax
ret

LLVM IR (-O0):
define i64 @inv_q29_mult(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul nsw i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = ashr i64 %10, 29
store i64 %11, i64* %6
%12 = load i64, i64* %6
ret i64 %12
}

LLVM IR (-O2):
define i64 @inv_q29_mult(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
%4 = ashr i64 %3, 29
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
char heapBased2() {
  char *buf = malloc(2);
  buf[1] = 'a';
  char result = buf[0];
  free(buf);
  return result;
}


x86 assembly (clang, -O0):
<heapBased2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapBased2>:
push   %rax
mov    $0x2,%edi
call   1040 <malloc@plt>
movb   $0x61,0x1(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define signext i8 @heapBased2() {
%1 = alloca i8*
%2 = alloca i8
%3 = call i8* @malloc(i32 2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 97, i8* %5
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %2
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @heapBased2() {
%1 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%2 = getelementptr inbounds i8, i8* %1, i64 1
store i8 97, i8* %2
%3 = tail call i32 @free(i8* %1)
ret i8 undef
}
double f4_cb_send_pre_int_short(double (*cb)(int, short)) {
  short r = -22;
  return cb(8, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0xffea,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x8,%edi
movswl -0xa(%rbp),%esi
call   *%rax
movsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_short>:
push   %rax
mov    %rdi,%rax
mov    $0x8,%edi
mov    $0xffffffea,%esi
call   *%rax
addsd  0xee8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_short(double (i32, i16)* %0) {
%2 = alloca double (i32, i16)*
%3 = alloca i16
store double (i32, i16)* %0, double (i32, i16)** %2
store i16 -22, i16* %3
%4 = load double (i32, i16)*, double (i32, i16)** %2
%5 = load i16, i16* %3
%6 = call double %4(i32 8, i16 signext %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_short(double (i32, i16)* nocapture %0) {
%2 = tail call double %0(i32 8, i16 signext -22)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
void display_digits(int time) {}


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

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

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

LLVM IR (-O2):
define void @display_digits(i32 %0) {
ret void
}
/* Type definitions */
struct benc_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ benc_str(struct benc_t *, char const *);
void benc_dict_kv_s(struct benc_t *b, const char *key, const char *val) {
  benc_str(b, key);
  benc_str(b, val);
}


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

x86 assembly (clang, -O2):
<benc_dict_kv_s>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <benc_str@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <benc_str@plt>

LLVM IR (-O0):
%struct.benc_t = type { i32 }
define void @benc_dict_kv_s(%struct.benc_t* %0, i8* %1, i8* %2) {
%4 = alloca %struct.benc_t*
%5 = alloca i8*
%6 = alloca i8*
store %struct.benc_t* %0, %struct.benc_t** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.benc_t*, %struct.benc_t** %4
%8 = load i8*, i8** %5
%9 = call i32 @benc_str(%struct.benc_t* %7, i8* %8)
%10 = load %struct.benc_t*, %struct.benc_t** %4
%11 = load i8*, i8** %6
%12 = call i32 @benc_str(%struct.benc_t* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.benc_t = type { i32 }
define void @benc_dict_kv_s(%struct.benc_t* %0, i8* %1, i8* %2) {
%4 = tail call i32 @benc_str(%struct.benc_t* %0, i8* %1)
%5 = tail call i32 @benc_str(%struct.benc_t* %0, i8* %2)
ret void
}
OP(dd, a8) { op_a8(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_a8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_a8()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_a8()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printBin(unsigned int);
void convertIntegToBin(int X) {
  unsigned bin = *(unsigned *)&X;
  printBin(bin);
}


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

x86 assembly (clang, -O2):
<convertIntegToBin>:
jmp    1030 <printBin@plt>

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

LLVM IR (-O2):
define void @convertIntegToBin(i32 %0) {
%2 = tail call i32 @printBin(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void addendpath(char *path) {
  if (path[0] && path[strlen(path) - 1] != '/')
    strcat(path, "/");
}


x86 assembly (clang, -O0):
<addendpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1176 <addendpath+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1176 <addendpath+0x56>
mov    -0x8(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addendpath>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1137 <addendpath+0x17>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    1139 <addendpath+0x19>
pop    %rbx
ret
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @addendpath(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 47
br i1 %10, label %13, label %11
11: ; preds = %4
%12 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4, %1
ret void
}
int bitcount_3(unsigned int v) {
  unsigned int c = 0;
  while (v > 0) {
    c++;
    v = v >> 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<bitcount_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    112f <bitcount_3+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount_3+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount_3>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount_3+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitcount_3+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount_3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
unsigned int convert_le_u32(const unsigned char *buf) {
  return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
}


x86 assembly (clang, -O0):
<convert_le_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_le_u32>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @convert_le_u32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
size_t strlen(const char *a) {
  size_t i;
  for (i = 0; a[i] != 0; i++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1142 <strlen+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xfffffffffffffffe,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x2(%rdi,%rax,1)
lea    0x2(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 2
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage:\n  install [-lcsz#] [-o owner] [-g group] [-m mode] "
                  "[-S stack] [file1] file2\n  install [-lcsz#] [-o owner] [-g "
                  "group] [-m mode] [-S stack] file ... dir\n  install -d [-o "
                  "owner] [-g group] [-m mode] directory\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [214 x i8] c"Usage:\0A install [-lcsz#] [-o owner] [-g group] [-m mode] [-S stack] [file1] file2\0A install [-lcsz#] [-o owner] [-g group] [-m mode] [-S stack] file ... dir\0A install -d [-o owner] [-g group] [-m mode] directory\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [214 x i8] c"Usage:\0A install [-lcsz#] [-o owner] [-g group] [-m mode] [-S stack] [file1] file2\0A install [-lcsz#] [-o owner] [-g group] [-m mode] [-S stack] file ... dir\0A install -d [-o owner] [-g group] [-m mode] directory\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void FLASH_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @FLASH_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @FLASH_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int sys_is_little_endian(void) {
  long one = 1;
  return (*((char *)(&one)));
}


x86 assembly (clang, -O0):
<sys_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sys_is_little_endian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @sys_is_little_endian() {
ret i32 1
}
void o(float *d, float *s) {
  d[0] += s[0];
  d[1] += s[1];
  d[2] += s[2];
}


x86 assembly (clang, -O0):
<o>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @o(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fadd float %3, %4
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fadd float %7, %9
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fadd float %12, %14
store float %15, float* %13
ret void
}
void set_InitHH(unsigned char *pds, unsigned int hour) { pds[15] = hour; }


x86 assembly (clang, -O0):
<set_InitHH>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xf(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_InitHH>:
mov    %sil,0xf(%rdi)
ret

LLVM IR (-O0):
define void @set_InitHH(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 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 15
store i8 %6, i8* %8
ret void
}

LLVM IR (-O2):
define void @set_InitHH(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %3, i8* %4
ret void
}
void fn00401C48() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn00401C48() {
ret void
}
void f8(void) {}


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

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

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

LLVM IR (-O2):
define void @f8() {
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, int);
int strnicmp(const char *str1, const char *str2, int count) {
  return strncasecmp(str1, str2, count);
}


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

x86 assembly (clang, -O2):
<strnicmp>:
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @strnicmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void quithandler(int s) {
  printf("Received signal %d..waiting\n", s);
  sleep(3);
  printf("Leaving quithandler \n");
}


x86 assembly (clang, -O0):
<quithandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quithandler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Received signal %d..waiting\0A\00"
@.str.1 = [22 x i8] c"Leaving quithandler \0A\00"
define void @quithandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 3)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Received signal %d..waiting\0A\00"
@str = [21 x i8] c"Leaving quithandler \00"
define void @quithandler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 3)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int MSM6295ReadStatus(const int nChip) {
  extern unsigned int nMSM6295Status[(2)];
  return nMSM6295Status[nChip];
}


x86 assembly (clang, -O0):
<MSM6295ReadStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ee6(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MSM6295ReadStatus>:
movslq %edi,%rax
mov    0x2eee(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@nMSM6295Status = external global [2 x i32]
define i32 @MSM6295ReadStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [2 x i32], [2 x i32]* @nMSM6295Status, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
@nMSM6295Status = external global [2 x i32]
define i32 @MSM6295ReadStatus(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [2 x i32], [2 x i32]* @nMSM6295Status, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int nthUglyNumber(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char const *argv[]) {
  int nth = 1600;
  printf("%dth = %d\n", nth, nthUglyNumber(nth));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x640,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <nthUglyNumber@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x640,%edi
call   1040 <nthUglyNumber@plt>
lea    0xece(%rip),%rdi
mov    $0x640,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%dth = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @nthUglyNumber(i32 1600)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1600, i32 %3)
ret i32 0
}
/* Variables and functions */
double InBeta(long, long, double);
double cdfPascal(long n, double p, long x) {
  return (1.0 - InBeta(x + 1, n, p));
}


x86 assembly (clang, -O0):
<cdfPascal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
call   1030 <InBeta@plt>
movaps %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdfPascal>:
push   %rax
mov    %rdi,%rax
lea    0x1(%rsi),%rdi
mov    %rax,%rsi
call   1030 <InBeta@plt>
movsd  0xed8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cdfPascal(i64 %0, double %1, i64 %2) {
%4 = alloca i64
%5 = alloca double
%6 = alloca i64
store i64 %0, i64* %4
store double %1, double* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = add nsw i64 %7, 1
%9 = load i64, i64* %4
%10 = load double, double* %5
%11 = call double @InBeta(i64 %8, i64 %9, double %10)
%12 = fsub double 1.000000e+00, %11
ret double %12
}

LLVM IR (-O2):
define double @cdfPascal(i64 %0, double %1, i64 %2) {
%4 = add nsw i64 %2, 1
%5 = tail call double @InBeta(i64 %4, i64 %0, double %1)
%6 = fsub double 1.000000e+00, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL_RES;
typedef int /*<<< orphan*/ MYSQL_FIELD;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
MYSQL_FIELD *mysql_fetch_field(MYSQL_RES *result) {
  printf("mysql_fetch_field(%s)\n", (result ? "MYSQL_RES" : "NULL"));
  return ((MYSQL_FIELD *)0);
}


x86 assembly (clang, -O0):
<mysql_fetch_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xefa(%rip),%rsi
lea    0xee9(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysql_fetch_field>:
push   %rax
test   %rdi,%rdi
lea    0xf06(%rip),%rax
lea    0xef5(%rip),%rsi
cmove  %rax,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"mysql_fetch_field(%s)\0A\00"
@.str.1 = [10 x i8] c"MYSQL_RES\00"
@.str.2 = [5 x i8] c"NULL\00"
define i32* @mysql_fetch_field(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32* null
}

LLVM IR (-O2):
@.str = [23 x i8] c"mysql_fetch_field(%s)\0A\00"
@.str.1 = [10 x i8] c"MYSQL_RES\00"
@.str.2 = [5 x i8] c"NULL\00"
define noalias i32* @mysql_fetch_field(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32* null
}
double fabs(double x) {
  *(1 + (int *)&x) &= 0x7fffffff;
  return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 2147483647
store i32 %6, i32* %4
%7 = load double, double* %2
ret double %7
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, 9223372036854775807
%4 = bitcast i64 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
void Heater(int heatercmd) {
  char cmdstr[256];
  sprintf(cmdstr, "setheater %d 1>/dev/null 2>/dev/null", heatercmd);
  system(cmdstr);
}


x86 assembly (clang, -O0):
<Heater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Heater>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"setheater %d 1>/dev/null 2>/dev/null\00"
define void @Heater(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"setheater %d 1>/dev/null 2>/dev/null\00"
define void @Heater(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @system(i8* %3)
ret void
}
putc(c) { write(2, &c, 1); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x2,%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @putc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, i32*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32*, i32, ...)*)(i32 2, i32* %3, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i32*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i32*, i32, ...)*)(i32 2, i32* %2, i32 1)
ret i32 undef
}
void pendfunc3(int y) {}


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

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

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

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