xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pausemusic();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basPauseMusic(void) { pushNumber(pausemusic()); }


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

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

LLVM IR (-O0):
define void @basPauseMusic() {
%1 = call i32 (...) @pausemusic()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basPauseMusic() {
%1 = tail call i32 (...) @pausemusic()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Type definitions */
typedef int uint_fast32_t;
typedef scalar_t__ int_fast32_t;

/* Variables and functions */
int /*<<< orphan*/ cop_st_ule24(void *, int);
__attribute__((unused)) void cop_st_sle24(void *buf, int_fast32_t val) {
  cop_st_ule24(buf, ((uint_fast32_t)val) & 0xFFFFFF);
}


x86 assembly (clang, -O0):
<cop_st_sle24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
and    $0xffffff,%esi
call   1030 <cop_st_ule24@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_st_sle24>:
and    $0xffffff,%esi
jmp    1030 <cop_st_ule24@plt>

LLVM IR (-O0):
define void @cop_st_sle24(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 16777215
%9 = call i32 @cop_st_ule24(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @cop_st_sle24(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 16777215
%5 = tail call i32 @cop_st_ule24(i8* %0, i32 %4)
ret void
}
char getChar() {
  char ch;
  ch = 'm';
  return (ch + 1);
}


x86 assembly (clang, -O0):
<getChar>:
push   %rbp
mov    %rsp,%rbp
movb   $0x6d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @getChar() {
%1 = alloca i8
store i8 109, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, 1
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @getChar() {
ret i8 110
}
/* Variables and functions */
int __infer_nondet_int();
int /*<<< orphan*/ __require_allocated_array(char const *);
int remove(const char *path) {
  int success;
  __require_allocated_array(path);
  success = __infer_nondet_int();
  return (success > 0) ? 0 : -1;
}


x86 assembly (clang, -O0):
<remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__require_allocated_array@plt>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove>:
push   %rax
call   1040 <__require_allocated_array@plt>
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @remove(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @__require_allocated_array(i8* %4)
%6 = call i32 (...) @__infer_nondet_int()
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @remove(i8* %0) {
%2 = tail call i32 @__require_allocated_array(i8* %0)
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = icmp slt i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bbb(char *);
void aaa(char *x) { bbb(x); }


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

x86 assembly (clang, -O2):
<aaa>:
jmp    1030 <bbb@plt>

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

LLVM IR (-O2):
define void @aaa(i8* %0) {
%2 = tail call i32 @bbb(i8* %0)
ret void
}
int test_imm_EAuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xEA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EAuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 234
%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_EAuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 234
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *rpaligned_alloc(size_t, size_t);
void *rpmemalign(size_t alignment, size_t size) {
  return rpaligned_alloc(alignment, size);
}


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

x86 assembly (clang, -O2):
<rpmemalign>:
jmp    1030 <rpaligned_alloc@plt>

LLVM IR (-O0):
define i8* @rpmemalign(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 = call i8* @rpaligned_alloc(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @rpmemalign(i64 %0, i64 %1) {
%3 = tail call i8* @rpaligned_alloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int fabs(double);
double make_non_zero(double v) {
  if (fabs(v) < 1e-8) {
    if (v < 0)
      return -1e-8;
    return 1e-8;
  }
  return v;
}


x86 assembly (clang, -O0):
<make_non_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    116f <make_non_zero+0x5f>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115d <make_non_zero+0x4d>
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1179 <make_non_zero+0x69>
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1179 <make_non_zero+0x69>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_non_zero>:
push   %rbp
push   %rbx
push   %rax
xorpd  %xmm1,%xmm1
xor    %ebx,%ebx
ucomisd %xmm0,%xmm1
seta   %bpl
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
test   %eax,%eax
jle    1136 <make_non_zero+0x26>
movsd  (%rsp),%xmm0
jmp    1145 <make_non_zero+0x35>
mov    %bpl,%bl
lea    0xec0(%rip),%rax
movsd  (%rax,%rbx,8),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @make_non_zero(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i32 @fabs(double %4)
%6 = sitofp i32 %5 to double
%7 = fcmp olt double %6, 1.000000e-08
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load double, double* %3
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %8
store double -1.000000e-08, double* %2
br label %15
12: ; preds = %8
store double 1.000000e-08, double* %2
br label %15
13: ; preds = %1
%14 = load double, double* %3
store double %14, double* %2
br label %15
15: ; preds = %13, %12, %11
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @make_non_zero(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = icmp slt i32 %2, 1
%4 = fcmp olt double %0, 0.000000e+00
%5 = select i1 %4, double -1.000000e-08, double 1.000000e-08
%6 = select i1 %3, double %5, double %0
ret double %6
}
/* Variables and functions */
double exp(int);
int pow(double, int);
double py_gauss(double x) { return exp(-pow(x - 0.5, 2) / pow(0.05, 2)); }


x86 assembly (clang, -O0):
<py_gauss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movsd  0xea7(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<py_gauss>:
push   %rbx
addsd  0xed7(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ebx
movsd  0xecb(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
neg    %eax
mov    %eax,%edi
pop    %rbx
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @py_gauss(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = call i32 @pow(double %4, i32 2)
%6 = sub nsw i32 0, %5
%7 = call i32 @pow(double 5.000000e-02, i32 2)
%8 = sdiv i32 %6, %7
%9 = call double @exp(i32 %8)
ret double %9
}

LLVM IR (-O2):
define double @py_gauss(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = tail call i32 @pow(double %2, i32 2)
%4 = tail call i32 @pow(double 5.000000e-02, i32 2)
%5 = sdiv i32 %3, %4
%6 = sub nsw i32 0, %5
%7 = tail call double @exp(i32 %6)
ret double %7
}
int test_imm_6Duint16_mem(unsigned short *val) {
  return ((*val) & (0x6D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Duint16_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, 109
%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_6Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 109
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int cread_alt(int *xp) {
  int t = 0;
  return *(xp ? xp : &t);
}


x86 assembly (clang, -O0):
<cread_alt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1127 <cread_alt+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <cread_alt+0x34>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <cread_alt+0x34>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cread_alt>:
movl   $0x0,-0x4(%rsp)
test   %rdi,%rdi
lea    -0x4(%rsp),%rax
cmovne %rdi,%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @cread_alt(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = icmp eq i32* %0, null
%5 = select i1 %4, i32* %2, i32* %0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close_on_exec(int);
int pipe(int *);
int pipe_close_on_exec(int fd[2]) {
  int ret = pipe(fd);
  if (ret == 0) {
    close_on_exec(fd[0]);
    close_on_exec(fd[1]);
  }
  return ret;
}


x86 assembly (clang, -O0):
<pipe_close_on_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pipe@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1159 <pipe_close_on_exec+0x39>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close_on_exec@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <close_on_exec@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_close_on_exec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <pipe@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1143 <pipe_close_on_exec+0x23>
mov    (%r14),%edi
call   1030 <close_on_exec@plt>
mov    0x4(%r14),%edi
call   1030 <close_on_exec@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @pipe_close_on_exec(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* %0
%6 = tail call i32 @close_on_exec(i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @close_on_exec(i32 %8)
br label %10
10: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int wordlength();
int rightrot(int x, unsigned n) {
  unsigned rbit;
  while (n-- > 0) {
    rbit = ((unsigned)x & 0x01) << (wordlength() - 1);
    x = (int)((unsigned)x >> 1);
    x = (int)((unsigned)x | rbit);
  }
  return x;
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jbe    1166 <rightrot+0x56>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <wordlength@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    111e <rightrot+0xe>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
test   %esi,%esi
je     113b <rightrot+0x2b>
mov    %esi,%r14d
nopl   (%rax)
mov    %ebx,%ebp
and    $0x1,%ebp
xor    %eax,%eax
call   1030 <wordlength@plt>
lea    -0x1(%rax),%ecx
shl    %cl,%ebp
shr    %ebx
or     %ebp,%ebx
add    $0xffffffff,%r14d
jne    1120 <rightrot+0x10>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %13, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add i32 %6, -1
%8 = and i32 %5, 1
%9 = tail call i32 (...) @wordlength()
%10 = add nsw i32 %9, -1
%11 = shl nuw i32 %8, %10
%12 = lshr i32 %5, 1
%13 = or i32 %11, %12
%14 = icmp eq i32 %7, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ %0, %2 ], [ %13, %4 ]
ret i32 %16
}
joinup(short hi, short lo, short e) {
  return (((hi & 31) << 7) | ((lo & 31) << 2) | (e & 3));
}


x86 assembly (clang, -O0):
<joinup>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x2(%rbp),%eax
and    $0x1f,%eax
shl    $0x7,%eax
movswl -0x4(%rbp),%ecx
and    $0x1f,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
movswl -0x6(%rbp),%ecx
and    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<joinup>:
and    $0x1f,%edi
shl    $0x7,%edi
and    $0x1f,%esi
lea    (%rdi,%rsi,4),%eax
and    $0x3,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @joinup(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = and i32 %8, 31
%10 = shl i32 %9, 7
%11 = load i16, i16* %5
%12 = sext i16 %11 to i32
%13 = and i32 %12, 31
%14 = shl i32 %13, 2
%15 = or i32 %10, %14
%16 = load i16, i16* %6
%17 = sext i16 %16 to i32
%18 = and i32 %17, 3
%19 = or i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @joinup(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = shl i16 %0, 7
%5 = and i16 %4, 3968
%6 = shl i16 %1, 2
%7 = and i16 %6, 124
%8 = or i16 %7, %5
%9 = and i16 %2, 3
%10 = or i16 %8, %9
%11 = zext i16 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ perror_exit(char *);
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void join_thread(pthread_t thread) {
  int ret = pthread_join(thread, NULL);
  if (ret == -1) {
    perror_exit("pthread_join failed");
  }
}


x86 assembly (clang, -O0):
<join_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1150 <join_thread+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <perror_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_thread>:
push   %rax
xor    %esi,%esi
call   1040 <pthread_join@plt>
cmp    $0xffffffff,%eax
je     112f <join_thread+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1030 <perror_exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"pthread_join failed\00"
define void @join_thread(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @pthread_join(i32 %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror_exit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"pthread_join failed\00"
define void @join_thread(i32 %0) {
%2 = tail call i32 @pthread_join(i32 %0, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror_exit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
long unsigned int elapsed_usecs(long unsigned int sec,
                                long unsigned int microsec) {
  return (sec * 1000000) + microsec;
}


x86 assembly (clang, -O0):
<elapsed_usecs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_usecs>:
imul   $0xf4240,%rdi,%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @elapsed_usecs(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 = mul i64 %5, 1000000
%7 = load i64, i64* %4
%8 = add i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @elapsed_usecs(i64 %0, i64 %1) {
%3 = mul i64 %0, 1000000
%4 = add i64 %3, %1
ret i64 %4
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};
struct Cyc_JumpAnalysis_Jump_Anal_Result {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
Cyc_NewControlFlow_cf_check(struct Cyc_JumpAnalysis_Jump_Anal_Result *,
                            struct Cyc_List_List *);
struct Cyc_List_List *
Cyc_do_cfcheck(struct Cyc_JumpAnalysis_Jump_Anal_Result *tables,
               struct Cyc_List_List *tds) {
  struct Cyc_List_List *_T0;
  Cyc_NewControlFlow_cf_check(tables, tds);
  _T0 = tds;
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_do_cfcheck>:
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   1030 <Cyc_NewControlFlow_cf_check@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_do_cfcheck>:
push   %rbx
mov    %rsi,%rbx
call   1030 <Cyc_NewControlFlow_cf_check@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_cfcheck(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* %1) {
%3 = alloca %struct.Cyc_JumpAnalysis_Jump_Anal_Result*
%4 = alloca %struct.Cyc_List_List*
%5 = alloca %struct.Cyc_List_List*
store %struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_JumpAnalysis_Jump_Anal_Result** %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_JumpAnalysis_Jump_Anal_Result*, %struct.Cyc_JumpAnalysis_Jump_Anal_Result** %3
%7 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%8 = call i32 @Cyc_NewControlFlow_cf_check(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %6, %struct.Cyc_List_List* %7)
%9 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
store %struct.Cyc_List_List* %9, %struct.Cyc_List_List** %5
%10 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
ret %struct.Cyc_List_List* %10
}

LLVM IR (-O2):
%struct.Cyc_JumpAnalysis_Jump_Anal_Result = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_cfcheck(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* returned %1) {
%3 = tail call i32 @Cyc_NewControlFlow_cf_check(%struct.Cyc_JumpAnalysis_Jump_Anal_Result* %0, %struct.Cyc_List_List* %1)
ret %struct.Cyc_List_List* %1
}
/* Variables and functions */
int /*<<< orphan*/ Serial1Flush();
void FlushCOM(int portnum) {
  portnum;
  Serial1Flush();
}


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

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

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

LLVM IR (-O2):
define void @FlushCOM(i32 %0) {
%2 = tail call i32 (...) @Serial1Flush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
void sample1() {
  char a[] = "abc";
  printf("\n--- Permutations for %s: \n", a);
  permute(a, 0, 2);
}


x86 assembly (clang, -O0):
<sample1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <permute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample1>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <permute@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.sample1.a = [4 x i8] c"abc\00"
@.str = [28 x i8] c"\0A--- Permutations for %s: \0A\00"
define void @sample1() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = call i32 @permute(i8* %5, i32 0, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0A--- Permutations for %s: \0A\00"
define void @sample1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @permute(i8* %2, i32 0, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int remove_shmem(int id) { return shmctl(id, IPC_RMID, 0); }


x86 assembly (clang, -O0):
<remove_shmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <shmctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_shmem>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <shmctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @remove_shmem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @shmctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @remove_shmem(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @shmctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
float my_random_float();
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ srandom(int);
main(int argc, char *argv[]) {
  int i;
  float f;
  double t0, t1;
  int iters = 1000;
  int seed = 17;
  srandom(seed);
  for (i = 0; i < iters; i++) {
    f = my_random_float();
    printf("%f\n", f);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x2c(%rbp)
movl   $0x11,-0x30(%rbp)
mov    -0x30(%rbp),%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    119a <main+0x6a>
mov    $0x0,%al
call   1050 <my_random_float@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <main+0x33>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x11,%edi
call   1030 <srandom@plt>
mov    $0x3e8,%ebp
lea    0xeb7(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <my_random_float@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %10
store i32 17, i32* %11
%12 = load i32, i32* %11
%13 = call i32 @srandom(i32 %12)
store i32 0, i32* %6
br label %14
14: ; preds = %22, %2
%15 = load i32, i32* %6
%16 = load i32, i32* %10
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = call float (...) @my_random_float()
store float %19, float* %7
%20 = load float, float* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %14
25: ; preds = %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @srandom(i32 17)
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call float (...) @my_random_float()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 1000
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ val(int *);
int sum(int *x, int *y) {
  val(x);
  puts("This is SUM Method!=========HDH");
  return *x + *y;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <val@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <val@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%eax
add    (%rbx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"This is SUM Method!=========HDH\00"
define i32 @sum(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = call i32 @val(i32* %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
@.str = [32 x i8] c"This is SUM Method!=========HDH\00"
define i32 @sum(i32* %0, i32* nocapture %1) {
%3 = tail call i32 @val(i32* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, %5
ret i32 %7
}
unsigned int delta(int start, int end, int mod) {
  start %= mod;
  end %= mod;
  if (end >= start) {
    return end - start;
  }
  return mod - start + end;
}


x86 assembly (clang, -O0):
<delta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     113f <delta+0x3f>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <delta+0x4b>
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
mov    %edx,%edi
mov    %esi,%eax
cltd
idiv   %ecx
xor    %eax,%eax
sub    %edi,%edx
cmovl  %ecx,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @delta(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %0, %2
%5 = srem i32 %1, %2
%6 = icmp slt i32 %5, %4
%7 = select i1 %6, i32 %2, i32 0
%8 = sub i32 %5, %4
%9 = add i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int stricmp(char *, char *);
int lcexceptionscmp(const void *a, const void *b) {
  return stricmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<lcexceptionscmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <stricmp@plt>

LLVM IR (-O0):
define i32 @lcexceptionscmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @stricmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcexceptionscmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @stricmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
char tolower(unsigned char);
void Tolower(char *q) {
  char *s = q;
  while (*s) {
    *s = tolower((unsigned char)*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<Tolower>:
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 <Tolower+0x46>
mov    -0x10(%rbp),%rax
movzbl (%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 <Tolower+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <Tolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <Tolower+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Tolower(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 = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call signext i8 @tolower(i8 zeroext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @Tolower(i8* nocapture %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 zeroext %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 void
}
/* Variables and functions */
int app_exec(int, char **);
int main(int argc, char *argv[]) { return app_exec(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <app_exec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <app_exec@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @app_exec(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @app_exec(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
double linearInterpolation(double, double, double);
double bilinearInterpolation(double c00, double c10, double c01, double c11,
                             double tx, double ty) {
  return linearInterpolation(linearInterpolation(c00, c10, tx),
                             linearInterpolation(c01, c11, tx), ty);
}


x86 assembly (clang, -O0):
<bilinearInterpolation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <linearInterpolation@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <linearInterpolation@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
call   1030 <linearInterpolation@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bilinearInterpolation>:
sub    $0x28,%rsp
movsd  %xmm5,0x20(%rsp)
movsd  %xmm4,(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movaps %xmm4,%xmm2
call   1030 <linearInterpolation@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1030 <linearInterpolation@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm2
add    $0x28,%rsp
jmp    1030 <linearInterpolation@plt>

LLVM IR (-O0):
define double @bilinearInterpolation(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %11
%16 = call double @linearInterpolation(double %13, double %14, double %15)
%17 = load double, double* %9
%18 = load double, double* %10
%19 = load double, double* %11
%20 = call double @linearInterpolation(double %17, double %18, double %19)
%21 = load double, double* %12
%22 = call double @linearInterpolation(double %16, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @bilinearInterpolation(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @linearInterpolation(double %0, double %1, double %4)
%8 = tail call double @linearInterpolation(double %2, double %3, double %4)
%9 = tail call double @linearInterpolation(double %7, double %8, double %5)
ret double %9
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ UINT32_MAX;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           unsigned long long);
int /*<<< orphan*/ stderr;
__attribute__((unused)) unsigned long
gt_safecast_uint64_t_unsigned_long(const char *filename, int line,
                                   uint64_t from) {
  if (sizeof(uint64_t) > sizeof(unsigned long)) {
    if (from > (uint64_t)UINT32_MAX) {
      fprintf(stderr, "%s, %d: %llu cannot be stored in 32bit word", filename,
              line, ((unsigned long long)(from)));
      exit(2);
    }
  }
  return (unsigned long)from;
}


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

x86 assembly (clang, -O2):
<gt_safecast_uint64_t_unsigned_long>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
@UINT32_MAX = global i64 0
@stderr = global i32 0
define i64 @gt_safecast_uint64_t_unsigned_long(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
@UINT32_MAX = global i64 0
@stderr = global i32 0
define i64 @gt_safecast_uint64_t_unsigned_long(i8* nocapture readnone %0, i32 %1, i64 returned %2) {
ret i64 %2
}
unsigned int dtoh(char *len) {
  unsigned char *tmp = (unsigned char *)len;
  return (tmp[0] << 16) + (tmp[1] << 8) + tmp[2];
}


x86 assembly (clang, -O0):
<dtoh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x10,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtoh>:
movzbl (%rdi),%eax
shl    $0x10,%eax
movzbl 0x1(%rdi),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x2(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dtoh(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 16
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = add nsw i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @dtoh(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 16
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
ret i32 %13
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_dimension_of_standard_solutions(int *dimension) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc(33, a, dimension, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_dimension_of_standard_solutions>:
mov    %rdi,%rdx
mov    $0x21,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @solcon_dimension_of_standard_solutions(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 33, i32* undef, i32* %0, double* undef)
ret i32 %2
}
void FLUSH_REDRAW(void) {}


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

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

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

LLVM IR (-O2):
define void @FLUSH_REDRAW() {
ret void
}
/* Variables and functions */
unsigned int ntohl(unsigned int);
int /*<<< orphan*/ snprintf(char *, size_t, char *, unsigned int, unsigned int,
                            unsigned int, unsigned int);
char *sprint_ip_addr(char *buf, size_t sz, unsigned int addr) {
  addr = ntohl(addr);
  snprintf(buf, sz, "%d.%d.%d.%d", (addr >> 24) & 0xFF, (addr >> 16) & 0xFF,
           (addr >> 8) & 0xFF, (addr >> 0) & 0xFF);
  return buf;
}


x86 assembly (clang, -O0):
<sprint_ip_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
mov    -0x14(%rbp),%r8d
shr    $0x10,%r8d
and    $0xff,%r8d
mov    -0x14(%rbp),%r9d
shr    $0x8,%r9d
and    $0xff,%r9d
mov    -0x14(%rbp),%eax
shr    $0x0,%eax
and    $0xff,%eax
lea    0xe7e(%rip),%rdx
mov    %eax,(%rsp)
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_ip_addr>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%edi
call   1040 <ntohl@plt>
mov    %eax,%edx
movzbl %ah,%ebp
movzbl %al,%esi
mov    %eax,%ecx
shr    $0x18,%ecx
shr    $0x10,%edx
movzbl %dl,%r8d
mov    %esi,(%rsp)
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%r9d
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @sprint_ip_addr(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @ntohl(i32 %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = load i32, i32* %6
%12 = lshr i32 %11, 24
%13 = and i32 %12, 255
%14 = load i32, i32* %6
%15 = lshr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32, i32* %6
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = load i32, i32* %6
%21 = lshr i32 %20, 0
%22 = and i32 %21, 255
%23 = call i32 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16, i32 %19, i32 %22)
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @sprint_ip_addr(i8* returned %0, i64 %1, i32 %2) {
%4 = tail call i32 @ntohl(i32 %2)
%5 = lshr i32 %4, 24
%6 = lshr i32 %4, 16
%7 = and i32 %6, 255
%8 = lshr i32 %4, 8
%9 = and i32 %8, 255
%10 = and i32 %4, 255
%11 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i32 %9, i32 %10)
ret i8* %0
}
__attribute__((always_)) int return_0(int ret) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @return_0(i32 %0) {
ret i32 0
}