xunge/DecIR huggingface dataset:
char asctohex11(char ch1, char ch2) {
  char ch;
  if (ch1 >= 'A')
    ch = (char)((ch1 - 0x37) << 4);
  else
    ch = (char)((ch1 - '0') << 4);
  if (ch2 >= 'A')
    ch |= ch2 - 0x37;
  else
    ch |= ch2 - '0';
  return ch;
}


x86 assembly (clang, -O0):
<asctohex11>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     112f <asctohex11+0x2f>
movsbl -0x1(%rbp),%eax
sub    $0x37,%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
jmp    113c <asctohex11+0x3c>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115e <asctohex11+0x5e>
movsbl -0x2(%rbp),%ecx
sub    $0x37,%ecx
movsbl -0x3(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x3(%rbp)
jmp    116e <asctohex11+0x6e>
movsbl -0x2(%rbp),%ecx
sub    $0x30,%ecx
movsbl -0x3(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctohex11>:
mov    %edi,%eax
shl    $0x4,%al
lea    -0x70(%rax),%ecx
cmp    $0x41,%dil
movzbl %al,%eax
movzbl %cl,%ecx
cmovl  %eax,%ecx
cmp    $0x41,%sil
mov    $0xc9,%edx
mov    $0xd0,%eax
cmovge %edx,%eax
add    %sil,%al
or     %cl,%al
ret

LLVM IR (-O0):
define signext i8 @asctohex11(i8 signext %0, i8 signext %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 = sext i8 %6 to i32
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 55
%13 = shl i32 %12, 4
%14 = trunc i32 %13 to i8
store i8 %14, i8* %5
br label %21
15: ; preds = %2
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 48
%19 = shl i32 %18, 4
%20 = trunc i32 %19 to i8
store i8 %20, i8* %5
br label %21
21: ; preds = %15, %9
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 55
%29 = load i8, i8* %5
%30 = sext i8 %29 to i32
%31 = or i32 %30, %28
%32 = trunc i32 %31 to i8
store i8 %32, i8* %5
br label %41
33: ; preds = %21
%34 = load i8, i8* %4
%35 = sext i8 %34 to i32
%36 = sub nsw i32 %35, 48
%37 = load i8, i8* %5
%38 = sext i8 %37 to i32
%39 = or i32 %38, %36
%40 = trunc i32 %39 to i8
store i8 %40, i8* %5
br label %41
41: ; preds = %33, %25
%42 = load i8, i8* %5
ret i8 %42
}

LLVM IR (-O2):
define signext i8 @asctohex11(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 64
%4 = shl i8 %0, 4
%5 = add i8 %4, -112
%6 = select i1 %3, i8 %5, i8 %4
%7 = icmp sgt i8 %1, 64
%8 = select i1 %7, i8 -55, i8 -48
%9 = add i8 %8, %1
%10 = or i8 %9, %6
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ getid(int);
int /*<<< orphan*/ print(int /*<<< orphan*/);
void main() {
  int d;
  getid(d);
  print(f(d));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1040 <getid@plt>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1050 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <getid@plt>
call   1030 <f@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <print@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @getid(i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @f(i32 %4)
%6 = call i32 @print(i32 %5)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @getid(i32 undef)
%2 = tail call i32 @f(i32 undef)
%3 = tail call i32 @print(i32 %2)
ret void
}
void empty_sighandler() {}


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

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

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

LLVM IR (-O2):
define void @empty_sighandler() {
ret void
}
void geom_CM_cart_xyz(double xm[], double xp[], double xc[]) {
  xc[0] = 0.5 * (xm[0] + xp[0]);
  xc[1] = 0.5 * (xm[1] + xp[1]);
}


x86 assembly (clang, -O0):
<geom_CM_cart_xyz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm1
movsd  0xed8(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_CM_cart_xyz>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  0xef0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @geom_CM_cart_xyz(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 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fadd double %9, %12
%14 = fmul double 5.000000e-01, %13
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 0
store double %14, double* %16
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fadd double %19, %22
%24 = fmul double 5.000000e-01, %23
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 1
store double %24, double* %26
ret void
}

LLVM IR (-O2):
define void @geom_CM_cart_xyz(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fadd double %4, %5
%7 = fmul double %6, 5.000000e-01
store double %7, double* %2
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = getelementptr inbounds double, double* %1, i64 1
%11 = load double, double* %10
%12 = fadd double %9, %11
%13 = fmul double %12, 5.000000e-01
%14 = getelementptr inbounds double, double* %2, i64 1
store double %13, double* %14
ret void
}
/* Variables and functions */
float sqrt(float);
float distance(float x1, float y1, float x2, float y2) {
  float x_diff = (x1 - x2);
  float y_diff = (y1 - y2);
  return sqrt(x_diff * x_diff + y_diff * y_diff);
}


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

x86 assembly (clang, -O2):
<distance>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <distance+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %5
%12 = load float, float* %7
%13 = fsub float %11, %12
store float %13, float* %9
%14 = load float, float* %6
%15 = load float, float* %8
%16 = fsub float %14, %15
store float %16, float* %10
%17 = load float, float* %9
%18 = load float, float* %9
%19 = load float, float* %10
%20 = load float, float* %10
%21 = fmul float %19, %20
%22 = call float @llvm.fmuladd.f32(float %17, float %18, float %21)
%23 = call float @sqrt(float %22)
ret float %23
}

LLVM IR (-O2):
define float @distance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrt(float %8)
ret float %9
}
int test_imm_85int64_highword_reg(long long val) {
  return ((val >> 32) & (0x85 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_85int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 133
%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_85int64_highword_reg(i64 %0) {
%2 = and i64 %0, 571230650368
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double phi(double u) {
  if (u < 0)
    return 0;
  if (u > 1)
    return .06;
  return .06 * u;
}


x86 assembly (clang, -O0):
<phi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1124 <phi+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <phi+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <phi+0x4d>
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <phi+0x5f>
movsd  0xeb3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1129 <phi+0x29>
ucomisd 0xef6(%rip),%xmm0
jbe    111d <phi+0x1d>
movsd  0xee4(%rip),%xmm0
ret
mulsd  0xedb(%rip),%xmm0
movapd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @phi(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 6.000000e-02, double* %2
br label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = fmul double 6.000000e-02, %12
store double %13, double* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @phi(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 1.000000e+00
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fmul double %0, 6.000000e-02
br label %7
7: ; preds = %3, %1, %5
%8 = phi double [ %6, %5 ], [ 0.000000e+00, %1 ], [ 6.000000e-02, %3 ]
ret double %8
}
int igsy_l2sec_version_set(unsigned int dev_id,
                           union igsy_l2sec_version_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.igsy_l2sec_version_u = type opaque
define i32 @igsy_l2sec_version_set(i32 %0, %union.igsy_l2sec_version_u* %1) {
%3 = alloca i32
%4 = alloca %union.igsy_l2sec_version_u*
store i32 %0, i32* %3
store %union.igsy_l2sec_version_u* %1, %union.igsy_l2sec_version_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.igsy_l2sec_version_u = type opaque
define i32 @igsy_l2sec_version_set(i32 %0, %union.igsy_l2sec_version_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(void) {
  fprintf(stderr, "This is stderr\n");
  ;
  fprintf(stdout, "This is stdout\n");
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"This is stderr\0A\00"
@stdout = global i32 0
@.str.1 = [16 x i8] c"This is stdout\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"This is stderr\0A\00"
@stdout = global i32 0
@.str.1 = [16 x i8] c"This is stdout\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int creat(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ fd_set_close_on_exec(int);
int creat_cloexec(const char *pathname, mode_t mode) {
  int fd = creat(pathname, mode);
  if (fd >= 0)
    fd_set_close_on_exec(fd);
  return fd;
}


x86 assembly (clang, -O0):
<creat_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <creat@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1150 <creat_cloexec+0x30>
mov    -0x10(%rbp),%edi
call   1030 <fd_set_close_on_exec@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat_cloexec>:
push   %rbx
call   1040 <creat@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1133 <creat_cloexec+0x13>
mov    %ebx,%edi
call   1030 <fd_set_close_on_exec@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @creat_cloexec(i8* %0, i32 %1) {
%3 = tail call i32 @creat(i8* %0, i32 %1)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fd_set_close_on_exec(i32 %3)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int ends_with(char const *, char *);
int xdg_mime_is_super_type(const char *mime) { return ends_with(mime, "/*"); }


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

x86 assembly (clang, -O2):
<xdg_mime_is_super_type>:
lea    0xee9(%rip),%rsi
jmp    1030 <ends_with@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"/*\00"
define i32 @xdg_mime_is_super_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ends_with(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"/*\00"
define i32 @xdg_mime_is_super_type(i8* %0) {
%2 = tail call i32 @ends_with(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
long C_i_fixnum_min(long x, long y) { return ((long)x < (long)y) ? x : y; }


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

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

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

LLVM IR (-O2):
define i64 @C_i_fixnum_min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap_btol32(uint32_t data) {
  uint32_t swapped_data;
  swapped_data = (data >> 24) & 0x000000FF;
  swapped_data |= (data >> 8) & 0x0000FF00;
  swapped_data |= (data << 8) & 0x00FF0000;
  swapped_data |= (data << 24) & 0xFF000000;
  return swapped_data;
}


x86 assembly (clang, -O0):
<swap_btol32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff00,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_btol32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swap_btol32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 24
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = and i32 %8, 65280
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = shl i32 %12, 8
%14 = and i32 %13, 16711680
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = shl i32 %17, 24
%19 = and i32 %18, -16777216
%20 = load i32, i32* %3
%21 = or i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @swap_btol32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *MEM_CALLOC(size_t size) {
  void *chunk;
  if (!(chunk = malloc(size)))
    return NULL;
  memset(chunk, 0, size);
  return chunk;
}


x86 assembly (clang, -O0):
<MEM_CALLOC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1150 <MEM_CALLOC+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1167 <MEM_CALLOC+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MEM_CALLOC>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <MEM_CALLOC+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @MEM_CALLOC(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
void fill_buffer(char *buf, int len) {
  int ind;
  for (ind = 0; ind < len - 1; ind++)
    buf[ind] = 1;
  buf[ind] = 0;
}


x86 assembly (clang, -O0):
<fill_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    113d <fill_buffer+0x3d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <fill_buffer+0x12>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmp    $0x2,%esi
jl     1133 <fill_buffer+0x23>
mov    %esi,%ebx
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    1135 <fill_buffer+0x25>
xor    %ebx,%ebx
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @fill_buffer(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
%7 = add nsw i32 %1, -1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %4, %2
%10 = phi i64 [ 0, %2 ], [ %8, %4 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void Aktion(int Zustand, char *Zeichen) {
  printf("(Zustand %i) ---%s-->\n", Zustand, Zeichen);
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"(Zustand %i) ---%s-->\0A\00"
define void @Aktion(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_or_sint(struct Var *avar, const char *areg, const char *lreg,
                    const char *rreg) {
  pA("%s = %s | %s;", areg, lreg, rreg);
}


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

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s | %s;\00"
define void @__func_or_sint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s | %s;\00"
define void @__func_or_sint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
int produceReturnValueFour(a)
int a;
{
  int b = a + 1;
  return b;
}


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

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

LLVM IR (-O0):
define i32 @produceReturnValueFour(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @produceReturnValueFour(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void mp2vseq_set_vbvbuffer(uint8_t *p_mp2vseq, uint16_t i_vbvbuffer) {
  p_mp2vseq[10] &= 0xe0;
  p_mp2vseq[10] |= (i_vbvbuffer >> 5) & 0x1f;
  p_mp2vseq[11] &= 0x7;
  p_mp2vseq[11] |= (i_vbvbuffer << 3) & 0xf8;
}


x86 assembly (clang, -O0):
<mp2vseq_set_vbvbuffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%ecx
and    $0xe0,%ecx
mov    %ecx,0x28(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
and    $0x1f,%ecx
mov    -0x8(%rbp),%rax
or     0x28(%rax),%ecx
mov    %ecx,0x28(%rax)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%ecx
and    $0x7,%ecx
mov    %ecx,0x2c(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
and    $0xf8,%ecx
mov    -0x8(%rbp),%rax
or     0x2c(%rax),%ecx
mov    %ecx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_set_vbvbuffer>:
mov    $0xe0,%eax
and    0x28(%rdi),%eax
mov    %esi,%ecx
shr    $0x5,%ecx
and    $0x1f,%ecx
or     %eax,%ecx
mov    %ecx,0x28(%rdi)
mov    0x2c(%rdi),%eax
and    $0x7,%eax
and    $0x1f,%esi
lea    (%rax,%rsi,8),%eax
mov    %eax,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseq_set_vbvbuffer(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 = getelementptr inbounds i32, i32* %5, i64 10
%7 = load i32, i32* %6
%8 = and i32 %7, 224
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = ashr i32 %9, 5
%11 = and i32 %10, 31
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 10
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 11
%18 = load i32, i32* %17
%19 = and i32 %18, 7
store i32 %19, i32* %17
%20 = load i32, i32* %4
%21 = shl i32 %20, 3
%22 = and i32 %21, 248
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 11
%25 = load i32, i32* %24
%26 = or i32 %25, %22
store i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @mp2vseq_set_vbvbuffer(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 10
%4 = load i32, i32* %3
%5 = and i32 %4, 224
%6 = lshr i32 %1, 5
%7 = and i32 %6, 31
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = getelementptr inbounds i32, i32* %0, i64 11
%10 = load i32, i32* %9
%11 = and i32 %10, 7
%12 = shl i32 %1, 3
%13 = and i32 %12, 248
%14 = or i32 %11, %13
store i32 %14, i32* %9
ret void
}
/* Variables and functions */
int def_shell_mode();
int wrap_def_shell_mode(void) { return def_shell_mode(); }


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

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

LLVM IR (-O0):
define i32 @wrap_def_shell_mode() {
%1 = call i32 (...) @def_shell_mode()
ret i32 %1
}

LLVM IR (-O2):
define i32 @wrap_def_shell_mode() {
%1 = tail call i32 (...) @def_shell_mode()
ret i32 %1
}
void task_go_to_run() {}


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

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

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

LLVM IR (-O2):
define void @task_go_to_run() {
ret void
}
int valid_digit(char *ip) {
  while (*ip) {
    if (*ip >= '0' && *ip <= '9')
      ++ip;
    else
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<valid_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <valid_digit+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1146 <valid_digit+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1146 <valid_digit+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <valid_digit+0x52>
movl   $0x0,-0x4(%rbp)
jmp    115e <valid_digit+0x5e>
jmp    1108 <valid_digit+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_digit>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <valid_digit+0x23>
add    $0x1,%rdi
nop
add    $0xd0,%cl
cmp    $0xa,%cl
jae    1124 <valid_digit+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <valid_digit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @valid_digit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -48
%11 = icmp ult i8 %10, 10
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %4, label %13
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int strcmp(char *, char *);
int pstrcmp(char **x, char **y) { return strcmp(*x, *y); }


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

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

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

LLVM IR (-O2):
define i32 @pstrcmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("rls by RK, version "
         "0.7"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"rls by RK, version 0.7\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double log(double);
double psih_func(double x) {
  double psih;
  psih = 2.0 * log((1.0 + (x * x)) / 2.0);
  return (psih);
}


x86 assembly (clang, -O0):
<psih_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xead(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psih_func>:
push   %rax
mulsd  %xmm0,%xmm0
addsd  0xee3(%rip),%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <log@plt>
addsd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @psih_func(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = fdiv double %6, 2.000000e+00
%8 = call double @log(double %7)
%9 = fmul double 2.000000e+00, %8
store double %9, double* %3
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @psih_func(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = fmul double %2, 5.000000e-01
%4 = tail call double @log(double %3)
%5 = fmul double %4, 2.000000e+00
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int RAND_bytes(int /*<<< orphan*/ *, int);
int _mongoc_rand_bytes(uint8_t *buf, int num) { return RAND_bytes(buf, num); }


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

x86 assembly (clang, -O2):
<_mongoc_rand_bytes>:
jmp    1030 <RAND_bytes@plt>

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

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

/* Variables and functions */
int a_ctz_l(int);
int a_ctz_64(uint64_t x) {
  uint32_t y = x;
  if (!y) {
    y = x >> 32;
    return 32 + a_ctz_l(y);
  }
  return a_ctz_l(y);
}


x86 assembly (clang, -O0):
<a_ctz_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114b <a_ctz_64+0x3b>
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <a_ctz_l@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <a_ctz_64+0x46>
mov    -0xc(%rbp),%edi
call   1030 <a_ctz_l@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_ctz_64>:
test   %edi,%edi
je     1119 <a_ctz_64+0x9>
jmp    1030 <a_ctz_l@plt>
push   %rax
call   1030 <a_ctz_l@plt>
add    $0x20,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @a_ctz_64(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @a_ctz_l(i32 poison)
%5 = add nsw i32 %4, 32
br label %8
6: ; preds = %1
%7 = tail call i32 @a_ctz_l(i32 %0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ %5, %3 ]
ret i32 %9
}
void RTP_set_payload_type(unsigned char *p, int v) {
  p[1] = (p[1] & 0x80) | (unsigned char)(v & 0x0000007f);
}


x86 assembly (clang, -O0):
<RTP_set_payload_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x80,%eax
mov    -0xc(%rbp),%ecx
and    $0x7f,%ecx
movzbl %cl,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_set_payload_type>:
mov    0x1(%rdi),%al
and    $0x80,%al
and    $0x7f,%sil
or     %al,%sil
mov    %sil,0x1(%rdi)
ret

LLVM IR (-O0):
define void @RTP_set_payload_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, 128
%10 = load i32, i32* %4
%11 = and i32 %10, 127
%12 = trunc i32 %11 to i8
%13 = zext i8 %12 to i32
%14 = or i32 %9, %13
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @RTP_set_payload_type(i8* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = and i8 %4, -128
%6 = trunc i32 %1 to i8
%7 = and i8 %6, 127
%8 = or i8 %5, %7
store i8 %8, i8* %3
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char *);
void pressEnter(char *text) {
  printf("%s\n", text);
  printf("press Enter...\n...", text);
  while (getchar() >= ' ')
    ;
}


x86 assembly (clang, -O0):
<pressEnter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0x20,%eax
jl     1164 <pressEnter+0x44>
jmp    114c <pressEnter+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pressEnter>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0x1f,%al
jg     1150 <pressEnter+0x30>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [19 x i8] c"press Enter...\0A...\00"
define void @pressEnter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %11, %1
%8 = call signext i8 (...) @getchar()
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 32
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [19 x i8] c"press Enter...\0A...\00"
define void @pressEnter(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %4
4: ; preds = %4, %1
%5 = tail call signext i8 (...) @getchar()
%6 = icmp sgt i8 %5, 31
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
int iswhitespace(char c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}


x86 assembly (clang, -O0):
<iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <iswhitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <iswhitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <iswhitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhitespace>:
cmp    $0x20,%dil
ja     1120 <iswhitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <iswhitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @iswhitespace(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, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @iswhitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ code;

/* Variables and functions */
int /*<<< orphan*/ __console_write(char const *, int);
void console_turquoise() {
  static const char code[] = {0x1b, '[', '3', '6', ';', '0', '1', 'm'};
  __console_write(code, sizeof(code));
}


x86 assembly (clang, -O0):
<console_turquoise>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
call   1030 <__console_write@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@console_turquoise.code = internal constant [8 x i8] c"\1B[36;01m"
define void @console_turquoise() {
%1 = call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_turquoise.code, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@console_turquoise.code = internal constant [8 x i8] c"\1B[36;01m"
define void @console_turquoise() {
%1 = tail call i32 @__console_write(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @console_turquoise.code, i64 0, i64 0), i32 8)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int);
void log_read(FILE *fp, char *name, uint32_t addr, uint32_t data) {
  fprintf(fp, "READ: \tREG:%-40s  \t ADDR:0x%-10x  \t DATA:0x%-10x\n", name,
          addr, data);
}


x86 assembly (clang, -O0):
<log_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_read>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
lea    0xee1(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"READ: \09REG:%-40s \09 ADDR:0x%-10x \09 DATA:0x%-10x\0A\00"
define void @log_read(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"READ: \09REG:%-40s \09 ADDR:0x%-10x \09 DATA:0x%-10x\0A\00"
define void @log_read(i32* nocapture %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i32 %3)
ret void
}
void PyDTrace_INSTANCE_NEW_DONE(int arg0) {}


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

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

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

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