xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ CSLP_GetCurrentPair();
int /*<<< orphan*/ CSLP_GetPairAttr(int, int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
void CSLP_Color(int txt, int bg) {
  attroff(COLOR_PAIR(CSLP_GetCurrentPair()));
  attron(CSLP_GetPairAttr(txt, bg));
}


x86 assembly (clang, -O0):
<CSLP_Color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <CSLP_GetCurrentPair@plt>
mov    %eax,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1070 <CSLP_GetPairAttr@plt>
mov    %eax,%edi
call   1050 <attron@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSLP_Color>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <CSLP_GetCurrentPair@plt>
mov    %eax,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1070 <CSLP_GetPairAttr@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <attron@plt>

LLVM IR (-O0):
define void @CSLP_Color(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @CSLP_GetCurrentPair()
%6 = call i32 @COLOR_PAIR(i32 %5)
%7 = call i32 @attroff(i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @CSLP_GetPairAttr(i32 %8, i32 %9)
%11 = call i32 @attron(i32 %10)
ret void
}

LLVM IR (-O2):
define void @CSLP_Color(i32 %0, i32 %1) {
%3 = tail call i32 (...) @CSLP_GetCurrentPair()
%4 = tail call i32 @COLOR_PAIR(i32 %3)
%5 = tail call i32 @attroff(i32 %4)
%6 = tail call i32 @CSLP_GetPairAttr(i32 %0, i32 %1)
%7 = tail call i32 @attron(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main(int argc, char *argv[]) {
  test1();
  test2();
  fprintf(stderr,
          "%s"
          "\n",
          "[ OK ]");
  ;
  (void)argc, (void)argv;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test1@plt>
mov    $0x0,%al
call   1050 <test2@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
lea    0xe99(%rip),%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test1@plt>
xor    %eax,%eax
call   1050 <test2@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
lea    0xeae(%rip),%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"[ OK ]\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test1()
%7 = call i32 (...) @test2()
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"[ OK ]\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test1()
%4 = tail call i32 (...) @test2()
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double log(double const);
double logit(const double x) { return log(x / (1.0 - x)); }


x86 assembly (clang, -O0):
<logit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logit>:
movsd  0xee8(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @logit(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
%6 = fdiv double %3, %5
%7 = call double @log(double %6)
ret double %7
}

LLVM IR (-O2):
define double @logit(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fdiv double %0, %2
%4 = tail call double @log(double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ emit_mov(int, unsigned int);
void emit_load_return_address(unsigned int rt) { emit_mov(15, rt); }


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

x86 assembly (clang, -O2):
<emit_load_return_address>:
mov    %edi,%esi
mov    $0xf,%edi
jmp    1030 <emit_mov@plt>

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

LLVM IR (-O2):
define void @emit_load_return_address(i32 %0) {
%2 = tail call i32 @emit_mov(i32 15, i32 %0)
ret void
}
void __DELETE_java_io_OutputStream(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_io_OutputStream(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void ssl_fatal(char *s) {
  ERR_print_errors_fp(stderr);
  fprintf(stderr, "%.30s", s);
}


x86 assembly (clang, -O0):
<ssl_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_fatal>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
call   1040 <ERR_print_errors_fp@plt>
mov    (%r14),%edi
lea    0xec0(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%.30s\00"
define void @ssl_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @ERR_print_errors_fp(i32 %3)
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%.30s\00"
define void @ssl_fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @ERR_print_errors_fp(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *udata, void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @my_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
int binary(int masive[8]) {
  int broqch = 1, dec = masive[0] * 2;
  for (; broqch < 7; broqch++) {
    dec = (masive[broqch] + dec) * 2;
  }
  dec = dec + masive[7];
  return dec;
}


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x7,-0xc(%rbp)
jge    1147 <binary+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <binary+0x1b>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
add    0x1c(%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
mov    (%rdi),%eax
add    %eax,%eax
add    0x4(%rdi),%eax
add    %eax,%eax
add    0x8(%rdi),%eax
add    %eax,%eax
add    0xc(%rdi),%eax
add    %eax,%eax
add    0x10(%rdi),%eax
add    %eax,%eax
add    0x14(%rdi),%eax
add    %eax,%eax
add    0x18(%rdi),%eax
add    %eax,%eax
add    0x1c(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @binary(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
%7 = shl nsw i32 %6, 1
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %7
%11 = shl nsw i32 %10, 1
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %11
%15 = shl nsw i32 %14, 1
%16 = getelementptr inbounds i32, i32* %0, i64 4
%17 = load i32, i32* %16
%18 = add nsw i32 %17, %15
%19 = shl nsw i32 %18, 1
%20 = getelementptr inbounds i32, i32* %0, i64 5
%21 = load i32, i32* %20
%22 = add nsw i32 %21, %19
%23 = shl nsw i32 %22, 1
%24 = getelementptr inbounds i32, i32* %0, i64 6
%25 = load i32, i32* %24
%26 = add nsw i32 %25, %23
%27 = shl nsw i32 %26, 1
%28 = getelementptr inbounds i32, i32* %0, i64 7
%29 = load i32, i32* %28
%30 = add nsw i32 %29, %27
ret i32 %30
}
int do_960() { return 960; }


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

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

LLVM IR (-O0):
define i32 @do_960() {
ret i32 960
}

LLVM IR (-O2):
define i32 @do_960() {
ret i32 960
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int const);
void praw(FILE *fp, const uint8_t *raw, size_t hashsize) {
  size_t i;
  for (i = 0; i < hashsize; i++) {
    (void)fprintf(fp, "%02x", raw[i]);
  }
}


x86 assembly (clang, -O0):
<praw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1166 <praw+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <praw+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<praw>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rdx,%rdx
je     1148 <praw+0x38>
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xed0(%rip),%r12
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <praw+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @praw(i32* nocapture %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
void CFGMR3Dump(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3Dump() {
ret void
}
int fun765() { return 765; }


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

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

LLVM IR (-O0):
define i32 @fun765() {
ret i32 765
}

LLVM IR (-O2):
define i32 @fun765() {
ret i32 765
}
/* Variables and functions */
double fabs(double);
int isSmallNumber(double x) { return (fabs(x) < 0.0000001); }


x86 assembly (clang, -O0):
<isSmallNumber>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movaps 0xefb(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xedf(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSmallNumber>:
andpd  0xef8(%rip),%xmm0
movsd  0xf00(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @isSmallNumber(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fcmp olt double %4, 0x3E7AD7F29ABCAF48
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isSmallNumber(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp olt double %2, 0x3E7AD7F29ABCAF48
%4 = zext i1 %3 to i32
ret i32 %4
}
int hm_int_hash(const void *key) { return *((int *)key); }


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

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

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

LLVM IR (-O2):
define i32 @hm_int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int u_long;
typedef int u_char;

/* Variables and functions */
u_long _getlong(u_char *msgp) {
  u_char *p = (u_char *)msgp;
  u_long u;
  u = *p++;
  u <<= 8;
  u |= *p++;
  u <<= 8;
  u |= *p++;
  u <<= 8;
  return (u | *p);
}


x86 assembly (clang, -O0):
<_getlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
or     (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_getlong>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @_getlong(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %2
%6 = shl i32 %3, 16
%7 = shl i32 %5, 8
%8 = or i32 %7, %6
%9 = getelementptr inbounds i32, i32* %0, i64 3
%10 = load i32, i32* %4
%11 = or i32 %8, %10
%12 = shl i32 %11, 8
%13 = load i32, i32* %9
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
int con_getch();
int fleft(int);
int findleft(void) {
  int c = con_getch();
  if (c < 0 || c > 255)
    return 1;
  return fleft(c);
}


x86 assembly (clang, -O0):
<findleft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <con_getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1149 <findleft+0x29>
cmpl   $0xff,-0x8(%rbp)
jle    1155 <findleft+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1160 <findleft+0x40>
mov    -0x8(%rbp),%edi
call   1040 <fleft@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findleft>:
push   %rax
xor    %eax,%eax
call   1030 <con_getch@plt>
cmp    $0xff,%eax
jbe    1136 <findleft+0x16>
mov    $0x1,%eax
pop    %rcx
ret
mov    %eax,%edi
pop    %rax
jmp    1040 <fleft@plt>

LLVM IR (-O0):
define i32 @findleft() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @con_getch()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6, %0
store i32 1, i32* %1
br label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @fleft(i32 %11)
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @findleft() {
%1 = tail call i32 (...) @con_getch()
%2 = icmp ugt i32 %1, 255
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fleft(i32 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 1, %0 ]
ret i32 %6
}
int drv_common_open(void *drv, int flags) { return -1; }


x86 assembly (clang, -O0):
<drv_common_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @drv_common_open(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
void ls_costN_nm10_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_costN_nm10_incref() {
ret void
}
void set_le16(void *p, unsigned long n) {
  ((unsigned char *)p)[0] = (unsigned char)n & (0xFF);
  ((unsigned char *)p)[1] = (unsigned char)(n >> 8) & (0xFF);
}


x86 assembly (clang, -O0):
<set_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_le16>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @set_le16(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i8
%7 = zext i8 %6 to i32
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i64, i64* %4
%13 = lshr i64 %12, 8
%14 = trunc i64 %13 to i8
%15 = zext i8 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
define void @set_le16(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
store i8 %3, i8* %0
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
char *_(char *);
int /*<<< orphan*/ printf(char *, char const *);
int usage(const char *path) {
  printf(
      _("Usage: %s [OPTIONS]\n"
        "Starts the IPv6 Recursive DNS Server discovery Daemon.\n"
        "\n"
        "  -f, --foreground  run in the foreground\n"
        "  -H, --merge-hook  execute this hook whenever resolv.conf is "
        "updated\n"
        "  -h, --help        display this help and exit\n"
        "  -p, --pidfile     override the location of the PID file\n"
        "  -r, --resolv-file set the path to the generated resolv.conf file\n"
        "  -u, --user        override the user to set UID to\n"
        "  -V, --version     display program version and exit\n"
        "  -i, --interface   focuse RA only on this interface\n"),
      path);
  return 0;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <_@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <_@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [519 x i8] c"Usage: %s [OPTIONS]\0AStarts the IPv6 Recursive DNS Server discovery Daemon.\0A\0A -f, --foreground run in the foreground\0A -H, --merge-hook execute this hook whenever resolv.conf is updated\0A -h, --help display this help and exit\0A -p, --pidfile override the location of the PID file\0A -r, --resolv-file set the path to the generated resolv.conf file\0A -u, --user override the user to set UID to\0A -V, --version display program version and exit\0A -i, --interface focuse RA only on this interface\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @_(i8* getelementptr inbounds ([519 x i8], [519 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* %3, i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [519 x i8] c"Usage: %s [OPTIONS]\0AStarts the IPv6 Recursive DNS Server discovery Daemon.\0A\0A -f, --foreground run in the foreground\0A -H, --merge-hook execute this hook whenever resolv.conf is updated\0A -h, --help display this help and exit\0A -p, --pidfile override the location of the PID file\0A -r, --resolv-file set the path to the generated resolv.conf file\0A -u, --user override the user to set UID to\0A -V, --version display program version and exit\0A -i, --interface focuse RA only on this interface\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i8* @_(i8* getelementptr inbounds ([519 x i8], [519 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* %2, i8* %0)
ret i32 0
}
int getInputValue(char a) {
  int result = 0;
  switch (a) {
  case '0':
    result = 0;
    break;
  case '1':
    result = 1;
    break;
  case '2':
    result = 2;
    break;
  case '3':
    result = 3;
    break;
  case '4':
    result = 4;
    break;
  case '5':
    result = 5;
    break;
  case '6':
    result = 6;
    break;
  case '7':
    result = 7;
    break;
  case '8':
    result = 8;
    break;
  case '9':
    result = 9;
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<getInputValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ae <getInputValue+0xae>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x1,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x2,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x3,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x4,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x5,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x6,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x7,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x8,-0x8(%rbp)
jmp    11ae <getInputValue+0xae>
movl   $0x9,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getInputValue(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
i32 56, label %14
i32 57, label %15
]
6: ; preds = %1
store i32 0, i32* %3
br label %16
7: ; preds = %1
store i32 1, i32* %3
br label %16
8: ; preds = %1
store i32 2, i32* %3
br label %16
9: ; preds = %1
store i32 3, i32* %3
br label %16
10: ; preds = %1
store i32 4, i32* %3
br label %16
11: ; preds = %1
store i32 5, i32* %3
br label %16
12: ; preds = %1
store i32 6, i32* %3
br label %16
13: ; preds = %1
store i32 7, i32* %3
br label %16
14: ; preds = %1
store i32 8, i32* %3
br label %16
15: ; preds = %1
store i32 9, i32* %3
br label %16
16: ; preds = %1, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @getInputValue(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -49
%4 = icmp ult i32 %3, 9
%5 = add nsw i32 %2, -48
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashctx *, int, int,
                                     int /*<<< orphan*/);
int spi_disable_blockprotect_at25f4096(struct flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x1C, 1 << 7, 0);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_at25f4096>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_at25f4096>:
mov    $0x1c,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25f4096(%struct.flashctx* %0) {
%2 = alloca %struct.flashctx*
store %struct.flashctx* %0, %struct.flashctx** %2
%3 = load %struct.flashctx*, %struct.flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %3, i32 28, i32 128, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @spi_disable_blockprotect_at25f4096(%struct.flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashctx* %0, i32 28, i32 128, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *);
void EXPMarkTag(const char *tag, const char *text, const char *color) {
  if (color == 0)
    color = "";
  printf("[%10s]: %s%s\n"
         "\033[0m",
         tag, color, text);
}


x86 assembly (clang, -O0):
<EXPMarkTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113a <EXPMarkTag+0x2a>
lea    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EXPMarkTag>:
mov    %rsi,%rcx
mov    %rdi,%rsi
test   %rdx,%rdx
lea    0xef1(%rip),%rax
cmove  %rax,%rdx
lea    0xed5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [18 x i8] c"[%10s]: %s%s\0A\1B[0m\00"
define void @EXPMarkTag(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %6
br label %10
10: ; preds = %9, %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [18 x i8] c"[%10s]: %s%s\0A\1B[0m\00"
define void @EXPMarkTag(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %2, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %5, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void emit_indent(unsigned long indent) {
  while (indent > 0) {
    putchar(' ');
    indent--;
  }
}


x86 assembly (clang, -O0):
<emit_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1142 <emit_indent+0x32>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <emit_indent+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_indent>:
push   %rbx
test   %rdi,%rdi
je     1130 <emit_indent+0x20>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <emit_indent+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @emit_indent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %6, %1
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 @putchar(i8 signext 32)
%8 = load i64, i64* %2
%9 = add i64 %8, -1
store i64 %9, i64* %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @emit_indent(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @putchar(i8 signext 32)
%6 = add i64 %4, -1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Temperature(double);
scalar_t__ scanf(char *, double *);
int main(void) {
  double temp;
  while (scanf("%lf", &temp))
    Temperature(temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
movsd  -0x10(%rbp),%xmm0
call   1030 <Temperature@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     116a <main+0x4a>
lea    0xec1(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rsp),%xmm0
call   1030 <Temperature@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = load double, double* %1
%7 = call i32 @Temperature(double %6)
%8 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 0
}
int int_div(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<int_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @int_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
unsigned long long fcn(int n) {
  long long l = n, result = 1;
  for (long long i = 1; i <= l; i++)
    result *= 2;
  return result;
}


x86 assembly (clang, -O0):
<fcn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     114a <fcn+0x4a>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111f <fcn+0x1f>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcn>:
test   %edi,%edi
jle    111c <fcn+0x1c>
mov    %edi,%edx
lea    -0x1(%rdx),%rax
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1122 <fcn+0x22>
mov    $0x1,%eax
jmp    113a <fcn+0x3a>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edx
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffffffffffff8,%rdx
jne    1130 <fcn+0x30>
test   %rcx,%rcx
je     1149 <fcn+0x49>
nop
add    %rax,%rax
add    $0xffffffffffffffff,%rcx
jne    1140 <fcn+0x40>
ret

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

LLVM IR (-O2):
define i64 @fcn(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %20, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = add nsw i64 %4, -1
%6 = and i64 %4, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = and i64 %4, 4294967288
br label %22
10: ; preds = %22, %3
%11 = phi i64 [ undef, %3 ], [ %25, %22 ]
%12 = phi i64 [ 1, %3 ], [ %25, %22 ]
%13 = icmp eq i64 %6, 0
br i1 %13, label %20, label %14
14: ; preds = %10, %14
%15 = phi i64 [ %17, %14 ], [ %12, %10 ]
%16 = phi i64 [ %18, %14 ], [ 0, %10 ]
%17 = shl nsw i64 %15, 1
%18 = add i64 %16, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %20, label %14
20: ; preds = %10, %14, %1
%21 = phi i64 [ 1, %1 ], [ %11, %10 ], [ %17, %14 ]
ret i64 %21
22: ; preds = %22, %8
%23 = phi i64 [ 1, %8 ], [ %25, %22 ]
%24 = phi i64 [ 0, %8 ], [ %26, %22 ]
%25 = shl i64 %23, 8
%26 = add i64 %24, 8
%27 = icmp eq i64 %26, %9
br i1 %27, label %10, label %22
}
int valid_coords(int row, int col) {
  return 0 <= row && row < (6) && 0 <= col && col < (7);
}


x86 assembly (clang, -O0):
<valid_coords>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     1143 <valid_coords+0x43>
xor    %eax,%eax
cmpl   $0x6,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    1143 <valid_coords+0x43>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     1143 <valid_coords+0x43>
cmpl   $0x7,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_coords>:
cmp    $0x6,%edi
setb   %al
cmp    $0x7,%esi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @valid_coords(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 = icmp sle i32 0, %5
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp sle i32 0, %11
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 7
br label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @valid_coords(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 6
%4 = icmp ult i32 %1, 7
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ CopyToVRAM(int /*<<< orphan*/ volatile *,
                              int /*<<< orphan*/ const *, int);
void LoadTile4(int charblock, int tile_num, const uint8_t tile_data[32]) {
  CopyToVRAM(((volatile uint16_t *)(0x6000000)) + (charblock * 8192) +
                 (tile_num * 16),
             (const uint16_t *)tile_data, 16);
}


x86 assembly (clang, -O0):
<LoadTile4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xd,%eax
cltq
mov    $0x6000000,%edi
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <CopyToVRAM@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadTile4>:
shl    $0xd,%edi
movslq %edi,%rax
shl    $0x4,%esi
movslq %esi,%rcx
shl    $0x2,%rcx
lea    (%rcx,%rax,4),%rdi
add    $0x6000000,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
jmp    1030 <CopyToVRAM@plt>

LLVM IR (-O0):
define void @LoadTile4(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8192
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %9
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 16
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32*, i32** %6
%16 = call i32 @CopyToVRAM(i32* %14, i32* %15, i32 16)
ret void
}

LLVM IR (-O2):
define void @LoadTile4(i32 %0, i32 %1, i32* %2) {
%4 = shl nsw i32 %0, 13
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %5
%7 = shl nsw i32 %1, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = tail call i32 @CopyToVRAM(i32* %9, i32* %2, i32 16)
ret void
}
/* Type definitions */
struct field_def {
  int dummy;
};

/* Variables and functions */
struct field_def **_get_destroyable_field(struct field_def **,
                                          struct field_def **);
struct field_def **_next_destroyable_field(struct field_def **f,
                                           struct field_def **end) {
  return _get_destroyable_field(++f, end);
}


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

x86 assembly (clang, -O2):
<_next_destroyable_field>:
add    $0x8,%rdi
jmp    1030 <_get_destroyable_field@plt>

LLVM IR (-O0):
%struct.field_def = type { i32 }
define %struct.field_def** @_next_destroyable_field(%struct.field_def** %0, %struct.field_def** %1) {
%3 = alloca %struct.field_def**
%4 = alloca %struct.field_def**
store %struct.field_def** %0, %struct.field_def*** %3
store %struct.field_def** %1, %struct.field_def*** %4
%5 = load %struct.field_def**, %struct.field_def*** %3
%6 = getelementptr inbounds %struct.field_def*, %struct.field_def** %5, i32 1
store %struct.field_def** %6, %struct.field_def*** %3
%7 = load %struct.field_def**, %struct.field_def*** %4
%8 = call %struct.field_def** @_get_destroyable_field(%struct.field_def** %6, %struct.field_def** %7)
ret %struct.field_def** %8
}

LLVM IR (-O2):
%struct.field_def = type { i32 }
define %struct.field_def** @_next_destroyable_field(%struct.field_def** %0, %struct.field_def** %1) {
%3 = getelementptr inbounds %struct.field_def*, %struct.field_def** %0, i64 1
%4 = tail call %struct.field_def** @_get_destroyable_field(%struct.field_def** %3, %struct.field_def** %1)
ret %struct.field_def** %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ execute(int);
scalar_t__ execute2(int, int);
int main(void) {
  if (execute(1) == 0)
    abort();
  if (execute2(1, 2) == 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <execute@plt>
cmp    $0x0,%rax
jne    115a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <execute2@plt>
cmp    $0x0,%rax
jne    117a <main+0x4a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <execute@plt>
test   %rax,%rax
je     1158 <main+0x28>
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <execute2@plt>
test   %rax,%rax
je     1158 <main+0x28>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @execute(i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i64 @execute2(i32 1, i32 2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @execute(i32 1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i64 @execute2(i32 1, i32 2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n"
         "\treadclusters [FILE]\n"
         "\nDescription:\n"
         "\tPrints document ids of a given cluster.\n");
}


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

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

LLVM IR (-O0):
@.str = [84 x i8] c"Usage:\0A\09readclusters [FILE]\0A\0ADescription:\0A\09Prints document ids of a given cluster.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [83 x i8] c"Usage:\0A\09readclusters [FILE]\0A\0ADescription:\0A\09Prints document ids of a given cluster.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ posix_spawnattr_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int posix_spawnattr_getsigdefault(const posix_spawnattr_t *attr,
                                  sigset_t *sigdefault) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<posix_spawnattr_getsigdefault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnattr_getsigdefault>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnattr_getsigdefault(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnattr_getsigdefault(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}