xunge/DecIR huggingface dataset:
const char *loader_BASIC_get_name(void) {
  return "loader for standard BASIC files";
}


x86 assembly (clang, -O0):
<loader_BASIC_get_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loader_BASIC_get_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"loader for standard BASIC files\00"
define i8* @loader_BASIC_get_name() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"loader for standard BASIC files\00"
define i8* @loader_BASIC_get_name() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
int prng() {
  static int v = 17;
  v = (1103515245 * v + 12345) & 0x7fffffff;
  return v;
}


x86 assembly (clang, -O0):
<prng>:
push   %rbp
mov    %rsp,%rbp
imul   $0x41c64e6d,0x2f12(%rip),%eax
4e c6 41
add    $0x3039,%eax
and    $0x7fffffff,%eax
mov    %eax,0x2f02(%rip)
mov    0x2efc(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prng>:
imul   $0x41c64e6d,0x2f16(%rip),%eax
4e c6 41
add    $0x3039,%eax
and    $0x7fffffff,%eax
mov    %eax,0x2f06(%rip)
ret

LLVM IR (-O0):
@prng.v = internal global i32 17
define i32 @prng() {
%1 = load i32, i32* @prng.v
%2 = mul nsw i32 1103515245, %1
%3 = add nsw i32 %2, 12345
%4 = and i32 %3, 2147483647
store i32 %4, i32* @prng.v
%5 = load i32, i32* @prng.v
ret i32 %5
}

LLVM IR (-O2):
@prng.v = internal unnamed_addr global i32 17
define i32 @prng() {
%1 = load i32, i32* @prng.v
%2 = mul nsw i32 %1, 1103515245
%3 = add nsw i32 %2, 12345
%4 = and i32 %3, 2147483647
store i32 %4, i32* @prng.v
ret i32 %4
}
int main(int n) {
  if (n)
    return main(n - 1);
  else
    return 17;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113f <main+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <main@plt>
mov    %eax,-0x4(%rbp)
jmp    1146 <main+0x36>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = call i32 @main(i32 %8)
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 17, i32* %2
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
ret i32 %12
}

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


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

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

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

LLVM IR (-O2):
define void @XcmsCIEXYZToCIEuvY() {
ret void
}
void ASN1_item_d2i_fp(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_d2i_fp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "convertilines conf.old conf.new\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    $0xffffffff,%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    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"convertilines conf.old conf.new\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"convertilines conf.old conf.new\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_server_info() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_server_info"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_context_get_server_info\00"
define i32 @pa_context_get_server_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
double exp(double);
double pow(double, int);
double q1(double p) {
  double q1, a, y1, y2, y3, y4, y5, d = 100.8, e = -106, f = -3745, indice = 0;
  q1 = d * exp(pow((p + e), 2) / f);
  return q1;
}


x86 assembly (clang, -O0):
<q1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
divsd  -0x58(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1>:
push   %rax
addsd  0xed7(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
divsd  0xecd(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @q1(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %2
store double 1.008000e+02, double* %10
store double -1.060000e+02, double* %11
store double -3.745000e+03, double* %12
store double 0.000000e+00, double* %13
%14 = load double, double* %10
%15 = load double, double* %2
%16 = load double, double* %11
%17 = fadd double %15, %16
%18 = call double @pow(double %17, i32 2)
%19 = load double, double* %12
%20 = fdiv double %18, %19
%21 = call double @exp(double %20)
%22 = fmul double %14, %21
store double %22, double* %3
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @q1(double %0) {
%2 = fadd double %0, -1.060000e+02
%3 = tail call double @pow(double %2, i32 2)
%4 = fdiv double %3, -3.745000e+03
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 1.008000e+02
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setColorStr(char *);
int main(int argc, char **argv) {
  setColorStr("\x2 1fs;");
  printf("Testando\n");
  printf("%d\n", 2);
  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)
lea    0xec3(%rip),%rdi
call   1040 <setColorStr@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <setColorStr@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\02 1fs;\00"
@.str.1 = [10 x i8] c"Testando\0A\00"
@.str.2 = [4 x i8] c"%d\0A\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 @setColorStr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"\02 1fs;\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [9 x i8] c"Testando\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @setColorStr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __PHYSFS_setError(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int remove(char const *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int __PHYSFS_platformDelete(const char *path) {
  if (remove(path) == -1) {
    __PHYSFS_setError(strerror(errno));
    return 0;
  };
  return (1);
}


x86 assembly (clang, -O0):
<__PHYSFS_platformDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0xffffffff,%eax
jne    116f <__PHYSFS_platformDelete+0x3f>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1040 <__PHYSFS_setError@plt>
movl   $0x0,-0x4(%rbp)
jmp    1176 <__PHYSFS_platformDelete+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__PHYSFS_platformDelete>:
push   %rax
call   1030 <remove@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1144 <__PHYSFS_platformDelete+0x14>
pop    %rcx
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1040 <__PHYSFS_setError@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__PHYSFS_platformDelete(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @__PHYSFS_setError(i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %9
}
vuser_end() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @vuser_end() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void foo(void) { exit(0); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int /*<<< orphan*/ ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
uint32_t getFileSize(FILE *fd) {
  fseek(fd, 0L, SEEK_END);
  uint32_t size = ftell(fd);
  rewind(fd);
  return size;
}


x86 assembly (clang, -O0):
<getFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileSize>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @getFileSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i64 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @getFileSize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i32 %4
}
int adswrap(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @adswrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @adswrap() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int write(int /*<<< orphan*/, char *, int);
void debug_putchar(char c) {
  int _ = write(STDOUT_FILENO, &c, 1);
  (void)_;
}


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

x86 assembly (clang, -O2):
<debug_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @debug_putchar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i32, i32* @STDOUT_FILENO
%5 = call i32 @write(i32 %4, i8* %2, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @debug_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @write(i32 %3, i8* %2, i32 1)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *entry) {
  list_replace(old, entry);
  INIT_LIST_HEAD(old);
}


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

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int rcu_gen_int32_hash_jenkins_impl(int);
int rcu_gen_int32_hash(int key) { return rcu_gen_int32_hash_jenkins_impl(key); }


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

x86 assembly (clang, -O2):
<rcu_gen_int32_hash>:
jmp    1030 <rcu_gen_int32_hash_jenkins_impl@plt>

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

LLVM IR (-O2):
define i32 @rcu_gen_int32_hash(i32 %0) {
%2 = tail call i32 @rcu_gen_int32_hash_jenkins_impl(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_mqtt_prepend_header(struct mg_connection *, int,
                                          int /*<<< orphan*/, int);
int /*<<< orphan*/ mg_send(struct mg_connection *, int /*<<< orphan*/ *, int);
void mg_mqtt_connack(struct mg_connection *nc, uint8_t return_code) {
  uint8_t unused = 0;
  mg_send(nc, &unused, 1);
  mg_send(nc, &return_code, 1);
  mg_mqtt_prepend_header(nc, 2, 0, 2);
}


x86 assembly (clang, -O0):
<mg_mqtt_connack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <mg_send@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <mg_send@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%ecx
xor    %edx,%edx
mov    %ecx,%esi
call   1040 <mg_mqtt_prepend_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_mqtt_connack>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <mg_send@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <mg_send@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x2,%ecx
call   1040 <mg_mqtt_prepend_header@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_connack(%struct.mg_connection* %0, i32 %1) {
%3 = alloca %struct.mg_connection*
%4 = alloca i32
%5 = alloca i32
store %struct.mg_connection* %0, %struct.mg_connection** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load %struct.mg_connection*, %struct.mg_connection** %3
%7 = call i32 @mg_send(%struct.mg_connection* %6, i32* %5, i32 1)
%8 = load %struct.mg_connection*, %struct.mg_connection** %3
%9 = call i32 @mg_send(%struct.mg_connection* %8, i32* %4, i32 1)
%10 = load %struct.mg_connection*, %struct.mg_connection** %3
%11 = call i32 @mg_mqtt_prepend_header(%struct.mg_connection* %10, i32 2, i32 0, i32 2)
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_connack(%struct.mg_connection* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @mg_send(%struct.mg_connection* %0, i32* %4, i32 1)
%7 = call i32 @mg_send(%struct.mg_connection* %0, i32* %3, i32 1)
%8 = call i32 @mg_mqtt_prepend_header(%struct.mg_connection* %0, i32 2, i32 0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemonize(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  daemonize("thanhtt daemon");
  sleep(1000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <daemonize@plt>
mov    $0x3e8,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <daemonize@plt>
mov    $0x3e8,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"thanhtt daemon\00"
define i32 @main() {
%1 = call i32 @daemonize(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 1000)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"thanhtt daemon\00"
define i32 @main() {
%1 = tail call i32 @daemonize(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int epoll_ctl(int, int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int delete_event(int epoll_fd, int socket_fd) {
  return epoll_ctl(epoll_fd, EPOLL_CTL_DEL, socket_fd, NULL);
}


x86 assembly (clang, -O0):
<delete_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <epoll_ctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_event>:
mov    %esi,%edx
mov    0x2edf(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <epoll_ctl@plt>

LLVM IR (-O0):
@EPOLL_CTL_DEL = global i32 0
define i32 @delete_event(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* @EPOLL_CTL_DEL
%7 = load i32, i32* %4
%8 = call i32 @epoll_ctl(i32 %5, i32 %6, i32 %7, i32* null)
ret i32 %8
}

LLVM IR (-O2):
@EPOLL_CTL_DEL = global i32 0
define i32 @delete_event(i32 %0, i32 %1) {
%3 = load i32, i32* @EPOLL_CTL_DEL
%4 = tail call i32 @epoll_ctl(i32 %0, i32 %3, i32 %1, i32* null)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ blink();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_stuff();
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_puts(char *);
void main(void) {
  uart_init();
  uart_puts("\n");
  printf("Eat more fish!\n");
  show_stuff();
  blink();
  uart_puts(" .. Spinning\n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <uart_init@plt>
lea    0xeac(%rip),%rdi
call   1070 <uart_puts@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <show_stuff@plt>
mov    $0x0,%al
call   1050 <blink@plt>
lea    0xe88(%rip),%rdi
call   1070 <uart_puts@plt>
jmp    118d <main+0x3d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <uart_init@plt>
lea    0xead(%rip),%rdi
call   1070 <uart_puts@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <show_stuff@plt>
xor    %eax,%eax
call   1050 <blink@plt>
lea    0xe7b(%rip),%rdi
call   1070 <uart_puts@plt>
nopw   0x0(%rax,%rax,1)
jmp    1190 <main+0x40>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [16 x i8] c"Eat more fish!\0A\00"
@.str.2 = [14 x i8] c" .. Spinning\0A\00"
define void @main() {
%1 = call i32 (...) @uart_init()
%2 = call i32 @uart_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @show_stuff()
%5 = call i32 (...) @blink()
%6 = call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %7, %0
br label %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.2 = [14 x i8] c" .. Spinning\0A\00"
@str = [15 x i8] c"Eat more fish!\00"
define void @main() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 @uart_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @show_stuff()
%5 = tail call i32 (...) @blink()
%6 = tail call i32 @uart_puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %7, %0
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void show_version() {
  printf("Sock2serial Version %s\n"
         "Copyright 1998-2015 Tencent Inc. All Rights Reserved.\n",
         "1.0beta");
  exit(1);
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xf1c(%rip),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf1f(%rip),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"Sock2serial Version %s\0ACopyright 1998-2015 Tencent Inc. All Rights Reserved.\0A\00"
@.str.1 = [8 x i8] c"1.0beta\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [78 x i8] c"Sock2serial Version %s\0ACopyright 1998-2015 Tencent Inc. All Rights Reserved.\0A\00"
@.str.1 = [8 x i8] c"1.0beta\00"
define void @show_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int lib2t11(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @lib2t11() {
ret i32 1
}

LLVM IR (-O2):
define i32 @lib2t11() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t USBControllerVersion(uint32_t ui32Base) {
  return ((*((volatile uint32_t *)(ui32Base + 0x00000FC0))) & 0x0000000F);
}


x86 assembly (clang, -O0):
<USBControllerVersion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfc0,%eax
cltq
mov    (%rax),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBControllerVersion>:
movslq %edi,%rax
mov    0xfc0(%rax),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @USBControllerVersion(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4032
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 15
ret i32 %8
}

LLVM IR (-O2):
define i32 @USBControllerVersion(i32 %0) {
%2 = add nsw i32 %0, 4032
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 15
ret i32 %6
}
void caller_2_1_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_1_2_2_1() {
ret void
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
__attribute__((always_, const)) uint32_t __bswap_variable_32(uint32_t x) {
  __asm__("bswapl %k0" : "=r"(x) : "0"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i8* @__bswap_variable_32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswapl ${0:k}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @__bswap_variable_32(i8* readnone %0) {
%2 = tail call i8* asm "bswapl ${0:k}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int main() {
  int *p, i = 100, j = 1, *q, *r;
  p = &j;
  q = &i;
  r = p;
  r = q;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int printf(char *, int, int, int, int);
int main(void) {
  int n = 42, m = 13;
  return printf("%lu, %lu, %lu, %lu\n", sizeof(long double[n + m]),
                sizeof(float *[n]), sizeof(long[n][m]),
                sizeof(int[n > 10 ? m + 1 : n]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
movl   $0xd,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,%eax
shl    $0x4,%rax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   %rcx,%rax
shl    $0x3,%rax
mov    %eax,-0x10(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    116f <main+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1175 <main+0x65>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%r8d
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x370,%esi
mov    $0x150,%edx
mov    $0x1110,%ecx
mov    $0x38,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%lu, %lu, %lu, %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
store i32 13, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = zext i32 %6 to i64
%8 = mul nuw i64 16, %7
%9 = trunc i64 %8 to i32
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = mul nuw i64 8, %11
%13 = trunc i64 %12 to i32
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = mul nuw i64 %15, %17
%19 = mul nuw i64 8, %18
%20 = trunc i64 %19 to i32
%21 = load i32, i32* %2
%22 = icmp sgt i32 %21, 10
br i1 %22, label %23, label %26
23: ; preds = %0
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
br label %28
26: ; preds = %0
%27 = load i32, i32* %2
br label %28
28: ; preds = %26, %23
%29 = phi i32 [ %25, %23 ], [ %27, %26 ]
%30 = zext i32 %29 to i64
%31 = mul nuw i64 4, %30
%32 = trunc i64 %31 to i32
%33 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13, i32 %20, i32 %32)
ret i32 %33
}

LLVM IR (-O2):
@.str = [20 x i8] c"%lu, %lu, %lu, %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 880, i32 336, i32 4368, i32 56)
ret i32 %1
}
void module1_section3_topic8() {}


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

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

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

LLVM IR (-O2):
define void @module1_section3_topic8() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello Git!\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello Git!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Hello Git!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double transition_rate_from_probabilities_with_hastings(double from, double to,
                                                        double num_from,
                                                        double num_to) {
  return (((1.) < ((num_from / num_to) * (to / from)))
              ? (1.)
              : ((num_from / num_to) * (to / from))) /
         num_from;
}


x86 assembly (clang, -O0):
<transition_rate_from_probabilities_with_hastings>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1154 <transition_rate_from_probabilities_with_hastings+0x54>
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1171 <transition_rate_from_probabilities_with_hastings+0x71>
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<transition_rate_from_probabilities_with_hastings>:
unpcklpd %xmm2,%xmm1
unpcklpd %xmm3,%xmm0
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm3
unpckhpd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
movsd  0xee0(%rip),%xmm0
minsd  %xmm3,%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @transition_rate_from_probabilities_with_hastings(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = fdiv double %9, %10
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fdiv double %12, %13
%15 = fmul double %11, %14
%16 = fcmp olt double 1.000000e+00, %15
br i1 %16, label %17, label %18
17: ; preds = %4
br label %26
18: ; preds = %4
%19 = load double, double* %7
%20 = load double, double* %8
%21 = fdiv double %19, %20
%22 = load double, double* %6
%23 = load double, double* %5
%24 = fdiv double %22, %23
%25 = fmul double %21, %24
br label %26
26: ; preds = %18, %17
%27 = phi double [ 1.000000e+00, %17 ], [ %25, %18 ]
%28 = load double, double* %7
%29 = fdiv double %27, %28
ret double %29
}

LLVM IR (-O2):
define double @transition_rate_from_probabilities_with_hastings(double %0, double %1, double %2, double %3) {
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = insertelement <2 x double> %5, double %2, i64 1
%7 = insertelement <2 x double> poison, double %0, i64 0
%8 = insertelement <2 x double> %7, double %3, i64 1
%9 = fdiv <2 x double> %6, %8
%10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%11 = fmul <2 x double> %9, %10
%12 = extractelement <2 x double> %11, i64 0
%13 = fcmp ogt double %12, 1.000000e+00
%14 = select i1 %13, double 1.000000e+00, double %12
%15 = fdiv double %14, %2
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double getObservationHeight() {
  double h;
  printf("Please enter the observation height (km): ");
  scanf("%lf", &h);
  return h;
}


x86 assembly (clang, -O0):
<getObservationHeight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getObservationHeight>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Please enter the observation height (km): \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @getObservationHeight() {
%1 = alloca double
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@.str = [43 x i8] c"Please enter the observation height (km): \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @getObservationHeight() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
ret double %5
}
/* Type definitions */
struct mngmsg {
  int dummy;
};
struct beststr {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *build_link_data(char **link_lib_file_p, struct mngmsg *m_msp,
                      struct beststr **bestp_arr, int debug) {
  int i, status;
  char tmp_line[32];
  char link_acc_file[512];
  int link_acc_fd;
  char *link_lib_file;
  char *link_lib_str;
  char link_script[4096];
  int link_lib_type;
  char *bp, *link_bp, *bp_s;
  FILE *link_fd = NULL;
  return NULL;
}


x86 assembly (clang, -O0):
<build_link_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movq   $0x0,-0x1298(%rbp)
xor    %eax,%eax
add    $0x1220,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mngmsg = type { i32 }
%struct.beststr = type { i32 }
define i8* @build_link_data(i8** %0, %struct.mngmsg* %1, %struct.beststr** %2, i32 %3) {
%5 = alloca i8**
%6 = alloca %struct.mngmsg*
%7 = alloca %struct.beststr**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [32 x i8]
%12 = alloca [512 x i8]
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca [4096 x i8]
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i32*
store i8** %0, i8*** %5
store %struct.mngmsg* %1, %struct.mngmsg** %6
store %struct.beststr** %2, %struct.beststr*** %7
store i32 %3, i32* %8
store i32* null, i32** %21
ret i8* null
}

LLVM IR (-O2):
%struct.mngmsg = type { i32 }
%struct.beststr = type { i32 }
define noalias i8* @build_link_data(i8** nocapture readnone %0, %struct.mngmsg* nocapture readnone %1, %struct.beststr** nocapture readnone %2, i32 %3) {
ret i8* null
}
void *netsnmp_generic_row_next(void *table, void *row) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @netsnmp_generic_row_next(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
void array_init(char *X, int size) {
  int i = 0;
  for (i = 0; i < size; i++)
    X[i] = 0;
}


x86 assembly (clang, -O0):
<array_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <array_init+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <array_init+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_init>:
test   %esi,%esi
jle    1122 <array_init+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @array_init(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a = 100;
  printf("%d", a);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 100)
%2 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_cmdline_tag(char *);
int /*<<< orphan*/ setup_core_tag(void *, int);
int /*<<< orphan*/ setup_end_tag();
int /*<<< orphan*/ setup_mem_tag(int, int);
void setup_tags(void *mem) {
  setup_core_tag(mem, 4096);
  setup_mem_tag(0xa0000000, 0x04000000);
  setup_mem_tag(0xc0000000, 0x04000000);
  setup_cmdline_tag("");
  setup_end_tag();
}


x86 assembly (clang, -O0):
<setup_tags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1000,%esi
call   1050 <setup_core_tag@plt>
mov    $0xa0000000,%edi
mov    $0x4000000,%esi
call   1040 <setup_mem_tag@plt>
mov    $0xc0000000,%edi
mov    $0x4000000,%esi
call   1040 <setup_mem_tag@plt>
lea    0xe81(%rip),%rdi
call   1060 <setup_cmdline_tag@plt>
mov    $0x0,%al
call   1030 <setup_end_tag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_tags>:
push   %rax
mov    $0x1000,%esi
call   1050 <setup_core_tag@plt>
mov    $0xa0000000,%edi
mov    $0x4000000,%esi
call   1040 <setup_mem_tag@plt>
mov    $0xc0000000,%edi
mov    $0x4000000,%esi
call   1040 <setup_mem_tag@plt>
lea    0xe90(%rip),%rdi
call   1060 <setup_cmdline_tag@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <setup_end_tag@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @setup_tags(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @setup_core_tag(i8* %3, i32 4096)
%5 = call i32 @setup_mem_tag(i32 -1610612736, i32 67108864)
%6 = call i32 @setup_mem_tag(i32 -1073741824, i32 67108864)
%7 = call i32 @setup_cmdline_tag(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @setup_end_tag()
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @setup_tags(i8* %0) {
%2 = tail call i32 @setup_core_tag(i8* %0, i32 4096)
%3 = tail call i32 @setup_mem_tag(i32 -1610612736, i32 67108864)
%4 = tail call i32 @setup_mem_tag(i32 -1073741824, i32 67108864)
%5 = tail call i32 @setup_cmdline_tag(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @setup_end_tag()
ret void
}
/* Type definitions */
struct ptr_list {
  int dummy;
};
struct pseudo_list {
  int dummy;
};

/* Variables and functions */
int ptr_list_size(struct ptr_list *);
int pseudo_list_size(struct pseudo_list *list) {
  return ptr_list_size((struct ptr_list *)(list));
}


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

x86 assembly (clang, -O2):
<pseudo_list_size>:
jmp    1030 <ptr_list_size@plt>

LLVM IR (-O0):
%struct.pseudo_list = type { i32 }
%struct.ptr_list = type { i32 }
define i32 @pseudo_list_size(%struct.pseudo_list* %0) {
%2 = alloca %struct.pseudo_list*
store %struct.pseudo_list* %0, %struct.pseudo_list** %2
%3 = load %struct.pseudo_list*, %struct.pseudo_list** %2
%4 = bitcast %struct.pseudo_list* %3 to %struct.ptr_list*
%5 = call i32 @ptr_list_size(%struct.ptr_list* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.pseudo_list = type { i32 }
%struct.ptr_list = type { i32 }
define i32 @pseudo_list_size(%struct.pseudo_list* %0) {
%2 = bitcast %struct.pseudo_list* %0 to %struct.ptr_list*
%3 = tail call i32 @ptr_list_size(%struct.ptr_list* %2)
ret i32 %3
}