xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ i2x(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  printf("%lf", i2x(1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <i2x@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"%lf\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @i2x(i32 1)
%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"%lf\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @i2x(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
char *nvram_get(char *);
scalar_t__ strcmp(char const *, char *);
int nvram_invmatch(char *name, char *invmatch) {
  const char *value = nvram_get(name);
  return value && strcmp(value, invmatch);
}


x86 assembly (clang, -O0):
<nvram_invmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nvram_get@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1164 <nvram_invmatch+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_invmatch>:
push   %rbx
mov    %rsi,%rbx
call   1040 <nvram_get@plt>
test   %rax,%rax
je     1146 <nvram_invmatch+0x26>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nvram_invmatch(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 = call i8* @nvram_get(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i64 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i64 %13, 0
br label %15
15: ; preds = %10, %2
%16 = phi i1 [ false, %2 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @nvram_invmatch(i8* %0, i8* %1) {
%3 = tail call i8* @nvram_get(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
void LSM303DLHC_AccDeInit(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_max_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_max_pd(__m128d A, __m128d B) { return _mm_max_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_max_pd>:
jmp    1030 <_mm_max_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_max_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int hashtable_eqfn_uint32(void *k1, void *k2) {
  uint32_t i1 = *((uint32_t *)k1);
  uint32_t i2 = *((uint32_t *)k2);
  return (i1 == i2);
}


x86 assembly (clang, -O0):
<hashtable_eqfn_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashtable_eqfn_uint32>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @hashtable_eqfn_uint32(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp eq i64 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @hashtable_eqfn_uint32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint64_t;
typedef int int32_t;

/* Variables and functions */
int b_flip(int const, int const);
int b_len(int);
uint64_t b_flip_code(uint64_t n) {
  int32_t const len = b_len(n) - 1;
  uint64_t const code = n & ~(1 << len);
  uint64_t const flipped_code = b_flip(code, len);
  return flipped_code | (1 << len);
}


x86 assembly (clang, -O0):
<b_flip_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <b_len@plt>
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <b_flip@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_flip_code>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <b_len@plt>
lea    -0x1(%rax),%ebp
btr    %ebp,%ebx
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <b_flip@plt>
bts    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @b_flip_code(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @b_len(i32 %6)
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = shl i32 1, %10
%12 = xor i32 %11, -1
%13 = and i32 %9, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = call i32 @b_flip(i32 %14, i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = shl i32 1, %18
%20 = or i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @b_flip_code(i32 %0) {
%2 = tail call i32 @b_len(i32 %0)
%3 = add nsw i32 %2, -1
%4 = shl nuw i32 1, %3
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
%7 = tail call i32 @b_flip(i32 %6, i32 %3)
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ dllfree(void *);
void __wrap_free(void *pPtr) { dllfree(pPtr); }


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

x86 assembly (clang, -O2):
<__wrap_free>:
jmp    1030 <dllfree@plt>

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

LLVM IR (-O2):
define void @__wrap_free(i8* %0) {
%2 = tail call i32 @dllfree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_put32(void *dest, const void *src, size_t len, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_put32(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = 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_put32(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = 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 *, double);
int main(void) {
  double Shorty = 1.28;
  double Lofty = 1.94;
  double Shorty_to_Lofty = 2.1;
  double Lofty_to_Tree = 12.4;
  double TreeHeight;
  TreeHeight = Lofty + Lofty_to_Tree / Shorty_to_Lofty * (Lofty - Shorty);
  printf("%.2f", TreeHeight);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 1.280000e+00, double* %2
store double 1.940000e+00, double* %3
store double 2.100000e+00, double* %4
store double 1.240000e+01, double* %5
%7 = load double, double* %3
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = load double, double* %3
%12 = load double, double* %2
%13 = fsub double %11, %12
%14 = call double @llvm.fmuladd.f64(double %10, double %13, double %7)
store double %14, double* %6
%15 = load double, double* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double 0x4017593BFA2608C7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int /*<<< orphan*/ target_set_breakpoint(int);
int /*<<< orphan*/ write_resp(int, char *);
void cmd_set_breakpoint(int fd, const char *cmd) {
  int addr;
  sscanf(cmd + 1, "%x", &addr);
  target_set_breakpoint(addr);
  write_resp(fd, "OK");
}


x86 assembly (clang, -O0):
<cmd_set_breakpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
lea    0xeb2(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <target_set_breakpoint@plt>
mov    -0x4(%rbp),%edi
lea    0xe9a(%rip),%rsi
call   1040 <write_resp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_set_breakpoint>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x1(%rsi),%rdi
lea    0xebe(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1050 <sscanf@plt>
mov    0xc(%rsp),%edi
call   1030 <target_set_breakpoint@plt>
lea    0xea7(%rip),%rsi
mov    %ebx,%edi
call   1040 <write_resp@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
@.str.1 = [3 x i8] c"OK\00"
define void @cmd_set_breakpoint(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%9 = load i32, i32* %5
%10 = call i32 @target_set_breakpoint(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @write_resp(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
@.str.1 = [3 x i8] c"OK\00"
define void @cmd_set_breakpoint(i32 %0, i8* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @target_set_breakpoint(i32 %7)
%9 = call i32 @write_resp(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_F2uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xF2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F2uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xf2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F2uint64_highword_reg>:
movabs $0xf200000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F2uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 242
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F2uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1039382085632
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test2(int c, int d) { return (c ^ d) != c; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @test2(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 = xor i32 %5, %6
%8 = load i32, i32* %3
%9 = icmp ne i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_write_dobldobl_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(462, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_write_dobldobl_random_coefficient_system>:
mov    $0x1ce,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @celcon_write_dobldobl_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 462, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int get_next_rec_buffer_internal(int /*<<< orphan*/);
int /*<<< orphan*/ receive_timeout(int);
int get_next_rec_buffer(int maxusec) {
  return get_next_rec_buffer_internal(receive_timeout(maxusec));
}


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

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

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

LLVM IR (-O2):
define i32 @get_next_rec_buffer(i32 %0) {
%2 = tail call i32 @receive_timeout(i32 %0)
%3 = tail call i32 @get_next_rec_buffer_internal(i32 %2)
ret i32 %3
}
int set_sample_rate(long int rate) { return 480; }


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

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

LLVM IR (-O0):
define i32 @set_sample_rate(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret i32 480
}

LLVM IR (-O2):
define i32 @set_sample_rate(i64 %0) {
ret i32 480
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int unlink(char const *);
int zunlink(const char *pathname) {
  int ret;
  do {
    ret = unlink(pathname);
  } while ((ret < 0) && (errno == EINTR));
  return ret;
  ;
}


x86 assembly (clang, -O0):
<zunlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jge    1151 <zunlink+0x41>
mov    0x2ea2(%rip),%rax
mov    (%rax),%rax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111c <zunlink+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zunlink>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ec1(%rip),%r14
mov    0x2eb2(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <unlink@plt>
test   %eax,%eax
jns    1144 <zunlink+0x34>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <zunlink+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @zunlink(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
br label %4
4: ; preds = %14, %1
%5 = load i8*, i8** %2
%6 = call i32 @unlink(i8* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i64, i64* @errno
%12 = load i64, i64* @EINTR
%13 = icmp eq i64 %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %4, label %16
16: ; preds = %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @zunlink(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @unlink(i8* %0)
%4 = icmp slt i32 %3, 0
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
void pthread_rwlockattr_getpshared() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlockattr_getpshared() {
ret void
}
/* Variables and functions */
int game_run(char const *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ writeOutputFile(char *, char *, int);
void performTests(const char *input, char *outputFile, char *output,
                  int outputSize) {
  int status = 0;
  memset(output, 0, 8192);
  status = game_run(input, output, 8192);
  writeOutputFile(outputFile, output, outputSize);
}


x86 assembly (clang, -O0):
<performTests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2000,%edx
call   1050 <game_run@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <writeOutputFile@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<performTests>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%rbp
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1040 <memset@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2000,%edx
call   1050 <game_run@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <writeOutputFile@plt>

LLVM IR (-O0):
define void @performTests(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i8*, i8** %7
%11 = call i32 @memset(i8* %10, i32 0, i32 8192)
%12 = load i8*, i8** %5
%13 = load i8*, i8** %7
%14 = call i32 @game_run(i8* %12, i8* %13, i32 8192)
store i32 %14, i32* %9
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @writeOutputFile(i8* %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @performTests(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @memset(i8* %2, i32 0, i32 8192)
%6 = tail call i32 @game_run(i8* %0, i8* %2, i32 8192)
%7 = tail call i32 @writeOutputFile(i8* %1, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Com_Error(int /*<<< orphan*/, char *);
int /*<<< orphan*/ Sys_Library_Close(void *);
void Com_UnloadLibrary(void **lib) {
  if (lib && *lib) {
    if (!Sys_Library_Close(*lib))
      Com_Error(0, "Sys_CloseLibrary failed");
    *lib = ((void *)0);
  }
}


x86 assembly (clang, -O0):
<Com_UnloadLibrary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1173 <Com_UnloadLibrary+0x53>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1173 <Com_UnloadLibrary+0x53>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <Sys_Library_Close@plt>
cmp    $0x0,%eax
jne    1168 <Com_UnloadLibrary+0x48>
xor    %edi,%edi
lea    0xe9d(%rip),%rsi
call   1040 <Com_Error@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_UnloadLibrary>:
push   %rbx
test   %rdi,%rdi
je     114f <Com_UnloadLibrary+0x2f>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114f <Com_UnloadLibrary+0x2f>
call   1030 <Sys_Library_Close@plt>
test   %eax,%eax
jne    1148 <Com_UnloadLibrary+0x28>
lea    0xebf(%rip),%rsi
xor    %edi,%edi
call   1040 <Com_Error@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Sys_CloseLibrary failed\00"
define void @Com_UnloadLibrary(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %5, label %18
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = call i32 @Sys_Library_Close(i8* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = call i32 @Com_Error(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
%17 = load i8**, i8*** %2
store i8* null, i8** %17
br label %18
18: ; preds = %16, %5, %1
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Sys_CloseLibrary failed\00"
define void @Com_UnloadLibrary(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = tail call i32 @Sys_Library_Close(i8* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @Com_Error(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
store i8* null, i8** %0
br label %12
12: ; preds = %11, %3, %1
ret void
}
int foo(int x, int z) { return 0; }


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

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

LLVM IR (-O0):
define i32 @foo(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 @foo(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(unsigned int);
void *malloc_checked(unsigned int b) {
  void *ptr;
  ptr = malloc(b);
  if (ptr == '\0') {
    exit(98);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<malloc_checked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114c <malloc_checked+0x2c>
mov    $0x62,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_checked>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <malloc_checked+0xd>
pop    %rcx
ret
mov    $0x62,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @malloc_checked(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @exit(i32 98)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @malloc_checked(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 98)
unreachable
6: ; preds = %1
ret i8* %2
}
int byaj(int principle, int rate, int time) {
  int p, r, t;
  float byaj = ((p * r * t) * 1.0) / 100;
  return byaj;
}


x86 assembly (clang, -O0):
<byaj>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
cvttss2si -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @byaj(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %9
%15 = mul nsw i32 %13, %14
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 1.000000e+00
%18 = fdiv double %17, 1.000000e+02
%19 = fptrunc double %18 to float
store float %19, float* %10
%20 = load float, float* %10
%21 = fptosi float %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @byaj(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_64(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_64() {
ret i32 0
}
/* Variables and functions */
void *_sbrk(intptr_t);
void *sbrk(intptr_t incr) { return _sbrk(incr); }


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

x86 assembly (clang, -O2):
<sbrk>:
jmp    1030 <_sbrk@plt>

LLVM IR (-O0):
define i8* @sbrk(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @_sbrk(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @sbrk(i64 %0) {
%2 = tail call i8* @_sbrk(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ con_clear();
int /*<<< orphan*/ display(int);
int redraw(void) {
  con_clear();
  display(1);
  return 0;
}


x86 assembly (clang, -O0):
<redraw>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <con_clear@plt>
mov    $0x1,%edi
call   1040 <display@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<redraw>:
push   %rax
xor    %eax,%eax
call   1030 <con_clear@plt>
mov    $0x1,%edi
call   1040 <display@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @redraw() {
%1 = call i32 (...) @con_clear()
%2 = call i32 @display(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @redraw() {
%1 = tail call i32 (...) @con_clear()
%2 = tail call i32 @display(i32 1)
ret i32 0
}
int likwid_markerRegisterRegion(const char *regionTag) { return 0; }


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

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

LLVM IR (-O0):
define i32 @likwid_markerRegisterRegion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @likwid_markerRegisterRegion(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *malloc(int);
void *f1(int n) { return malloc(n * sizeof(int)); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = trunc i64 %5 to i32
%7 = call i8* @malloc(i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @f1(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i8* @malloc(i32 %2)
ret i8* %3
}
void dummy(int pkg, int core, int cpu) { return; }


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @dummy(i32 %0, i32 %1, i32 %2) {
ret void
}
double max3d(double x1, double x2, double x3) {
  x1 = x1 < x2 ? x2 : x1;
  x1 = x1 < x3 ? x3 : x1;
  return x1;
}


x86 assembly (clang, -O0):
<max3d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <max3d+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1140 <max3d+0x40>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    116d <max3d+0x6d>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1177 <max3d+0x77>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3d>:
maxsd  %xmm0,%xmm1
maxsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @max3d(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* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %14
12: ; preds = %3
%13 = load double, double* %4
br label %14
14: ; preds = %12, %10
%15 = phi double [ %11, %10 ], [ %13, %12 ]
store double %15, double* %4
%16 = load double, double* %4
%17 = load double, double* %6
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load double, double* %6
br label %23
21: ; preds = %14
%22 = load double, double* %4
br label %23
23: ; preds = %21, %19
%24 = phi double [ %20, %19 ], [ %22, %21 ]
store double %24, double* %4
%25 = load double, double* %4
ret double %25
}

LLVM IR (-O2):
define double @max3d(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = select i1 %4, double %1, double %0
%6 = fcmp olt double %5, %2
%7 = select i1 %6, double %2, double %5
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ substring(char *, char *, int, int);
void substr(char *strsource, int ii_start, int ii_dim) {
  char strdest[ii_dim];
  substring(strdest, strsource, ii_start, ii_dim);
  strcpy(strsource, strdest);
  return;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <substring@plt>
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%rdi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%r14
mov    %ecx,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <substring@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @substr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %7
%12 = alloca i8, i64 %10
store i64 %10, i64* %8
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @substring(i8* %12, i8* %13, i32 %14, i32 %15)
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %17, i8* %12)
%19 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @substr(i8* %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @substring(i8* %5, i8* %0, i32 %1, i32 %2)
%7 = call i32 @strcpy(i8* %0, i8* %5)
ret void
}
/* Variables and functions */
char tolower(char);
char *strlower(char *src) {
  char *c;
  for (c = src; *c; c++) {
    *c = tolower(*c);
  }
  return src;
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlower+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ putd(int);
void putdln(int i) {
  putd(i);
  putc('\n');
}


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

x86 assembly (clang, -O2):
<putdln>:
push   %rax
call   1030 <putd@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <putc@plt>

LLVM IR (-O0):
define void @putdln(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @putd(i32 %3)
%5 = call i32 @putc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @putdln(i32 %0) {
%2 = tail call i32 @putd(i32 %0)
%3 = tail call i32 @putc(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g2(int *);
int f2(int *restrict p) {
  g2(p);
  return *p;
}


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

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <g2@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f2(i32* noalias %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @g2(i32* %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f2(i32* noalias %0) {
%2 = tail call i32 @g2(i32* %0)
%3 = load i32, i32* %0
ret i32 %3
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memset(char *, unsigned char, int);
char *repeat_char(char c, int count) {
  char *s = malloc(count);
  memset(s, (unsigned char)c, count);
  return s;
}


x86 assembly (clang, -O0):
<repeat_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%edx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat_char>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movzbl %r14b,%esi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @repeat_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8*
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8, i8* %3
%10 = load i32, i32* %4
%11 = call i32 @memset(i8* %8, i8 zeroext %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @repeat_char(i8 signext %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @memset(i8* %3, i8 zeroext %0, i32 %1)
ret i8* %3
}
char *proc_find_sb(char *p) {
  for (; *p != 0; p++)
    if (*p == ' ' && *(p + 1) == '(')
      return p;
  return 0;
}


x86 assembly (clang, -O0):
<proc_find_sb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115c <proc_find_sb+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1146 <proc_find_sb+0x46>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x28,%eax
jne    1146 <proc_find_sb+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <proc_find_sb+0x64>
jmp    114b <proc_find_sb+0x4b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <proc_find_sb+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_find_sb>:
mov    %rdi,%rax
jmp    111a <proc_find_sb+0x1a>
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x28,0x1(%rax)
je     1128 <proc_find_sb+0x28>
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <proc_find_sb+0x10>
test   %cl,%cl
jne    1116 <proc_find_sb+0x16>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @proc_find_sb(i8* %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i8* [ %0, %1 ], [ %10, %9 ]
%4 = load i8, i8* %3
switch i8 %4, label %9 [
i8 0, label %11
i8 32, label %5
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 40
br i1 %8, label %11, label %9
9: ; preds = %2, %5
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2, %5
%12 = phi i8* [ %3, %5 ], [ null, %2 ]
ret i8* %12
}
int test_imm_07uint16_mem(unsigned short *val) {
  return ((*val) & (0x07 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_07uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_07uint16_mem>:
testb  $0x7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_07uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 7
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_07uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 7
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isbridge(char c) { return c == '-' || c == '|'; }


x86 assembly (clang, -O0):
<isbridge>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isbridge+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7c,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbridge>:
cmp    $0x2d,%dil
sete   %al
cmp    $0x7c,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isbridge(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 45
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 124
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isbridge(i8 signext %0) {
%2 = icmp eq i8 %0, 45
%3 = icmp eq i8 %0, 124
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}