xunge/DecIR huggingface dataset:
float ct_stepf(const float x, const float edge, const float y1,
               const float y2) {
  return (x < edge ? y1 : y2);
}


x86 assembly (clang, -O0):
<ct_stepf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <ct_stepf+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1144 <ct_stepf+0x44>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_stepf>:
cmpltss %xmm1,%xmm0
andps  %xmm0,%xmm2
andnps %xmm3,%xmm0
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @ct_stepf(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = fcmp olt float %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load float, float* %7
br label %16
14: ; preds = %4
%15 = load float, float* %8
br label %16
16: ; preds = %14, %12
%17 = phi float [ %13, %12 ], [ %15, %14 ]
ret float %17
}

LLVM IR (-O2):
define float @ct_stepf(float %0, float %1, float %2, float %3) {
%5 = fcmp olt float %0, %1
%6 = select i1 %5, float %2, float %3
ret float %6
}
_poke(i, j) int i, j;
{
  char *p;
  p = (char *)i;
  *p = j;
}


x86 assembly (clang, -O0):
<_poke>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_poke>:
movslq %edi,%rax
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define i32 @_poke(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = load i32, i32* %5
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %6
store i8 %11, i8* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @_poke(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i8*
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
ret i32 undef
}
/* Variables and functions */
scalar_t__ isalph(char);
scalar_t__ isnum(char);
int isalpnum(char c) { return isalph(c) || isnum(c); }


x86 assembly (clang, -O0):
<isalpnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalph@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <isalpnum+0x3c>
movsbl -0x1(%rbp),%edi
call   1040 <isnum@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpnum>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalph@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalpnum+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <isnum@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalpnum(i8 signext %0) {
%2 = tail call i64 @isalph(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isnum(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
void cleanup() {
  rmdir("writeable");
  rmdir("unwriteable");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee7(%rip),%rdi
call   1030 <rmdir@plt>
lea    0xed9(%rip),%rdi
call   1030 <rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <rmdir@plt>
lea    0xedc(%rip),%rdi
pop    %rax
jmp    1030 <rmdir@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"writeable\00"
@.str.1 = [12 x i8] c"unwriteable\00"
define void @cleanup() {
%1 = call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @rmdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"writeable\00"
@.str.1 = [12 x i8] c"unwriteable\00"
define void @cleanup() {
%1 = tail call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @rmdir(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int bitrev8(int p) {
  p = ((p & 0xF) << 4) | ((p >> 4) & 0xF);
  p = ((p & 0x33) << 2) | ((p >> 2) & 0x33);
  p = ((p & 0x55) << 1) | ((p >> 1) & 0x55);
  return p;
}


x86 assembly (clang, -O0):
<bitrev8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33,%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitrev8>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @bitrev8(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
struct sub *NewSub(void) {
  return (0);
}


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

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

LLVM IR (-O0):
%struct.sub = type opaque
define %struct.sub* @NewSub() {
ret %struct.sub* null
}

LLVM IR (-O2):
%struct.sub = type opaque
define noalias %struct.sub* @NewSub() {
ret %struct.sub* null
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_getstackaddr(const pthread_attr_t *a, void **b) { assert(0); }


x86 assembly (clang, -O0):
<pthread_attr_getstackaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_attr_getstackaddr(i32* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
void console_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @console_exit() {
ret void
}
/* Variables and functions */
int ls_cost_nm5_f0(double const **, double **, int *, double *, int);
int ls_cost_nm5(const double **arg, double **res, int *iw, double *w, int mem) {
  return ls_cost_nm5_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<ls_cost_nm5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <ls_cost_nm5_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm5>:
jmp    1030 <ls_cost_nm5_f0@plt>

LLVM IR (-O0):
define i32 @ls_cost_nm5(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @ls_cost_nm5_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ls_cost_nm5(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @ls_cost_nm5_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _du_error(char const *error) {
  fputs("du"
        ": ",
        stderr);
  perror(error);
  return 1;
}


x86 assembly (clang, -O0):
<_du_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_du_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"du: \00"
@stderr = global i32 0
define i32 @_du_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 @perror(i8* %5)
ret i32 1
}

LLVM IR (-O2):
@.str = [5 x i8] c"du: \00"
@stderr = global i32 0
define i32 @_du_error(i8* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @perror(i8* %0)
ret i32 1
}
int XDeleteContext() {}


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

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

LLVM IR (-O0):
define i32 @XDeleteContext() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XDeleteContext() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_hex32(unsigned int);
void print_crit_hex32(unsigned int value) { __console_tx_hex32(value); }


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

x86 assembly (clang, -O2):
<print_crit_hex32>:
jmp    1030 <__console_tx_hex32@plt>

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

LLVM IR (-O2):
define void @print_crit_hex32(i32 %0) {
%2 = tail call i32 @__console_tx_hex32(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_from_string() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_from_string"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_proplist_from_string\00"
define i32 @pa_proplist_from_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned char *medusaReceiveDataInternal(int, int *, int /*<<< orphan*/, int,
                                         int /*<<< orphan*/);
unsigned char *medusaReceiveRaw(int socket, int *nBufferSize) {
  return medusaReceiveDataInternal(socket, nBufferSize, 0, 20 * 1000000, 0);
}


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

x86 assembly (clang, -O2):
<medusaReceiveRaw>:
xor    %edx,%edx
mov    $0x1312d00,%ecx
xor    %r8d,%r8d
jmp    1030 <medusaReceiveDataInternal@plt>

LLVM IR (-O0):
define i8* @medusaReceiveRaw(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 i8* @medusaReceiveDataInternal(i32 %5, i32* %6, i32 0, i32 20000000, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @medusaReceiveRaw(i32 %0, i32* %1) {
%3 = tail call i8* @medusaReceiveDataInternal(i32 %0, i32* %1, i32 0, i32 20000000, i32 0)
ret i8* %3
}
int prog_rbit(int a) {
  int h = 0;
  for (int i = 0; i < 32; i++) {
    h = (h << 1) + (a & 1);
    a >>= 1;
  }
  return h;
}


x86 assembly (clang, -O0):
<prog_rbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1147 <prog_rbit+0x47>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <prog_rbit+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prog_rbit>:
xor    %eax,%eax
mov    $0x20,%ecx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
shl    $0x2,%edx
lea    (%rdx,%rax,8),%eax
mov    %edi,%edx
and    $0x2,%edx
or     %eax,%edx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
or     %edx,%eax
mov    %edi,%edx
shr    $0x3,%edx
and    $0x1,%edx
lea    (%rdx,%rax,2),%eax
sar    $0x4,%edi
add    $0xfffffffc,%ecx
jne    1110 <prog_rbit+0x10>
ret

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

LLVM IR (-O2):
define i32 @prog_rbit(i32 %0) {
br label %3
2: ; preds = %3
ret i32 %19
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %21, %3 ]
%5 = phi i32 [ 0, %1 ], [ %19, %3 ]
%6 = phi i32 [ %0, %1 ], [ %20, %3 ]
%7 = shl i32 %5, 3
%8 = shl i32 %6, 2
%9 = and i32 %8, 4
%10 = or i32 %7, %9
%11 = and i32 %6, 2
%12 = or i32 %10, %11
%13 = lshr i32 %6, 2
%14 = and i32 %13, 1
%15 = or i32 %12, %14
%16 = lshr i32 %6, 3
%17 = shl i32 %15, 1
%18 = and i32 %16, 1
%19 = or i32 %17, %18
%20 = ashr i32 %6, 4
%21 = add nuw nsw i32 %4, 4
%22 = icmp eq i32 %21, 32
br i1 %22, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ ReportChar(int, char const);
int /*<<< orphan*/ ReportString(int, char *, unsigned int);
__attribute__((visibility("hidden"))) void ReportCharCtrl(int level,
                                                          const char c) {
  if ((c >= ' ') && (c <= '~')) {
    ReportChar(level, c);
  } else {
    ReportString(level, "<%02x>", (unsigned)c);
  }
}


x86 assembly (clang, -O0):
<ReportCharCtrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jl     115c <ReportCharCtrl+0x3c>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jg     115c <ReportCharCtrl+0x3c>
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1030 <ReportChar@plt>
jmp    116f <ReportCharCtrl+0x4f>
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%edx
lea    0xe96(%rip),%rsi
call   1040 <ReportString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReportCharCtrl>:
lea    -0x20(%rsi),%eax
cmp    $0x5e,%al
ja     1130 <ReportCharCtrl+0x10>
movsbl %sil,%esi
jmp    1030 <ReportChar@plt>
movsbl %sil,%edx
lea    0xec5(%rip),%rsi
jmp    1040 <ReportString@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"<%02x>\00"
define hidden void @ReportCharCtrl(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 32
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 126
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32, i32* %3
%14 = load i8, i8* %4
%15 = call i32 @ReportChar(i32 %13, i8 signext %14)
br label %21
16: ; preds = %8, %2
%17 = load i32, i32* %3
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = call i32 @ReportString(i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"<%02x>\00"
define hidden void @ReportCharCtrl(i32 %0, i8 signext %1) {
%3 = add i8 %1, -32
%4 = icmp ult i8 %3, 95
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @ReportChar(i32 %0, i8 signext %1)
br label %10
7: ; preds = %2
%8 = sext i8 %1 to i32
%9 = tail call i32 @ReportString(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_spin_puts(char *);
void mbr_bootmain(void) {
  uart_spin_puts("Hello, AIMv6!\r\nCome on!\r\n");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<mbr_bootmain>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <uart_spin_puts@plt>
jmp    1120 <mbr_bootmain+0x10>

x86 assembly (clang, -O2):
<mbr_bootmain>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <uart_spin_puts@plt>
nopl   (%rax)
jmp    1120 <mbr_bootmain+0x10>

LLVM IR (-O0):
@.str = [26 x i8] c"Hello, AIMv6!\0D\0ACome on!\0D\0A\00"
define void @mbr_bootmain() {
%1 = call i32 @uart_spin_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [26 x i8] c"Hello, AIMv6!\0D\0ACome on!\0D\0A\00"
define void @mbr_bootmain() {
%1 = tail call i32 @uart_spin_puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
void *malloc(size_t);
void *johtil_alloc(size_t len, size_t element_size) {
  if (!len && !element_size && (~(size_t)0) / element_size < len) {
    return 0;
  }
  return malloc(len * element_size);
}


x86 assembly (clang, -O0):
<johtil_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <johtil_alloc+0x4c>
cmpq   $0x0,-0x18(%rbp)
jne    115c <johtil_alloc+0x4c>
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    -0x10(%rbp),%rax
jae    115c <johtil_alloc+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    116e <johtil_alloc+0x5e>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<johtil_alloc>:
imul   %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @johtil_alloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %2
%9 = load i64, i64* %5
%10 = icmp ne i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %8
%12 = load i64, i64* %5
%13 = udiv i64 -1, %12
%14 = load i64, i64* %4
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %11
store i8* null, i8** %3
br label %22
17: ; preds = %11, %8, %2
%18 = load i64, i64* %4
%19 = load i64, i64* %5
%20 = mul i64 %18, %19
%21 = call i8* @malloc(i64 %20)
store i8* %21, i8** %3
br label %22
22: ; preds = %17, %16
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @johtil_alloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printInt(int i) { printf("%d", i); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printInt(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn1();
int /*<<< orphan*/ fn2();
scalar_t__ foo(int *, int);
void bar(int *x) {
  if (foo(x, 23))
    fn1();
  else
    fn2();
  foo(x, 2);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x17,%esi
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1160 <bar+0x30>
mov    $0x0,%al
call   1030 <fn1@plt>
jmp    1167 <bar+0x37>
mov    $0x0,%al
call   1050 <fn2@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rdi,%rbx
mov    $0x17,%esi
call   1040 <foo@plt>
test   %rax,%rax
je     114c <bar+0x1c>
xor    %eax,%eax
call   1030 <fn1@plt>
jmp    1153 <bar+0x23>
xor    %eax,%eax
call   1050 <fn2@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1040 <foo@plt>

LLVM IR (-O0):
define void @bar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @foo(i32* %3, i32 23)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @fn1()
br label %10
8: ; preds = %1
%9 = call i32 (...) @fn2()
br label %10
10: ; preds = %8, %6
%11 = load i32*, i32** %2
%12 = call i64 @foo(i32* %11, i32 2)
ret void
}

LLVM IR (-O2):
define void @bar(i32* %0) {
%2 = tail call i64 @foo(i32* %0, i32 23)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @fn1()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @fn2()
br label %8
8: ; preds = %6, %4
%9 = tail call i64 @foo(i32* %0, i32 2)
ret void
}
/* Variables and functions */
size_t packet_size_2gfsk_tx() { return (0x00 << 8) + 0x7C; }


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

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

LLVM IR (-O0):
define i64 @packet_size_2gfsk_tx() {
ret i64 124
}

LLVM IR (-O2):
define i64 @packet_size_2gfsk_tx() {
ret i64 124
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void int_handler(int signo) { printf("caught %d\n", signo); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"caught %d\0A\00"
define void @int_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
char *esc_str(old, c, limit)
char *old;
int c;
char *limit;
{
  if (((c == '"') || (c == '\\')) && (old < limit))
    *old++ = '\\';
  if (old < limit)
    *old++ = c;
  return (old);
}


x86 assembly (clang, -O0):
<esc_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x22,-0xc(%rbp)
je     1123 <esc_str+0x23>
cmpl   $0x5c,-0xc(%rbp)
jne    1143 <esc_str+0x43>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1143 <esc_str+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x5c,(%rax)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1167 <esc_str+0x67>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<esc_str>:
mov    %rdi,%rax
cmp    $0x5c,%esi
je     110d <esc_str+0xd>
cmp    $0x22,%esi
jne    1119 <esc_str+0x19>
cmp    %rdx,%rax
jae    1119 <esc_str+0x19>
movb   $0x5c,(%rax)
add    $0x1,%rax
cmp    %rdx,%rax
jae    1125 <esc_str+0x25>
mov    %sil,(%rax)
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @esc_str(i8* writeonly %0, i32 %1, i8* readnone %2) {
switch i32 %1, label %8 [
i32 92, label %4
i32 34, label %4
]
4: ; preds = %3, %3
%5 = icmp ult i8* %0, %2
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 92, i8* %0
br label %8
8: ; preds = %3, %6, %4
%9 = phi i8* [ %7, %6 ], [ %0, %4 ], [ %0, %3 ]
%10 = icmp ult i8* %9, %2
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = trunc i32 %1 to i8
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
br label %14
14: ; preds = %11, %8
%15 = phi i8* [ %13, %11 ], [ %9, %8 ]
ret i8* %15
}
int isgraph(int c) {
  if (c == ' ')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jne    111d <isgraph+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <isgraph+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
xor    %eax,%eax
cmp    $0x20,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = icmp ne i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
void EVP_MD_CTX_clear_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_MD_CTX_clear_flags() {
ret void
}
int test_imm_A6int16_mem(short *val) {
  return ((*val) & (0xA6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A6int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 166
%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_A6int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 166
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func0(void) { printf("func0\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"func0\00"
define void @func0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _sysapi_ifflags(char *, int);
int sysapi_is_dev_broadcast(char *ifname) { return _sysapi_ifflags(ifname, 2); }


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

x86 assembly (clang, -O2):
<sysapi_is_dev_broadcast>:
mov    $0x2,%esi
jmp    1030 <_sysapi_ifflags@plt>

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

LLVM IR (-O2):
define i32 @sysapi_is_dev_broadcast(i8* %0) {
%2 = tail call i32 @_sysapi_ifflags(i8* %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Quick(int);
int main() {
  int i;
  for (i = 0; i < 100; i++)
    Quick(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <Quick@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <Quick@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @Quick(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @Quick(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CL_ClearPing(int);
void LAN_ClearPing(int n) { CL_ClearPing(n); }


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

x86 assembly (clang, -O2):
<LAN_ClearPing>:
jmp    1030 <CL_ClearPing@plt>

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

LLVM IR (-O2):
define void @LAN_ClearPing(i32 %0) {
%2 = tail call i32 @CL_ClearPing(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
void OscStb(void) {
  RamWrite32A(0xC000, 0x00D00074);
  RamWrite32A(0xD000, 0x00000002);
}


x86 assembly (clang, -O0):
<OscStb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc000,%edi
mov    $0xd00074,%esi
call   1030 <RamWrite32A@plt>
mov    $0xd000,%edi
mov    $0x2,%esi
call   1030 <RamWrite32A@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OscStb>:
push   %rax
mov    $0xc000,%edi
mov    $0xd00074,%esi
call   1030 <RamWrite32A@plt>
mov    $0xd000,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <RamWrite32A@plt>

LLVM IR (-O0):
define void @OscStb() {
%1 = call i32 @RamWrite32A(i32 49152, i32 13631604)
%2 = call i32 @RamWrite32A(i32 53248, i32 2)
ret void
}

LLVM IR (-O2):
define void @OscStb() {
%1 = tail call i32 @RamWrite32A(i32 49152, i32 13631604)
%2 = tail call i32 @RamWrite32A(i32 53248, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  if (-1L > 1UL)
    printf("paul is crazy");
  else
    printf("mannu is Crazy");
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"paul is crazy\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"paul is crazy\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int close(int);
int close_tcp_server_connection(int connFd) { return close(connFd); }


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

x86 assembly (clang, -O2):
<close_tcp_server_connection>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @close_tcp_server_connection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
unsigned char c2i(char c) { return (c >= 'a') ? (c - 'a' + 10) : (c - '0'); }


x86 assembly (clang, -O0):
<c2i>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <c2i+0x29>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <c2i+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2i>:
cmp    $0x61,%dil
mov    $0xa9,%ecx
mov    $0xd0,%eax
cmovge %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @c2i(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 97
%10 = add nsw i32 %9, 10
br label %15
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
br label %15
15: ; preds = %11, %6
%16 = phi i32 [ %10, %6 ], [ %14, %11 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @c2i(i8 signext %0) {
%2 = icmp sgt i8 %0, 96
%3 = select i1 %2, i8 -87, i8 -48
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int random_number(int /*<<< orphan*/, int);
int main() {
  printf("random: %d\n", random_number(0, 10));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"random: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @random_number(i32 0, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int register_flag_mode_katcp(struct katcp_dispatch *, char *, char *,
                             int (*)(struct katcp_dispatch *, int),
                             int /*<<< orphan*/, int /*<<< orphan*/);
int register_katcp(struct katcp_dispatch *d, char *match, char *help,
                   int (*call)(struct katcp_dispatch *d, int argc)) {
  return register_flag_mode_katcp(d, match, help, call, 0, 0);
}


x86 assembly (clang, -O0):
<register_katcp>:
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    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <register_flag_mode_katcp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_katcp>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <register_flag_mode_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i32 @register_katcp(%struct.katcp_dispatch* %0, i8* %1, i8* %2, i32 (%struct.katcp_dispatch*, i32)* %3) {
%5 = alloca %struct.katcp_dispatch*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32 (%struct.katcp_dispatch*, i32)*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 (%struct.katcp_dispatch*, i32)* %3, i32 (%struct.katcp_dispatch*, i32)** %8
%9 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32 (%struct.katcp_dispatch*, i32)*, i32 (%struct.katcp_dispatch*, i32)** %8
%13 = call i32 @register_flag_mode_katcp(%struct.katcp_dispatch* %9, i8* %10, i8* %11, i32 (%struct.katcp_dispatch*, i32)* %12, i32 0, i32 0)
ret i32 %13
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i32 @register_katcp(%struct.katcp_dispatch* %0, i8* %1, i8* %2, i32 (%struct.katcp_dispatch*, i32)* %3) {
%5 = tail call i32 @register_flag_mode_katcp(%struct.katcp_dispatch* %0, i8* %1, i8* %2, i32 (%struct.katcp_dispatch*, i32)* %3, i32 0, i32 0)
ret i32 %5
}
/* Variables and functions */
int bbm_byte_write(void *, unsigned short, unsigned short, unsigned char);
int bbm_com_byte_write(void *handle, unsigned short devid, unsigned short addr,
                       unsigned char data) {
  int res;
  res = bbm_byte_write(handle, devid, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_byte_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dx,%cx
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %cx,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%cx
mov    -0xc(%rbp),%ax
movzwl %cx,%esi
movzwl %ax,%edx
movzbl -0xd(%rbp),%ecx
call   1030 <bbm_byte_write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_byte_write>:
jmp    1030 <bbm_byte_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_byte_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i8
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i8 %3, i8* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i16, i16* %7
%13 = load i8, i8* %8
%14 = call i32 @bbm_byte_write(i8* %10, i16 zeroext %11, i16 zeroext %12, i8 zeroext %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_byte_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i8 zeroext %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntDisable(int /*<<< orphan*/);
int /*<<< orphan*/ IntUnregister(int /*<<< orphan*/);
int /*<<< orphan*/ _PWMFaultIntNumberGet(int /*<<< orphan*/);
void PWMFaultIntUnregister(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = _PWMFaultIntNumberGet(ui32Base);
  ;
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<PWMFaultIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_PWMFaultIntNumberGet@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntUnregister>:
push   %rbx
call   1040 <_PWMFaultIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <IntDisable@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @PWMFaultIntUnregister(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_PWMFaultIntNumberGet(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @IntDisable(i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @IntUnregister(i32 %8)
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntUnregister(i32 %0) {
%2 = tail call i32 @_PWMFaultIntNumberGet(i32 %0)
%3 = tail call i32 @IntDisable(i32 %2)
%4 = tail call i32 @IntUnregister(i32 %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xkeymap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xkeymap_type(void *_p) {
  return (int)((XEvent *)_p)->xkeymap.type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xkeymap_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xkeymap_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init_random() {
  time_t now;
  time(&now);
  srand(now);
}


x86 assembly (clang, -O0):
<init_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
mov    -0x4(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_random>:
push   %rax
lea    0x4(%rsp),%rdi
call   1040 <time@plt>
mov    0x4(%rsp),%edi
call   1030 <srand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @init_random() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = load i32, i32* %1
%4 = call i32 @srand(i32 %3)
ret void
}

LLVM IR (-O2):
define void @init_random() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @srand(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _BufferWrite(unsigned char, int /*<<< orphan*/);
void LCD_X_Write00(unsigned char Cmd) { _BufferWrite(Cmd, 0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %esi,%esi
movzbl -0x1(%rbp),%edi
call   1030 <_BufferWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
xor    %esi,%esi
jmp    1030 <_BufferWrite@plt>

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

LLVM IR (-O2):
define void @LCD_X_Write00(i8 zeroext %0) {
%2 = tail call i32 @_BufferWrite(i8 zeroext %0, i32 0)
ret void
}
void RELEASE_REG(int host_reg) {}


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

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

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

LLVM IR (-O2):
define void @RELEASE_REG(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int const);
void rws_thread_sleep(const unsigned int millisec) { usleep(millisec * 1000); }


x86 assembly (clang, -O0):
<rws_thread_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rws_thread_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @rws_thread_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @rws_thread_sleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}