xunge/DecIR huggingface dataset:
void LightControllerSpy_Destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @LightControllerSpy_Destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void panic(char *str) {
  fprintf(stderr, "%s\n", str);
  exit(2);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @panic(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
void macosxCG_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @macosxCG_dummy() {
ret void
}
/* Variables and functions */
int fsync(int);
int full_fsync(int fd, int fullSync, int dataOnly) {
  int rc;
  if (dataOnly) {
    rc = fsync(fd);
  } else {
    rc = fsync(fd);
  }
  return rc;
}


x86 assembly (clang, -O0):
<full_fsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113b <full_fsync+0x2b>
mov    -0x4(%rbp),%edi
call   1030 <fsync@plt>
mov    %eax,-0x10(%rbp)
jmp    1146 <full_fsync+0x36>
mov    -0x4(%rbp),%edi
call   1030 <fsync@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_fsync>:
jmp    1030 <fsync@plt>

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

LLVM IR (-O2):
define i32 @full_fsync(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fsync(i32 %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AuxMagSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void AuxMagSettingsLogging() { UAVObjLogging(AuxMagSettingsHandle()); }


x86 assembly (clang, -O0):
<AuxMagSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AuxMagSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AuxMagSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <AuxMagSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @AuxMagSettingsLogging() {
%1 = call i32 (...) @AuxMagSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AuxMagSettingsLogging() {
%1 = tail call i32 (...) @AuxMagSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
__attribute__((used)) int func_attr_used_enabled(int val) { return val + 1; }


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

x86 assembly (clang, -O2):
<func_attr_used_enabled>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @func_attr_used_enabled to i8*)], section "llvm.metadata"
define i32 @func_attr_used_enabled(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @func_attr_used_enabled to i8*)], section "llvm.metadata"
define i32 @func_attr_used_enabled(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
long get_fpscr(void) {
  return (union {
           double f;
           long i;
         }){get_fpscr_f()}
      .i;
}


x86 assembly (clang, -O0):
<get_fpscr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_fpscr_f@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fpscr>:
push   %rax
xor    %eax,%eax
call   1030 <get_fpscr_f@plt>
cvtsi2sd %eax,%xmm0
movq   %xmm0,%rax
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { double }
define i64 @get_fpscr() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to double*
%3 = call i32 (...) @get_fpscr_f()
%4 = sitofp i32 %3 to double
store double %4, double* %2
%5 = bitcast %union.anon* %1 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_fpscr() {
%1 = tail call i32 (...) @get_fpscr_f()
%2 = sitofp i32 %1 to double
%3 = bitcast double %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_get_host_name_malloc() {
  printf("NOT IMPLEMENTED:"
         "pa_get_host_name_malloc"
         "\n");
}


x86 assembly (clang, -O0):
<pa_get_host_name_malloc>:
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_get_host_name_malloc>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_get_host_name_malloc\00"
define i32 @pa_get_host_name_malloc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct iam_rec {
  int dummy;
};
struct iam_leaf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert_corr(int /*<<< orphan*/);
struct iam_rec *e_rec(int /*<<< orphan*/);
int /*<<< orphan*/ n_at_rec(struct iam_leaf const *);
int /*<<< orphan*/ n_cur(struct iam_leaf const *);
struct iam_rec *lvar_rec(const struct iam_leaf *l) {
  assert_corr(n_at_rec(l));
  return e_rec(n_cur(l));
}


x86 assembly (clang, -O0):
<lvar_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <n_at_rec@plt>
mov    %eax,%edi
call   1050 <assert_corr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <n_cur@plt>
mov    %eax,%edi
call   1060 <e_rec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvar_rec>:
push   %rbx
mov    %rdi,%rbx
call   1040 <n_at_rec@plt>
mov    %eax,%edi
call   1050 <assert_corr@plt>
mov    %rbx,%rdi
call   1030 <n_cur@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <e_rec@plt>

LLVM IR (-O0):
%struct.iam_rec = type { i32 }
%struct.iam_leaf = type { i32 }
define %struct.iam_rec* @lvar_rec(%struct.iam_leaf* %0) {
%2 = alloca %struct.iam_leaf*
store %struct.iam_leaf* %0, %struct.iam_leaf** %2
%3 = load %struct.iam_leaf*, %struct.iam_leaf** %2
%4 = call i32 @n_at_rec(%struct.iam_leaf* %3)
%5 = call i32 @assert_corr(i32 %4)
%6 = load %struct.iam_leaf*, %struct.iam_leaf** %2
%7 = call i32 @n_cur(%struct.iam_leaf* %6)
%8 = call %struct.iam_rec* @e_rec(i32 %7)
ret %struct.iam_rec* %8
}

LLVM IR (-O2):
%struct.iam_rec = type { i32 }
%struct.iam_leaf = type { i32 }
define %struct.iam_rec* @lvar_rec(%struct.iam_leaf* %0) {
%2 = tail call i32 @n_at_rec(%struct.iam_leaf* %0)
%3 = tail call i32 @assert_corr(i32 %2)
%4 = tail call i32 @n_cur(%struct.iam_leaf* %0)
%5 = tail call %struct.iam_rec* @e_rec(i32 %4)
ret %struct.iam_rec* %5
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
unsigned int barrier_wait(unsigned int index) {
  return sys_call(0x19, index, 0, 0, 0);
}


x86 assembly (clang, -O0):
<barrier_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x19,%edi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <sys_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<barrier_wait>:
mov    %edi,%esi
mov    $0x19,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

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

LLVM IR (-O2):
define i32 @barrier_wait(i32 %0) {
%2 = tail call i32 @sys_call(i32 25, i32 %0, i32 0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
void startElement(void *userData, const char *name, const char **atts) {
  printf("startElem:");
  printf(name);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<startElement>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"startElem:\00"
define void @startElement(i8* nocapture readnone %0, i8* nocapture %1, i8** nocapture readnone %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) %1)
%6 = tail call i32 @putchar(i32 10)
ret void
}
int swapShortEndianness(short input) {
  int output = 0;
  for (int i = 0; i < 2; i++) {
    *((char *)&output - i + 1) = *((char *)&input + i);
  }
  return output;
}


x86 assembly (clang, -O0):
<swapShortEndianness>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1146 <swapShortEndianness+0x46>
movslq -0xc(%rbp),%rax
mov    -0x2(%rbp,%rax,1),%cl
movslq -0xc(%rbp),%rdx
xor    %eax,%eax
sub    %rdx,%rax
mov    %cl,-0x7(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <swapShortEndianness+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapShortEndianness>:
rol    $0x8,%di
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @swapShortEndianness(i16 signext %0) {
%2 = call i16 @llvm.bswap.i16(i16 %0)
%3 = zext i16 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
double ts_to_seconds(struct timespec t) { return t.tv_sec + t.tv_nsec / 1E9; }


x86 assembly (clang, -O0):
<ts_to_seconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_to_seconds>:
cvtsi2sd %edi,%xmm1
divsd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
define double @ts_to_seconds(double %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { double, i32 }*
%5 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 1
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+09
%13 = fadd double %8, %12
ret double %13
}

LLVM IR (-O2):
define double @ts_to_seconds(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fdiv double %3, 1.000000e+09
%5 = fadd double %4, %0
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigchld_handler(int signal_number) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
double e2rhomoist(double embar, double presmbar, double tk) {
  double myrd, rhotot;
  myrd = 2.8704;
  rhotot = (presmbar / (myrd * tk)) * (1.0 - ((0.378 * embar) / presmbar));
  return (rhotot);
}


x86 assembly (clang, -O0):
<e2rhomoist>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm2
mulsd  -0x8(%rbp),%xmm2
divsd  -0x10(%rbp),%xmm2
movsd  0xeb3(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<e2rhomoist>:
mulsd  0xef8(%rip),%xmm2
mulsd  0xef8(%rip),%xmm0
unpcklpd %xmm1,%xmm0
unpcklpd %xmm2,%xmm1
divpd  %xmm1,%xmm0
movsd  0xeec(%rip),%xmm1
subsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @e2rhomoist(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
store double 2.870400e+00, double* %7
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = fdiv double %9, %12
%14 = load double, double* %4
%15 = fmul double 3.780000e-01, %14
%16 = load double, double* %5
%17 = fdiv double %15, %16
%18 = fsub double 1.000000e+00, %17
%19 = fmul double %13, %18
store double %19, double* %8
%20 = load double, double* %8
ret double %20
}

LLVM IR (-O2):
define double @e2rhomoist(double %0, double %1, double %2) {
%4 = fmul double %2, 2.870400e+00
%5 = fmul double %0, 3.780000e-01
%6 = insertelement <2 x double> poison, double %1, i64 1
%7 = insertelement <2 x double> %6, double %5, i64 0
%8 = insertelement <2 x double> poison, double %1, i64 0
%9 = insertelement <2 x double> %8, double %4, i64 1
%10 = fdiv <2 x double> %7, %9
%11 = extractelement <2 x double> %10, i64 0
%12 = fsub double 1.000000e+00, %11
%13 = extractelement <2 x double> %10, i64 1
%14 = fmul double %12, %13
ret double %14
}
int SEQU() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @SEQU() {
ret i32 0
}
/* Variables and functions */
float exp(float);
float log(float);
float log_conv(float x0, float X, float y0, float Y) {
  return (X + log(x0 + (y0 * exp(Y - X))));
}


x86 assembly (clang, -O0):
<log_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movss  -0x1c(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x18(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_conv>:
sub    $0x18,%rsp
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
subss  %xmm1,%xmm3
movaps %xmm3,%xmm0
call   1030 <exp@plt>
mulss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
call   1040 <log@plt>
addss  0x14(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @log_conv(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float, float* %5
%11 = load float, float* %7
%12 = load float, float* %8
%13 = load float, float* %6
%14 = fsub float %12, %13
%15 = call float @exp(float %14)
%16 = call float @llvm.fmuladd.f32(float %11, float %15, float %10)
%17 = call float @log(float %16)
%18 = fadd float %9, %17
ret float %18
}

LLVM IR (-O2):
define float @log_conv(float %0, float %1, float %2, float %3) {
%5 = fsub float %3, %1
%6 = tail call float @exp(float %5)
%7 = tail call float @llvm.fmuladd.f32(float %2, float %6, float %0)
%8 = tail call float @log(float %7)
%9 = fadd float %8, %1
ret float %9
}
unsigned int fibo(unsigned int n) {
  if (n <= 1)
    return n;
  else
    return fibo(n - 1) + fibo(n - 2);
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
ja     1130 <fibo+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibo+0x43>
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    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jb     1132 <fibo+0x22>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1120 <fibo+0x10>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 ule i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub i32 %9, 1
%11 = call i32 @fibo(i32 %10)
%12 = load i32, i32* %3
%13 = sub i32 %12, 2
%14 = call i32 @fibo(i32 %13)
%15 = add i32 %11, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %8, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fibo(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello world"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct opt_set {
  int dummy;
};

/* Variables and functions */
char const *set_get_value(struct opt_set *, char const *);
const char *smbftpd_chroot_path_get(struct opt_set *set, const char *user) {
  return set_get_value(set, user);
}


x86 assembly (clang, -O0):
<smbftpd_chroot_path_get>:
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   1030 <set_get_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbftpd_chroot_path_get>:
jmp    1030 <set_get_value@plt>

LLVM IR (-O0):
%struct.opt_set = type { i32 }
define i8* @smbftpd_chroot_path_get(%struct.opt_set* %0, i8* %1) {
%3 = alloca %struct.opt_set*
%4 = alloca i8*
store %struct.opt_set* %0, %struct.opt_set** %3
store i8* %1, i8** %4
%5 = load %struct.opt_set*, %struct.opt_set** %3
%6 = load i8*, i8** %4
%7 = call i8* @set_get_value(%struct.opt_set* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.opt_set = type { i32 }
define i8* @smbftpd_chroot_path_get(%struct.opt_set* %0, i8* %1) {
%3 = tail call i8* @set_get_value(%struct.opt_set* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ glutVisibilityFunc(void (*)(int));
void s2winVisibilityFunc(void (*func)(int state)) { glutVisibilityFunc(func); }


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

x86 assembly (clang, -O2):
<s2winVisibilityFunc>:
jmp    1030 <glutVisibilityFunc@plt>

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

LLVM IR (-O2):
define void @s2winVisibilityFunc(void (i32)* %0) {
%2 = tail call i32 @glutVisibilityFunc(void (i32)* %0)
ret void
}
/* Variables and functions */
int syscall(int, int, int);
int flock(int fd, int operation) { return syscall(143, fd, operation); }


x86 assembly (clang, -O0):
<flock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x8f,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flock>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x8f,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @flock(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 @syscall(i32 143, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @flock(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 143, i32 %0, i32 %1)
ret i32 %3
}
int jacFun_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @jacFun_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @jacFun_n_in() {
ret i32 2
}
void trc_s() {}


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

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

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

LLVM IR (-O2):
define void @trc_s() {
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int lseek(int, scalar_t__, int /*<<< orphan*/);
int seek_set(int fd, off_t pos) {
  return (fd == -1 || lseek(fd, (off_t)pos, SEEK_SET) == -1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<seek_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0xffffffff,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     114c <seek_set+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek_set>:
cmp    $0xffffffff,%edi
je     1133 <seek_set+0x23>
push   %rax
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @seek_set(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -1
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i64, i64* %4
%10 = load i32, i32* @SEEK_SET
%11 = call i32 @lseek(i32 %8, i64 %9, i32 %10)
%12 = icmp eq i32 %11, -1
br label %13
13: ; preds = %7, %2
%14 = phi i1 [ true, %2 ], [ %12, %7 ]
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
ret i32 %16
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @seek_set(i32 %0, i64 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @lseek(i32 %0, i64 %1, i32 %5)
%7 = icmp ne i32 %6, -1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int fermat();
int main() { return fermat(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fermat@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fermat()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *tmp_name(void);
  char *name1;
  char *name2;
  name1 = tmp_name();
  name2 = tmp_name();
  printf("Name1: %s\n", name1);
  printf("Name2: %s\n", name2);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
call   1030 <tmp_name@plt>
mov    %rax,-0x10(%rbp)
call   1030 <tmp_name@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
call   1030 <tmp_name@plt>
mov    %rax,%rbx
call   1030 <tmp_name@plt>
mov    %rax,%r14
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Name1: %s\0A\00"
@.str.1 = [11 x i8] c"Name2: %s\0A\00"
define i32 @main() {
%1 = tail call i8* @tmp_name()
%2 = tail call i8* @tmp_name()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank1(int);
void vrc1setParamsA000(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank1((val & 0xF) << 13);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
and    $0xf,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank1@plt>

LLVM IR (-O0):
define void @vrc1setParamsA000(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 = and i32 %6, 15
%8 = shl i32 %7, 13
%9 = call i32 @prg8setBank1(i32 %8)
ret void
}

LLVM IR (-O2):
define void @vrc1setParamsA000(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = and i32 %3, 122880
%5 = tail call i32 @prg8setBank1(i32 %4)
ret void
}
int integerPointerOrderer(const int *a, const int *b) { return *a - *b; }


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

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

LLVM IR (-O0):
define i32 @integerPointerOrderer(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @integerPointerOrderer(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ err;

/* Variables and functions */
int /*<<< orphan*/ MSG_NOSIGNAL;
int send(int, int *, int, int /*<<< orphan*/);
int send_err(int fd, int err) {
  return send(fd, &err, sizeof(err), MSG_NOSIGNAL) == sizeof(err) ? 0 : -1;
}


x86 assembly (clang, -O0):
<send_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%ecx
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <send@plt>
movslq %eax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x4,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_err>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%ecx
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <send@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@MSG_NOSIGNAL = global i32 0
define i32 @send_err(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* @MSG_NOSIGNAL
%7 = call i32 @send(i32 %5, i32* %4, i32 4, i32 %6)
%8 = sext i32 %7 to i64
%9 = icmp eq i64 %8, 4
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
@MSG_NOSIGNAL = global i32 0
define i32 @send_err(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @MSG_NOSIGNAL
%5 = call i32 @send(i32 %0, i32* %3, i32 4, i32 %4)
%6 = icmp ne i32 %5, 4
%7 = sext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
bool incircle(float a, float b, float c) { return a * a + b * b <= c * c; }


x86 assembly (clang, -O0):
<incircle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<incircle>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mulss  %xmm2,%xmm2
xor    %eax,%eax
ucomiss %xmm0,%xmm2
setae  %al
ret

LLVM IR (-O0):
define i32 @incircle(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %4
%9 = load float, float* %5
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = load float, float* %6
%14 = load float, float* %6
%15 = fmul float %13, %14
%16 = fcmp ole float %12, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @incircle(float %0, float %1, float %2) {
%4 = fmul float %1, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
%6 = fmul float %2, %2
%7 = fcmp ole float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void right(int a[]) {
  int temp = *(a + 9), *p;
  for (p = a + 9; p > a; p--)
    *p = *(p - 1);
  *p = temp;
}


x86 assembly (clang, -O0):
<right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x24,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    114a <right+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <right+0x1e>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<right>:
lea    0x24(%rdi),%rcx
mov    0x24(%rdi),%eax
nopw   0x0(%rax,%rax,1)
mov    -0x4(%rcx),%edx
mov    %edx,(%rcx)
add    $0xfffffffffffffffc,%rcx
cmp    %rdi,%rcx
ja     1110 <right+0x10>
mov    %eax,(%rcx)
ret

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

LLVM IR (-O2):
define void @right(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = load i32, i32* %2
br label %4
4: ; preds = %1, %4
%5 = phi i32* [ %2, %1 ], [ %6, %4 ]
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = icmp ugt i32* %6, %0
br i1 %8, label %4, label %9
9: ; preds = %4
store i32 %3, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar0();
void foobar0() { bar0(); }


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

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

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

LLVM IR (-O2):
define void @foobar0() {
%1 = tail call i32 (...) @bar0()
ret void
}
/* Variables and functions */
int fact(int);
int fact_ratio2(int a, int b) { return fact(a) / fact(b) / fact(a - 2 * b); }


x86 assembly (clang, -O0):
<fact_ratio2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    %eax,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact_ratio2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <fact@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
mov    %eax,%r14d
add    %ebx,%ebx
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fact_ratio2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @fact(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @fact(i32 %7)
%9 = sdiv i32 %6, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = mul nsw i32 2, %11
%13 = sub nsw i32 %10, %12
%14 = call i32 @fact(i32 %13)
%15 = sdiv i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fact_ratio2(i32 %0, i32 %1) {
%3 = tail call i32 @fact(i32 %0)
%4 = tail call i32 @fact(i32 %1)
%5 = sdiv i32 %3, %4
%6 = mul i32 %1, -2
%7 = add i32 %6, %0
%8 = tail call i32 @fact(i32 %7)
%9 = sdiv i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *);
int strindex(char *, char *);
int strlen(char *);
int strrindex(char s[], char t[]) {
  reverse(s);
  reverse(t);
  int o = strindex(s, t) + strlen(t);
  reverse(s);
  reverse(t);
  return (strlen(s) - o);
}


x86 assembly (clang, -O0):
<strrindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strindex@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
sub    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrindex>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <reverse@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strindex@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <reverse@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
add    %r15d,%ebp
sub    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @strrindex(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @reverse(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @reverse(i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strindex(i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = call i32 @strlen(i8* %13)
%15 = add nsw i32 %12, %14
store i32 %15, i32* %5
%16 = load i8*, i8** %3
%17 = call i32 @reverse(i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 @reverse(i8* %18)
%20 = load i8*, i8** %3
%21 = call i32 @strlen(i8* %20)
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @strrindex(i8* %0, i8* %1) {
%3 = tail call i32 @reverse(i8* %0)
%4 = tail call i32 @reverse(i8* %1)
%5 = tail call i32 @strindex(i8* %0, i8* %1)
%6 = tail call i32 @strlen(i8* %1)
%7 = tail call i32 @reverse(i8* %0)
%8 = tail call i32 @reverse(i8* %1)
%9 = tail call i32 @strlen(i8* %0)
%10 = add i32 %6, %5
%11 = sub i32 %9, %10
ret i32 %11
}
OP(dd, c3) { op_c3(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_c3()
ret i32 undef
}
int textwidth(char *s) {
  int n;
  n = 0;
  for (; *s != 0; s++)
    n += (*s == '\t') ? 3 : 1;
  return n;
}


x86 assembly (clang, -O0):
<textwidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <textwidth+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
mov    $0x3,%ecx
cmp    $0x9,%edx
cmove  %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <textwidth+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<textwidth>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <textwidth+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    $0x9,%cl
sete   %dl
lea    (%rax,%rdx,2),%eax
add    $0x1,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <textwidth+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @textwidth(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = icmp eq i8 %5, 9
%9 = select i1 %8, i32 3, i32 1
%10 = add nuw nsw i32 %9, %6
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void _on_reset() {}


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

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

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

LLVM IR (-O2):
define void @_on_reset() {
ret void
}
int GetOpenMPThreadId(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @GetOpenMPThreadId() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_stat {
  int dummy;
};
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ send_command(struct chirp_client *, int /*<<< orphan*/,
                                char *, int /*<<< orphan*/);
int64_t chirp_client_fstat_begin(struct chirp_client *c, int64_t fd,
                                 struct chirp_stat *info, time_t stoptime) {
  return send_command(c, stoptime, "fstat %lld\n", fd);
}


x86 assembly (clang, -O0):
<chirp_client_fstat_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xec9(%rip),%rdx
call   1030 <send_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_fstat_begin>:
mov    %esi,%eax
lea    0xee7(%rip),%rdx
mov    %ecx,%esi
mov    %eax,%ecx
jmp    1030 <send_command@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
%struct.chirp_stat = type { i32 }
@.str = [12 x i8] c"fstat %lld\0A\00"
define i32 @chirp_client_fstat_begin(%struct.chirp_client* %0, i32 %1, %struct.chirp_stat* %2, i32 %3) {
%5 = alloca %struct.chirp_client*
%6 = alloca i32
%7 = alloca %struct.chirp_stat*
%8 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %5
store i32 %1, i32* %6
store %struct.chirp_stat* %2, %struct.chirp_stat** %7
store i32 %3, i32* %8
%9 = load %struct.chirp_client*, %struct.chirp_client** %5
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = call i32 @send_command(%struct.chirp_client* %9, i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
%struct.chirp_stat = type { i32 }
@.str = [12 x i8] c"fstat %lld\0A\00"
define i32 @chirp_client_fstat_begin(%struct.chirp_client* %0, i32 %1, %struct.chirp_stat* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @send_command(%struct.chirp_client* %0, i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %5
}