xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, char *);
int /*<<< orphan*/ system(char *);
void gestion_erreurs_set(int line, char *_file, char *_msg) {
  char _temp[1024];
  sprintf(_temp, "Error !\nFile: %s\nLine: %i\n%s", _file, line, _msg);
  printf(_temp);
  system("PAUSE");
  exit(0);
}


x86 assembly (clang, -O0):
<gestion_erreurs_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe91(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x420(%rbp),%rdi
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
call   1030 <system@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<gestion_erreurs_set>:
push   %rbx
sub    $0x400,%rsp
mov    %rdx,%r8
mov    %rsi,%rdx
mov    %edi,%ecx
lea    0xea9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
call   1030 <system@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error !\0AFile: %s\0ALine: %i\0A%s\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define void @gestion_erreurs_set(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i32 @printf(i8* %13)
%15 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Error !\0AFile: %s\0ALine: %i\0A%s\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define void @gestion_erreurs_set(i32 %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0, i8* %2)
%7 = call i32 @printf(i8* %5)
%8 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, double *);
int main() {
  int time;
  double distance, totalFuel;
  scanf("%d %lf", &time, &distance);
  totalFuel = (time * 1.0 * distance) / 12;
  printf("%.3lf\n", totalFuel);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl 0xc(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
divsd  0xeb2(%rip),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, double* %3)
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+00
%9 = load double, double* %3
%10 = fmul double %8, %9
%11 = fdiv double %10, 1.200000e+01
store double %11, double* %4
%12 = load double, double* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [7 x i8] c"%.3lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2)
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = load double, double* %2
%9 = fmul double %8, %7
%10 = fdiv double %9, 1.200000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
int update_rrd(int probe, float temp) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @update_rrd(i32 %0, float %1) {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_clear_mixed_cell_configuration(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(94, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_clear_mixed_cell_configuration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x5e,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_clear_mixed_cell_configuration>:
mov    $0x5e,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @celcon_clear_mixed_cell_configuration() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 94, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_clear_mixed_cell_configuration() {
%1 = tail call i32 @_ada_use_c2phc(i32 94, i32* undef, i32* undef, double* undef)
ret i32 %1
}
int cp936ext_wctomb(void *conv, unsigned char *r, unsigned int wc, int n) {
  return 0;
}


x86 assembly (clang, -O0):
<cp936ext_wctomb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cp936ext_wctomb(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int close(int);
int close_tty(int device) { return close(device); }


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

x86 assembly (clang, -O2):
<close_tty>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @close_tty(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
__attribute__((constructor)) void gcc_init(void) {
  init_lib_wrapper(__FUNCTION__);
}


x86 assembly (clang, -O0):
<gcc_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <init_lib_wrapper@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcc_init>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <init_lib_wrapper@plt>

LLVM IR (-O0):
@__FUNCTION__.gcc_init = [9 x i8] c"gcc_init\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @gcc_init, i8* null }]
define void @gcc_init() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @init_lib_wrapper to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.gcc_init, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.gcc_init = [9 x i8] c"gcc_init\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @gcc_init, i8* null }]
define void @gcc_init() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @init_lib_wrapper to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.gcc_init, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genExtra3(char *);
void FOO_FOO_() { genExtra3("#define FSUB1(name) SUFFIX(UPCASE(name))"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"#define FSUB1(name) SUFFIX(UPCASE(name))\00"
define void @FOO_FOO_() {
%1 = call i32 @genExtra3(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"#define FSUB1(name) SUFFIX(UPCASE(name))\00"
define void @FOO_FOO_() {
%1 = tail call i32 @genExtra3(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void prompt(void) {
  fputc(13, stdout);
  fputc('>', stdout);
  fputc(' ', stdout);
  return;
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0xd,%edi
call   1030 <fputc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0x3e,%edi
call   1030 <fputc@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0xd,%edi
call   1030 <fputc@plt>
mov    (%rbx),%esi
mov    $0x3e,%edi
call   1030 <fputc@plt>
mov    (%rbx),%esi
mov    $0x20,%edi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @prompt() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputc(i8 signext 13, i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fputc(i8 signext 62, i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fputc(i8 signext 32, i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @prompt() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputc(i8 signext 13, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputc(i8 signext 62, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputc(i8 signext 32, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void swap(int m, int n) {
  int temp;
  temp = m;
  m = n;
  n = temp;
  printf("m = %d\t n = %d\n", m, n);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"m = %d\09 n = %d\0A\00"
define void @swap(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
unsigned char mb_is_little_endian(void) {
  int i = 1;
  return ((char *)&i)[0] == 1;
}


x86 assembly (clang, -O0):
<mb_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movsbl -0x4(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @mb_is_little_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 0
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @mb_is_little_endian() {
ret i8 1
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int initgroups(const char *user, gid_t group) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<initgroups>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<initgroups>:
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 @initgroups(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %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 @initgroups(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t get_size() { return 4096; }


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

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

LLVM IR (-O0):
define i32 @get_size() {
ret i32 4096
}

LLVM IR (-O2):
define i32 @get_size() {
ret i32 4096
}
/* Type definitions */
typedef int /*<<< orphan*/ packet;
typedef void *int16_t;

/* Variables and functions */
int /*<<< orphan*/ context_error(int);
int /*<<< orphan*/ message_pair(int, char *, int);
void *swap2(void *);
void QMMarkMapping(int16_t fno, int16_t state) {
  struct {
    int16_t fno;
    int16_t state;
  } packet;
  if (!context_error(1)) {
    packet.fno = swap2(fno);
    packet.state = swap2(state);
    message_pair(46, (char *)&packet, sizeof(packet));
  }
}


x86 assembly (clang, -O0):
<QMMarkMapping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <context_error@plt>
cmp    $0x0,%eax
jne    1180 <QMMarkMapping+0x50>
mov    -0x8(%rbp),%rdi
call   1050 <swap2@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <swap2@plt>
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x2e,%edi
mov    $0x10,%edx
call   1040 <message_pair@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QMMarkMapping>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <context_error@plt>
test   %eax,%eax
jne    1179 <QMMarkMapping+0x49>
mov    %rbx,%rdi
call   1050 <swap2@plt>
mov    %rax,0x8(%rsp)
mov    %r14,%rdi
call   1050 <swap2@plt>
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x2e,%edi
mov    $0x10,%edx
call   1040 <message_pair@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i8* }
define void @QMMarkMapping(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.anon
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 @context_error(i32 1)
%7 = icmp ne i32 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i8* @swap2(i8* %9)
%11 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 0
store i8* %10, i8** %11
%12 = load i8*, i8** %4
%13 = call i8* @swap2(i8* %12)
%14 = getelementptr inbounds %struct.anon, %struct.anon* %5, i32 0, i32 1
store i8* %13, i8** %14
%15 = bitcast %struct.anon* %5 to i8*
%16 = call i32 @message_pair(i32 46, i8* %15, i32 16)
br label %17
17: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.anon = type { i8*, i8* }
define void @QMMarkMapping(i8* %0, i8* %1) {
%3 = alloca %struct.anon
%4 = bitcast %struct.anon* %3 to i8*
%5 = tail call i32 @context_error(i32 1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = tail call i8* @swap2(i8* %0)
%9 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 0
store i8* %8, i8** %9
%10 = tail call i8* @swap2(i8* %1)
%11 = getelementptr inbounds %struct.anon, %struct.anon* %3, i64 0, i32 1
store i8* %10, i8** %11
%12 = call i32 @message_pair(i32 46, i8* %4, i32 16)
br label %13
13: ; preds = %7, %2
ret void
}
int x40_process_request(struct mypacket *packet) { return 0; }


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

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

LLVM IR (-O0):
%struct.mypacket = type opaque
define i32 @x40_process_request(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
store %struct.mypacket* %0, %struct.mypacket** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x40_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int write_socket(int, char *, int);
int write_socket_len(int fd, char *buf) {
  int len;
  len = strlen(buf);
  if (write_socket(fd, buf, len) < len)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<write_socket_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write_socket@plt>
cmp    -0x14(%rbp),%eax
jge    115f <write_socket_len+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1166 <write_socket_len+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_socket_len>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write_socket@plt>
xor    %ecx,%ecx
cmp    %ebp,%eax
setge  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @write_socket_len(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write_socket(i32 %0, i8* %1, i32 %3)
%5 = icmp sge i32 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int fibo(int n) {
  if (n == 0 || n == 1) {
    return n;
  } else {
    return fibo(n - 1) + fibo(n - 2) + (n - 1);
  }
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <fibo+0x1f>
cmpl   $0x1,-0x8(%rbp)
jne    113a <fibo+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <fibo+0x55>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    $0x1,%edi
jbe    1136 <fibo+0x26>
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
mov    %eax,%r14d
lea    -0x2(%rbx),%edi
call   1030 <fibo@plt>
add    %r14d,%ebx
add    $0xffffffff,%ebx
add    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %11, %5 ], [ %0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add nsw i32 %0, -2
%9 = tail call i32 @fibo(i32 %8)
%10 = add i32 %7, %6
%11 = add i32 %10, %9
br label %3
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
size_t read(int, void *, size_t);
void write_X(int fd, void *buf, size_t count) {
  ssize_t writed = read(fd, buf, count);
  if (writed != count) {
    do {
      perror("write");
      exit(EXIT_FAILURE);
    } while (0);
  }
}


x86 assembly (clang, -O0):
<write_X>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1184 <write_X+0x54>
jmp    116a <write_X+0x3a>
lea    0xe8f(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_X>:
push   %rbx
mov    %rdx,%rbx
call   1030 <read@plt>
cmp    %rbx,%rax
jne    1140 <write_X+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"write\00"
@EXIT_FAILURE = global i32 0
define void @write_X(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @read(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = load i64, i64* %6
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %3
br label %16
16: ; preds = %15
%17 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; No predecessors!
br label %21
21: ; preds = %20, %3
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
@EXIT_FAILURE = global i32 0
define void @write_X(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, %2
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret void
}
void __attribute__((always_)) dINT(void) { asm volatile("cli"); }


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

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

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

LLVM IR (-O2):
define void @dINT() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int btrfs_test_inodes(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @btrfs_test_inodes() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LogFunc(int, char *, char const *, unsigned int,
                           char const *, char const *);
void LogAssertFailed(const char *expr, const char *fileName, unsigned lineNum,
                     const char *function) {
  LogFunc(2, "%s: %d: %s Assertion '%s' failed.\n", fileName, lineNum, function,
          expr);
}


x86 assembly (clang, -O0):
<LogAssertFailed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    $0x2,%edi
lea    0xebe(%rip),%rsi
call   1030 <LogFunc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogAssertFailed>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r9
lea    0xede(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <LogFunc@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"%s: %d: %s Assertion '%s' failed.\0A\00"
define void @LogAssertFailed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = load i8*, i8** %8
%12 = load i8*, i8** %5
%13 = call i32 @LogFunc(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s: %d: %s Assertion '%s' failed.\0A\00"
define void @LogAssertFailed(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @LogFunc(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* %0)
ret void
}
void mdp4_overlay_dtv_set_perf(struct msm_fb_data_type *mfd) { return; }


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

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

LLVM IR (-O0):
%struct.msm_fb_data_type = type opaque
define void @mdp4_overlay_dtv_set_perf(%struct.msm_fb_data_type* %0) {
%2 = alloca %struct.msm_fb_data_type*
store %struct.msm_fb_data_type* %0, %struct.msm_fb_data_type** %2
ret void
}

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
define void @mdp4_overlay_dtv_set_perf(%struct.msm_fb_data_type* nocapture %0) {
ret void
}
int get_motor_done(int motor) {}


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

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

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

LLVM IR (-O2):
define i32 @get_motor_done(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int gNot(int /*<<< orphan*/);
int /*<<< orphan*/ gOr(int, int);
int gNor(int a, int b) { return gNot(gOr(a, b)); }


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

x86 assembly (clang, -O2):
<gNor>:
push   %rax
call   1030 <gOr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gNot@plt>

LLVM IR (-O0):
define i32 @gNor(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 = call i32 @gOr(i32 %5, i32 %6)
%8 = call i32 @gNot(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @gNor(i32 %0, i32 %1) {
%3 = tail call i32 @gOr(i32 %0, i32 %1)
%4 = tail call i32 @gNot(i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
ex16() {
  int d;
  d = getchar() != EOF;
  printf("\n%d\n", d);
}


x86 assembly (clang, -O0):
<ex16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex16>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @ex16() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @ex16() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 undef
}
int hash_bits(unsigned int *p, int m, struct INPARA *para) {
  return (p[0] % m);
}


x86 assembly (clang, -O0):
<hash_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_bits>:
mov    (%rdi),%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
%struct.INPARA = type opaque
define i32 @hash_bits(i32* %0, i32 %1, %struct.INPARA* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %struct.INPARA*
store i32* %0, i32** %4
store i32 %1, i32* %5
store %struct.INPARA* %2, %struct.INPARA** %6
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = urem i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.INPARA = type opaque
define i32 @hash_bits(i32* nocapture %0, i32 %1, %struct.INPARA* nocapture readnone %2) {
%4 = load i32, i32* %0
%5 = urem i32 %4, %1
ret i32 %5
}
int min_int(int x, int y) {
  if (x < y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <min_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min_int+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello world!\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 = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ unknown_function();
void differentiate_array_info_Bad() {
  int *p;
  if (unknown_function()) {
    p = (int *)malloc(sizeof(int) * 5);
  } else {
    p = (int *)malloc(sizeof(int) * 10);
    p = p + 5;
  }
  p[5] = 0;
}


x86 assembly (clang, -O0):
<differentiate_array_info_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <unknown_function@plt>
cmp    $0x0,%rax
je     114c <differentiate_array_info_Bad+0x2c>
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1166 <differentiate_array_info_Bad+0x46>
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<differentiate_array_info_Bad>:
push   %rax
xor    %eax,%eax
call   1040 <unknown_function@plt>
test   %rax,%rax
je     1139 <differentiate_array_info_Bad+0x19>
mov    $0x14,%edi
call   1030 <malloc@plt>
jmp    1147 <differentiate_array_info_Bad+0x27>
mov    $0x28,%edi
call   1030 <malloc@plt>
add    $0x14,%rax
movl   $0x0,0x14(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @differentiate_array_info_Bad() {
%1 = alloca i32*
%2 = call i64 (...) @unknown_function()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 @malloc(i32 20)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %1
br label %12
7: ; preds = %0
%8 = call i64 @malloc(i32 40)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %1
%10 = load i32*, i32** %1
%11 = getelementptr inbounds i32, i32* %10, i64 5
store i32* %11, i32** %1
br label %12
12: ; preds = %7, %4
%13 = load i32*, i32** %1
%14 = getelementptr inbounds i32, i32* %13, i64 5
store i32 0, i32* %14
ret void
}

LLVM IR (-O2):
define void @differentiate_array_info_Bad() {
%1 = tail call i64 (...) @unknown_function()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @malloc(i32 20)
%5 = inttoptr i64 %4 to i32*
br label %10
6: ; preds = %0
%7 = tail call i64 @malloc(i32 40)
%8 = inttoptr i64 %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 5
br label %10
10: ; preds = %6, %3
%11 = phi i32* [ %5, %3 ], [ %9, %6 ]
%12 = getelementptr inbounds i32, i32* %11, i64 5
store i32 0, i32* %12
ret void
}
int fib(int n) { return (n < 2) ? 1 : fib(n - 1) + fib(n - 2); }


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1132 <fib+0x22>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <fib+0x45>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @fib(i32 %8)
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 2
%12 = call i32 @fib(i32 %11)
%13 = add nsw i32 %9, %12
br label %14
14: ; preds = %6, %5
%15 = phi i32 [ 1, %5 ], [ %13, %6 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *, int *);
void checkIntInput(int *x, int *y) {
  if ((scanf("%d %d", x, y)) != 2) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkIntInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1177 <checkIntInput+0x47>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIntInput>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xec2(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    114a <checkIntInput+0x1a>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(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 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %6)
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(i32* %0, i32* %1) {
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0, i32* %1)
%4 = icmp eq i32 %3, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
double tanh(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.tanh = [5 x i8] c"tanh\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.tanh, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.tanh = [5 x i8] c"tanh\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @tanh(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.tanh, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_init1() {
  printf("main_init1"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"main_init1\00"
define void @main_init1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char *, int, char *, int);
int anetTcpNonBlockBestEffortBindConnect(char *err, char *addr, int port,
                                         char *source_addr) {
  return anetTcpGenericConnect(err, addr, port, source_addr, 1 | 2);
}


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

x86 assembly (clang, -O2):
<anetTcpNonBlockBestEffortBindConnect>:
mov    $0x3,%r8d
jmp    1030 <anetTcpGenericConnect@plt>

LLVM IR (-O0):
define i32 @anetTcpNonBlockBestEffortBindConnect(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @anetTcpGenericConnect(i8* %9, i8* %10, i32 %11, i8* %12, i32 3)
ret i32 %13
}

LLVM IR (-O2):
define i32 @anetTcpNonBlockBestEffortBindConnect(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i8* %3, i32 3)
ret i32 %5
}
/* Variables and functions */
double UINT32_MAX;
double xor128();
double genrand_real2(void) { return xor128() * (1.0 / (UINT32_MAX + 1.0)); }


x86 assembly (clang, -O0):
<genrand_real2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <xor128@plt>
movsd  0xedd(%rip),%xmm2
mov    0x2ece(%rip),%rax
addsd  (%rax),%xmm2
movsd  0xeca(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real2>:
push   %rax
xor    %eax,%eax
call   1030 <xor128@plt>
mov    0x2ed9(%rip),%rax
movsd  0xed9(%rip),%xmm1
movsd  (%rax),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@UINT32_MAX = global double 0.000000e+00
define double @genrand_real2() {
%1 = call double (...) @xor128()
%2 = load double, double* @UINT32_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double 1.000000e+00, %3
%5 = fmul double %1, %4
ret double %5
}

LLVM IR (-O2):
@UINT32_MAX = global double 0.000000e+00
define double @genrand_real2() {
%1 = tail call double (...) @xor128()
%2 = load double, double* @UINT32_MAX
%3 = fadd double %2, 1.000000e+00
%4 = fdiv double 1.000000e+00, %3
%5 = fmul double %1, %4
ret double %5
}
void map_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @map_fini() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_con_dil_function_list();
void con_dil_init() { register_con_dil_function_list(); }


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

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

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

LLVM IR (-O2):
define void @con_dil_init() {
%1 = tail call i32 (...) @register_con_dil_function_list()
ret void
}
void caller_1_2_1_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_1_1_2_1_2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned char, int /*<<< orphan*/ *);
int write_midi_byte(unsigned char c, FILE *fp) {
  putc(c, fp);
  return 1;
}


x86 assembly (clang, -O0):
<write_midi_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <putc@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_midi_byte>:
push   %rax
call   1030 <putc@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @write_midi_byte(i8 zeroext %0, i32* nocapture %1) {
%3 = tail call i32 @putc(i8 zeroext %0, i32* %1)
ret i32 1
}