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


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

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

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

LLVM IR (-O2):
define void @test11() {
ret void
}
int radeon_bo_wait(struct radeon_bo *bo) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.radeon_bo = type opaque
define i32 @radeon_bo_wait(%struct.radeon_bo* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int epoll_create1(int /*<<< orphan*/);
int Epoll_Open() { return epoll_create1(0); }


x86 assembly (clang, -O0):
<Epoll_Open>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <epoll_create1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Epoll_Open>:
xor    %edi,%edi
jmp    1030 <epoll_create1@plt>

LLVM IR (-O0):
define i32 @Epoll_Open() {
%1 = call i32 @epoll_create1(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @Epoll_Open() {
%1 = tail call i32 @epoll_create1(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_FPE() { kill(getpid(), SIGFPE); }


x86 assembly (clang, -O0):
<gen_FPE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_FPE>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGFPE = global i32 0
define i32 @gen_FPE() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
%3 = load i32, i32* @SIGFPE
%4 = call i32 @kill(i32 %2, i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@SIGFPE = global i32 0
define i32 @gen_FPE() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGFPE
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 undef
}
/* Variables and functions */
double my_acos(double);
double calculate_triangle_angle(double a, double b, double c) {
  return my_acos((b * b - a * a + c * c) / (2 * b * c));
}


x86 assembly (clang, -O0):
<calculate_triangle_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <my_acos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_triangle_angle>:
mulsd  %xmm0,%xmm0
movapd %xmm1,%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm0,%xmm3
addsd  %xmm1,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
divsd  %xmm1,%xmm0
jmp    1030 <my_acos@plt>

LLVM IR (-O0):
define double @calculate_triangle_angle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %5
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = fneg double %11
%13 = call double @llvm.fmuladd.f64(double %7, double %8, double %12)
%14 = load double, double* %6
%15 = load double, double* %6
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double %13)
%17 = load double, double* %5
%18 = fmul double 2.000000e+00, %17
%19 = load double, double* %6
%20 = fmul double %18, %19
%21 = fdiv double %16, %20
%22 = call double @my_acos(double %21)
ret double %22
}

LLVM IR (-O2):
define double @calculate_triangle_angle(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = fmul double %4, %0
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
%7 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %6)
%8 = fmul double %1, 2.000000e+00
%9 = fmul double %8, %2
%10 = fdiv double %7, %9
%11 = tail call double @my_acos(double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  if (!(x == 1 && y == 0))
    return 0;
  while (1) {
    x = x + y;
    y++;
    assert(x >= y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1133 <main+0x23>
cmpl   $0x0,-0xc(%rbp)
je     113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1140 <main+0x30>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setge  %al
and    $0x1,%al
mov    %al,-0xd(%rbp)
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1140 <main+0x30>

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int first_field_of_box_coords(int box_col, int box_row) {
  return (9 * 3 * (box_row - 1)) + (box_col - 1) * 3;
}


x86 assembly (clang, -O0):
<first_field_of_box_coords>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
imul   $0x1b,%eax,%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
imul   $0x3,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_field_of_box_coords>:
lea    (%rsi,%rsi,8),%eax
lea    (%rax,%rax,2),%eax
lea    (%rdi,%rdi,2),%ecx
add    %ecx,%eax
add    $0xffffffe2,%eax
ret

LLVM IR (-O0):
define i32 @first_field_of_box_coords(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
%7 = mul nsw i32 27, %6
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = mul nsw i32 %9, 3
%11 = add nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @first_field_of_box_coords(i32 %0, i32 %1) {
%3 = mul i32 %1, 27
%4 = mul i32 %0, 3
%5 = add i32 %4, -30
%6 = add i32 %5, %3
ret i32 %6
}
/* Variables and functions */
char *combinePathAndFile(char const *, char const *);
int /*<<< orphan*/ eFree(char *);
int /*<<< orphan*/ parseFileOptions(char *);
void parseConfigurationFileOptionsInDirectoryWithLeafname(
    const char *directory, const char *leafname) {
  char *pathname = combinePathAndFile(directory, leafname);
  parseFileOptions(pathname);
  eFree(pathname);
}


x86 assembly (clang, -O0):
<parseConfigurationFileOptionsInDirectoryWithLeafname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <combinePathAndFile@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <parseFileOptions@plt>
mov    -0x18(%rbp),%rdi
call   1040 <eFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseConfigurationFileOptionsInDirectoryWithLeafname>:
push   %rbx
call   1050 <combinePathAndFile@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <parseFileOptions@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <eFree@plt>

LLVM IR (-O0):
define void @parseConfigurationFileOptionsInDirectoryWithLeafname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @combinePathAndFile(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @parseFileOptions(i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @eFree(i8* %11)
ret void
}

LLVM IR (-O2):
define void @parseConfigurationFileOptionsInDirectoryWithLeafname(i8* %0, i8* %1) {
%3 = tail call i8* @combinePathAndFile(i8* %0, i8* %1)
%4 = tail call i32 @parseFileOptions(i8* %3)
%5 = tail call i32 @eFree(i8* %3)
ret void
}
/* Variables and functions */
double sin(int /*<<< orphan*/);
int /*<<< orphan*/ tl_sun(double);
double sin_tl(double t) { return sin(tl_sun(t)); }


x86 assembly (clang, -O0):
<sin_tl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <tl_sun@plt>
mov    %eax,%edi
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @sin_tl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @tl_sun(double %3)
%5 = call double @sin(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @sin_tl(double %0) {
%2 = tail call i32 @tl_sun(double %0)
%3 = tail call double @sin(i32 %2)
ret double %3
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *alloc_str_copy(const char *s) {
  char *result = (char *)malloc(strlen(s) + 1);
  strcpy(result, s);
  return result;
}


x86 assembly (clang, -O0):
<alloc_str_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_str_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @alloc_str_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @alloc_str_copy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void SHAMD5IntUnregister(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x44034000);
  IntDisable(110);
  IntUnregister(110);
}


x86 assembly (clang, -O0):
<SHAMD5IntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x44034000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    $0x6e,%edi
call   1030 <IntDisable@plt>
mov    $0x6e,%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5IntUnregister>:
push   %rax
xor    %eax,%eax
cmp    $0x44034000,%edi
sete   %al
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    $0x6e,%edi
call   1030 <IntDisable@plt>
mov    $0x6e,%edi
pop    %rax
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @SHAMD5IntUnregister(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1141063680
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = call i32 @IntDisable(i32 110)
%8 = call i32 @IntUnregister(i32 110)
ret void
}

LLVM IR (-O2):
define void @SHAMD5IntUnregister(i32 %0) {
%2 = icmp eq i32 %0, 1141063680
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = tail call i32 @IntDisable(i32 110)
%6 = tail call i32 @IntUnregister(i32 110)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
float log(int);
int /*<<< orphan*/ printf(char *, float);
float rand();
float DeterminarTempoEntreChegadas(float niu) {
  float r, X;
  r = rand() / (float)RAND_MAX;
  X = -niu * log(1 - r);
  printf("\nTempoEntreChegadas = %f \n", X);
  return X;
}


x86 assembly (clang, -O0):
<DeterminarTempoEntreChegadas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    0x2e9d(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe88(%rip),%xmm0
subss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DeterminarTempoEntreChegadas>:
sub    $0x18,%rsp
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1050 <rand@plt>
mov    0x2ea2(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movaps (%rsp),%xmm1
xorps  0xea6(%rip),%xmm1
movaps %xmm1,(%rsp)
movss  0xeaa(%rip),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1040 <log@plt>
mulss  (%rsp),%xmm0
movss  %xmm0,(%rsp)
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movss  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
@.str = [27 x i8] c"\0ATempoEntreChegadas = %f \0A\00"
define float @DeterminarTempoEntreChegadas(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float (...) @rand()
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to float
%8 = fdiv float %5, %7
store float %8, float* %3
%9 = load float, float* %2
%10 = fneg float %9
%11 = load float, float* %3
%12 = fsub float 1.000000e+00, %11
%13 = fptosi float %12 to i32
%14 = call float @log(i32 %13)
%15 = fmul float %10, %14
store float %15, float* %4
%16 = load float, float* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), float %16)
%18 = load float, float* %4
ret float %18
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
@.str = [27 x i8] c"\0ATempoEntreChegadas = %f \0A\00"
define float @DeterminarTempoEntreChegadas(float %0) {
%2 = tail call float (...) @rand()
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
%6 = fneg float %0
%7 = fsub float 1.000000e+00, %5
%8 = fptosi float %7 to i32
%9 = tail call float @log(i32 %8)
%10 = fmul float %9, %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), float %10)
ret float %10
}
void test25_BlinkUno1_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test25_BlinkUno1_targetInit__I() {
ret void
}
tinfomove(row, col) register int row, col;
{ return (0); }


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

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

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

LLVM IR (-O2):
define i32 @tinfomove(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((hotpatch)) __attribute__((always_)) void hp2(void) {
  printf("hello, world!\n");
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int A[][3] = {1, 2, 3, 4, 5, 6};
  int(*p) = A[0];
  printf("p [ 2 ] = %d;\n", p[2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.A = [2 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6]]
@.str = [15 x i8] c"p [ 2 ] = %d;\0A\00"
define void @main() {
%1 = alloca [2 x [3 x i32]]
%2 = alloca i32*
%3 = bitcast [2 x [3 x i32]]* %1 to i8*
%4 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"p [ 2 ] = %d;\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
int isPalindrome(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", isPalindrome(1231));
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @isPalindrome(i32 1231)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_quaddobl_Laurent_drop_variable_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(830, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_quaddobl_Laurent_drop_variable_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x33e,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_quaddobl_Laurent_drop_variable_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x33e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_quaddobl_Laurent_drop_variable_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 830, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_quaddobl_Laurent_drop_variable_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 830, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int ser_write(int const, unsigned char const *, size_t *);
int send_data(const int fd, const unsigned char *buf, const size_t size) {
  int retval = 0;
  size_t length = 0;
  do {
  } while (0);
  length = size;
  retval = ser_write(fd, buf, &length);
  if (retval < 0)
    return EXIT_FAILURE;
  do {
  } while (0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
jmp    1137 <send_data+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1030 <ser_write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    116d <send_data+0x5d>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <send_data+0x73>
jmp    1172 <send_data+0x62>
jmp    1177 <send_data+0x67>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_data>:
push   %rax
mov    %rdx,(%rsp)
mov    %rsp,%rdx
call   1030 <ser_write@plt>
test   %eax,%eax
jns    112a <send_data+0x1a>
mov    0x2eb8(%rip),%rax
jmp    1131 <send_data+0x21>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @send_data(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 0, i32* %8
store i64 0, i64* %9
br label %10
10: ; preds = %3
br label %11
11: ; preds = %10
%12 = load i64, i64* %7
store i64 %12, i64* %9
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = call i32 @ser_write(i32 %13, i8* %14, i64* %9)
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = load i32, i32* @EXIT_FAILURE
store i32 %19, i32* %4
br label %24
20: ; preds = %11
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21
%23 = load i32, i32* @EXIT_SUCCESS
store i32 %23, i32* %4
br label %24
24: ; preds = %22, %18
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @send_data(i32 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 %2, i64* %4
%6 = call i32 @ser_write(i32 %0, i8* %1, i64* %4)
%7 = icmp slt i32 %6, 0
%8 = load i32, i32* @EXIT_FAILURE
%9 = load i32, i32* @EXIT_SUCCESS
%10 = select i1 %7, i32 %8, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int);
int main() {
  printf("%d\n", sum(55));
  printf("%d\n", sum(45));
  printf("%d\n", sum(50));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x37,%edi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2d,%edi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x32,%edi
call   1040 <sum@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x37,%edi
call   1040 <sum@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2d,%edi
call   1040 <sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x32,%edi
call   1040 <sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sum(i32 55)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @sum(i32 45)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sum(i32 50)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 55)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sum(i32 45)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sum(i32 50)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
float f(int x, float y) {
  int z = x * x;
  return y + z;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
imul   %edi,%edi
cvtsi2ss %edi,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %3
store float %1, float* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load float, float* %4
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = fadd float %9, %11
ret float %12
}

LLVM IR (-O2):
define float @f(i32 %0, float %1) {
%3 = mul nsw i32 %0, %0
%4 = sitofp i32 %3 to float
%5 = fadd float %4, %1
ret float %5
}
void outportb(unsigned short port, unsigned char data) {
  __asm__ __volatile__("outb %1, %0" : : "dN"(port), "a"(data));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO2(int, int);
long int BNCLCDEchoOn() {
  long int stat = 99;
  BNCIO2(33, 1);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCLCDEchoOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <BNCIO2@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCLCDEchoOn>:
push   %rax
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <BNCIO2@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCLCDEchoOn() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO2(i32 33, i32 1)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCLCDEchoOn() {
%1 = tail call i32 @BNCIO2(i32 33, i32 1)
ret i64 99
}
void write_cr2(unsigned long val) {
  asm volatile("mov %0,%%cr2" : : "r"(val) : "memory");
}


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

x86 assembly (clang, -O2):
<write_cr2>:
mov    %rdi,%cr2
ret

LLVM IR (-O0):
define void @write_cr2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret void
}

LLVM IR (-O2):
define void @write_cr2(i64 %0) {
tail call void asm sideeffect "mov $0,%cr2", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Type definitions */
typedef int time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int time(int /*<<< orphan*/ *);
char *getTimeStamp(void) {
  char *timestamp = (char *)malloc(100 * sizeof(char));
  time_t secSinceEpoch = time(NULL);
  struct tm *timeNow = localtime(&secSinceEpoch);
  sprintf(timestamp, "%d", secSinceEpoch);
  return timestamp;
}


x86 assembly (clang, -O0):
<getTimeStamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe83(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeStamp>:
push   %rbx
sub    $0x10,%rsp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    0xc(%rsp),%edx
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%d\00"
define i8* @getTimeStamp() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = call i32 @time(i32* null)
store i32 %6, i32* %2
%7 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %7, %struct.tm** %3
%8 = load i8*, i8** %1
%9 = load i32, i32* %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%d\00"
define i8* @getTimeStamp() {
%1 = alloca i32
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = call %struct.tm* @localtime(i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_long_and_to_all(long *target, long *source, int nreduce,
                                  int PE_start, int logPE_stride, int PE_size,
                                  long *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_long_and_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_long_and_to_all(i64* %0, i64* %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* %6, i64* %7) {
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64*
%16 = alloca i64*
store i64* %0, i64** %9
store i64* %1, i64** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i64* %6, i64** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_long_and_to_all(i64* nocapture readnone %0, i64* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i64* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void displayMenuEntry(int num, const char *option) {
  printf("%d - %s\n", num, option);
}


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

x86 assembly (clang, -O2):
<displayMenuEntry>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %s\0A\00"
define void @displayMenuEntry(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
void *ptr_to_indirect(void *ptr) { return (void *)((unsigned long)ptr | 1); }


x86 assembly (clang, -O0):
<ptr_to_indirect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_to_indirect>:
mov    %rdi,%rax
or     $0x1,%rax
ret

LLVM IR (-O0):
define i8* @ptr_to_indirect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = or i64 %4, 1
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @ptr_to_indirect(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = or i64 %2, 1
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
long long silk_min_64(long long a, long long b) {
  return (((a) < (b)) ? (a) : (b));
}


x86 assembly (clang, -O0):
<silk_min_64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <silk_min_64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <silk_min_64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<silk_min_64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @silk_min_64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int leapyear(int year) {
  return (year & 3) == 0 && (year % 100 != 0 || year % 400 == 0);
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    114e <leapyear+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    1148 <leapyear+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <leapyear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <leapyear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @leapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct object {
  int dummy;
};
struct lisp {
  int dummy;
};

/* Variables and functions */
struct object *make_bool(struct lisp *, int);
struct object *eq(struct lisp *lisp, struct object *a, struct object *b) {
  return make_bool(lisp, a == b);
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
call   1030 <make_bool@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
xor    %eax,%eax
cmp    %rdx,%rsi
sete   %al
mov    %eax,%esi
jmp    1030 <make_bool@plt>

LLVM IR (-O0):
%struct.lisp = type { i32 }
%struct.object = type { i32 }
define %struct.object* @eq(%struct.lisp* %0, %struct.object* %1, %struct.object* %2) {
%4 = alloca %struct.lisp*
%5 = alloca %struct.object*
%6 = alloca %struct.object*
store %struct.lisp* %0, %struct.lisp** %4
store %struct.object* %1, %struct.object** %5
store %struct.object* %2, %struct.object** %6
%7 = load %struct.lisp*, %struct.lisp** %4
%8 = load %struct.object*, %struct.object** %5
%9 = load %struct.object*, %struct.object** %6
%10 = icmp eq %struct.object* %8, %9
%11 = zext i1 %10 to i32
%12 = call %struct.object* @make_bool(%struct.lisp* %7, i32 %11)
ret %struct.object* %12
}

LLVM IR (-O2):
%struct.lisp = type { i32 }
%struct.object = type { i32 }
define %struct.object* @eq(%struct.lisp* %0, %struct.object* readnone %1, %struct.object* readnone %2) {
%4 = icmp eq %struct.object* %1, %2
%5 = zext i1 %4 to i32
%6 = tail call %struct.object* @make_bool(%struct.lisp* %0, i32 %5)
ret %struct.object* %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t next_status(uint8_t s) {
  if (s < 0xF0) {
    return s;
  } else if (s < 0xF8) {
    return 0;
  } else {
    return s;
  }
}


x86 assembly (clang, -O0):
<next_status>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xf0,-0x8(%rbp)
jge    111f <next_status+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <next_status+0x3e>
cmpl   $0xf8,-0x8(%rbp)
jge    1138 <next_status+0x38>
movl   $0x0,-0x4(%rbp)
jmp    113e <next_status+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_status>:
xor    %eax,%eax
cmp    $0xf8,%edi
cmovge %edi,%eax
cmp    $0xf0,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @next_status(i32 %0) {
%2 = icmp slt i32 %0, 240
%3 = icmp slt i32 %0, 248
%4 = select i1 %3, i32 0, i32 %0
%5 = select i1 %2, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteByte(int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
void wiznetSetSocketTimeToLive(uint8_t socket, uint8_t ttl) {
  wiznetRegWriteByte(socket, (0x0000 + 0x0016), ttl);
}


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

x86 assembly (clang, -O2):
<wiznetSetSocketTimeToLive>:
mov    %esi,%edx
mov    $0x16,%esi
jmp    1030 <wiznetRegWriteByte@plt>

LLVM IR (-O0):
define void @wiznetSetSocketTimeToLive(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 @wiznetRegWriteByte(i32 %5, i32 22, i32 %6)
ret void
}

LLVM IR (-O2):
define void @wiznetSetSocketTimeToLive(i32 %0, i32 %1) {
%3 = tail call i32 @wiznetRegWriteByte(i32 %0, i32 22, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *get_rfc3526_prime_2048(int /*<<< orphan*/ *);
BIGNUM *BN_get_rfc3526_prime_2048(BIGNUM *bn) {
  return get_rfc3526_prime_2048(bn);
}


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

x86 assembly (clang, -O2):
<BN_get_rfc3526_prime_2048>:
jmp    1030 <get_rfc3526_prime_2048@plt>

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

LLVM IR (-O2):
define i32* @BN_get_rfc3526_prime_2048(i32* %0) {
%2 = tail call i32* @get_rfc3526_prime_2048(i32* %0)
ret i32* %2
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void sig_child(int signo) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0) {
    printf("child %d terminated\n", pid);
  }
  return;
}


x86 assembly (clang, -O0):
<sig_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <sig_child+0x42>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <sig_child+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_child>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117e <sig_child+0x5e>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <sig_child+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_child(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_child(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
void f2(q) int *q;
{
  *q = 2;
#pragma omp barrier
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movl   $0x2,(%rdi)
ret

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

LLVM IR (-O2):
define void @f2(i32* nocapture writeonly %0) {
store i32 2, i32* %0
ret void
}