xunge/DecIR huggingface dataset:
regx0indreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
ja     113b <regx0indreg1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <regx0indreg1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0indreg1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @regx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = icmp ule i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void doPrompt(void) { puts("[ArcCore] $ "); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"[ArcCore] $ \00"
define void @doPrompt() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"[ArcCore] $ \00"
define void @doPrompt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ error(char *);
int read(int, char *, int);
void Read(int sock, char buffer[]) {
  bzero(buffer, 1024);
  int n = read(sock, buffer, 1024);
  if (n < 0)
    error("ERROR reading - Conexion con el cliente perdida");
}


x86 assembly (clang, -O0):
<Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x400,%esi
call   1050 <bzero@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x400,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1177 <Read+0x47>
lea    0xe8e(%rip),%rdi
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    $0x400,%esi
call   1050 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1030 <read@plt>
test   %eax,%eax
js     115f <Read+0x2f>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe9a(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"ERROR reading - Conexion con el cliente perdida\00"
define void @Read(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @bzero(i8* %6, i32 1024)
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @read(i32 %8, i8* %9, i32 1024)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"ERROR reading - Conexion con el cliente perdida\00"
define void @Read(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @bzero(i8* %1, i32 1024)
%4 = tail call i32 @read(i32 %0, i8* %1, i32 1024)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sesc_simulation_mark();
void sesc_f77_simulation_mark__() { sesc_simulation_mark(); }


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

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

LLVM IR (-O0):
define void @sesc_f77_simulation_mark__() {
%1 = call i32 (...) @sesc_simulation_mark()
ret void
}

LLVM IR (-O2):
define void @sesc_f77_simulation_mark__() {
%1 = tail call i32 (...) @sesc_simulation_mark()
ret void
}
unsigned int scan_ulong(register char *s, register unsigned long *u) {
  register unsigned int pos = 0;
  register unsigned long result = 0;
  register unsigned long c;
  while ((c = (unsigned long)(unsigned char)(s[pos] - '0')) < 10) {
    result = result * 10 + c;
    ++pos;
  }
  *u = result;
  return pos;
}


x86 assembly (clang, -O0):
<scan_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
movzbl %al,%eax
mov    %rax,-0x28(%rbp)
cmp    $0xa,%rax
jae    1155 <scan_ulong+0x55>
imul   $0xa,-0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <scan_ulong+0x1b>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_ulong>:
mov    (%rdi),%dl
add    $0xd0,%dl
cmp    $0x9,%dl
ja     112e <scan_ulong+0x2e>
xor    %eax,%eax
xor    %ecx,%ecx
xchg   %ax,%ax
movzbl %dl,%edx
lea    (%rcx,%rcx,4),%rcx
lea    (%rdx,%rcx,2),%rcx
add    $0x1,%eax
movzbl (%rdi,%rax,1),%edx
add    $0xd0,%dl
cmp    $0xa,%dl
jb     1110 <scan_ulong+0x10>
mov    %rcx,(%rsi)
ret
xor    %ecx,%ecx
xor    %eax,%eax
mov    %rcx,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @scan_ulong(i8* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %19
6: ; preds = %2, %6
%7 = phi i8 [ %17, %6 ], [ %4, %2 ]
%8 = phi i32 [ %13, %6 ], [ 0, %2 ]
%9 = phi i64 [ %12, %6 ], [ 0, %2 ]
%10 = zext i8 %7 to i64
%11 = mul i64 %9, 10
%12 = add i64 %11, %10
%13 = add i32 %8, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = add i8 %16, -48
%18 = icmp ult i8 %17, 10
br i1 %18, label %6, label %19
19: ; preds = %6, %2
%20 = phi i64 [ 0, %2 ], [ %12, %6 ]
%21 = phi i32 [ 0, %2 ], [ %13, %6 ]
store i64 %20, i64* %1
ret i32 %21
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void TimerIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000018))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<TimerIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
not    %rax
mov    -0x8(%rsp),%rcx
and    %rax,0x18(%rcx)
ret

LLVM IR (-O0):
define void @TimerIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 24
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @TimerIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = xor i64 %5, -1
%7 = load volatile i64, i64* %3
%8 = add nsw i64 %7, 24
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}
/* Type definitions */
struct libfat_filesystem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct libfat_filesystem *);
int /*<<< orphan*/ libfat_flush(struct libfat_filesystem *);
void libfat_close(struct libfat_filesystem *fs) {
  libfat_flush(fs);
  free(fs);
}


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

x86 assembly (clang, -O2):
<libfat_close>:
push   %rbx
mov    %rdi,%rbx
call   1040 <libfat_flush@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.libfat_filesystem = type { i32 }
define void @libfat_close(%struct.libfat_filesystem* %0) {
%2 = alloca %struct.libfat_filesystem*
store %struct.libfat_filesystem* %0, %struct.libfat_filesystem** %2
%3 = load %struct.libfat_filesystem*, %struct.libfat_filesystem** %2
%4 = call i32 @libfat_flush(%struct.libfat_filesystem* %3)
%5 = load %struct.libfat_filesystem*, %struct.libfat_filesystem** %2
%6 = call i32 @free(%struct.libfat_filesystem* %5)
ret void
}

LLVM IR (-O2):
%struct.libfat_filesystem = type { i32 }
define void @libfat_close(%struct.libfat_filesystem* %0) {
%2 = tail call i32 @libfat_flush(%struct.libfat_filesystem* %0)
%3 = tail call i32 @free(%struct.libfat_filesystem* %0)
ret void
}
/* Variables and functions */
double trunc(double);
double TH_frac(double x) { return x - trunc(x); }


x86 assembly (clang, -O0):
<TH_frac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <trunc@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TH_frac>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <trunc@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @TH_frac(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.trunc.f64(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @TH_frac(double %0) {
%2 = tail call double @llvm.trunc.f64(double %0)
%3 = fsub double %0, %2
ret double %3
}
int __test_bit(int n, unsigned long *bitmap) {
  return !!(*bitmap & (1UL << n));
}


x86 assembly (clang, -O0):
<__test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_bit>:
mov    (%rsi),%rcx
xor    %eax,%eax
bt     %rdi,%rcx
setb   %al
ret

LLVM IR (-O0):
define i32 @__test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %5
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = and i64 %6, %9
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @__test_bit(i32 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = zext i32 %0 to i64
%5 = shl nuw i64 1, %4
%6 = and i64 %3, %5
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
void shift_array_left(char *queue[], int size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    queue[i] = queue[i + 1];
  }
}


x86 assembly (clang, -O0):
<shift_array_left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <shift_array_left+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <shift_array_left+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_array_left>:
test   %esi,%esi
jle    112b <shift_array_left+0x1b>
push   %rax
lea    0x8(%rdi),%rax
mov    %esi,%edx
shl    $0x3,%rdx
mov    %rax,%rsi
call   1030 <memmove@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @shift_array_left(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = bitcast i8** %0 to i8*
%6 = getelementptr i8*, i8** %0, i64 1
%7 = bitcast i8** %6 to i8*
%8 = zext i32 %1 to i64
%9 = shl nuw nsw i64 %8, 3
br label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 123, j = 5;
  if (i == 5) {
    printf("1\n");
    return 1;
  }
  if (i == 6) {
    printf("2\n");
    return 2;
  }
  printf("3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    114f <main+0x3f>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1184 <main+0x74>
cmpl   $0x6,-0x8(%rbp)
jne    1171 <main+0x61>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1184 <main+0x74>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
@.str.2 = [3 x i8] c"3\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 5
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %15
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 6
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %1
br label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %15
15: ; preds = %13, %11, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [2 x i8] c"3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XSelectionRequestEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XSelectionRequestEvent(void) {
  XSelectionRequestEvent *_p =
      (XSelectionRequestEvent *)malloc(sizeof(XSelectionRequestEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XSelectionRequestEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XSelectionRequestEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XSelectionRequestEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XSelectionRequestEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XSelectionRequestEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XSelectionRequestEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex16array(void *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 16));
}


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

x86 assembly (clang, -O2):
<lookcomplex16array>:
shl    $0x4,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex16array(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 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
%8 = call i32 @lookNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @lookcomplex16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _TimerBaseValid(scalar_t__ volatile);
uint32_t TimerClockSourceGet(uint32_t ui32Base) {
  ASSERT(_TimerBaseValid(ui32Base));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000FC8))));
}


x86 assembly (clang, -O0):
<TimerClockSourceGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xfc8(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerClockSourceGet>:
push   %rax
mov    %rdi,(%rsp)
mov    (%rsp),%rdi
call   1040 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
mov    (%rsp),%rax
mov    0xfc8(%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @TimerClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = call i32 @_TimerBaseValid(i64 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @TimerClockSourceGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = tail call i32 @_TimerBaseValid(i64 %3)
%5 = tail call i32 @ASSERT(i32 %4)
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, 4040
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int t;
  for (t = 0; t < 5; t++) {
    printf("Aayush\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@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
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Aayush\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Aayush\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void neko_init_jit() {}


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

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

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

LLVM IR (-O2):
define void @neko_init_jit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Compilation release date: %d\n", 199401);
  printf("Execution environment release date: can't tell\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Compilation release date: %d\0A\00"
@.str.1 = [48 x i8] c"Execution environment release date: can't tell\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 199401)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Compilation release date: %d\0A\00"
@str = [47 x i8] c"Execution environment release date: can't tell\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 199401)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int xsvfExecute(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xsvfExecute() {
ret i32 0
}
int is_quote_start(int c) { return c == '\''; }


x86 assembly (clang, -O0):
<is_quote_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x27,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_quote_start>:
xor    %eax,%eax
cmp    $0x27,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_quote_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 39
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_quote_start(i32 %0) {
%2 = icmp eq i32 %0, 39
%3 = zext i1 %2 to i32
ret i32 %3
}
int mapToLinear(int gene, int num_genes) {
  if (gene < 0)
    gene += (2 * num_genes + 1);
  return (gene);
}


x86 assembly (clang, -O0):
<mapToLinear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1123 <mapToLinear+0x23>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapToLinear>:
lea    (%rsi,%rsi,1),%ecx
add    $0x1,%ecx
mov    %edi,%eax
sar    $0x1f,%eax
and    %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mapToLinear(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = mul nsw i32 2, %8
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %10
store i32 %12, i32* %3
br label %13
13: ; preds = %7, %2
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @mapToLinear(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = shl nsw i32 %1, 1
%5 = or i32 %4, 1
%6 = select i1 %3, i32 %5, i32 0
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ nomem();
char *strdup(char *);
char *xstrdup(char *p) {
  char *q = strdup(p);
  if (q == NULL)
    nomem();
  return q;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <nomem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xstrdup+0x15>
xor    %eax,%eax
call   1030 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @nomem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ TimerTickPeriodSet(unsigned int);
void SystickPeriodSet(unsigned int milliSec) { TimerTickPeriodSet(milliSec); }


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

x86 assembly (clang, -O2):
<SystickPeriodSet>:
jmp    1030 <TimerTickPeriodSet@plt>

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

LLVM IR (-O2):
define void @SystickPeriodSet(i32 %0) {
%2 = tail call i32 @TimerTickPeriodSet(i32 %0)
ret void
}
int Int_bit_MINUS_xor(int x, int y) { return x ^ y; }


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

x86 assembly (clang, -O2):
<Int_bit_MINUS_xor>:
mov    %edi,%eax
xor    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @Int_bit_MINUS_xor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int Mpc(int nargs, int *args) {
  printf("%c", *args);
  return *args;
}


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

x86 assembly (clang, -O2):
<Mpc>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @Mpc(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}
long int lrl(long double x) { return __builtin_lroundl(x); }


x86 assembly (clang, -O0):
<lrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lroundl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrl>:
jmp    1030 <lroundl@plt>

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

LLVM IR (-O2):
define i64 @lrl(x86_fp80 %0) {
%2 = tail call i64 @lroundl(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ greet(char *);
int main(int argc, char *argv[]) {
  greet("world");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"world\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @greet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @greet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ l;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
int main(int argc, char *argv[]) {
  char l[100];
  snprintf(l, sizeof(l), "testing ... %d %d %d\n", 1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
lea    0xec7(%rip),%rdx
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    $0x3,%r9d
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0xee5(%rip),%rdx
mov    %rsp,%rdi
mov    $0x64,%esi
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    $0x3,%r9d
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"testing ... %d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 100, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
__attribute__((weak)) int _lseek(int file, int offset, int whence) {
  (void)file;
  (void)offset;
  (void)whence;
  return -1;
}


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

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

LLVM IR (-O0):
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @_lseek(i32 %0, i32 %1, i32 %2) {
ret i32 -1
}
int test_imm_50int8_reg(signed char val) {
  return ((val) & (0x50 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_50int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x50,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_50int8_reg>:
test   $0x50,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_50int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 80
%6 = icmp ne i32 %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_50int8_reg(i8 signext %0) {
%2 = and i8 %0, 80
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int h(double ccc, float ddd) {
  int xc = !__builtin_isunordered(ccc, ccc);
  int xd = !__builtin_isunordered(ddd, ddd);
  return xc & xd;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
ucomisd %xmm0,%xmm0
setnp  %al
ucomiss %xmm1,%xmm1
setnp  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @h(double %0, float %1) {
%3 = alloca double
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store float %1, float* %4
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fcmp uno double %7, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %5
%12 = load float, float* %4
%13 = load float, float* %4
%14 = fcmp uno float %12, %13
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = and i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @h(double %0, float %1) {
%3 = fcmp ord double %0, 0.000000e+00
%4 = fcmp ord float %1, 0.000000e+00
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int nonstandard_main(int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nonstandard_main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct evbuffer {
  int dummy;
};

/* Variables and functions */
int evbuffer_write_atmost(struct evbuffer *, int, int);
int evbuffer_write(struct evbuffer *buffer, int fd) {
  return evbuffer_write_atmost(buffer, fd, -1);
}


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

x86 assembly (clang, -O2):
<evbuffer_write>:
mov    $0xffffffff,%edx
jmp    1030 <evbuffer_write_atmost@plt>

LLVM IR (-O0):
%struct.evbuffer = type { i32 }
define i32 @evbuffer_write(%struct.evbuffer* %0, i32 %1) {
%3 = alloca %struct.evbuffer*
%4 = alloca i32
store %struct.evbuffer* %0, %struct.evbuffer** %3
store i32 %1, i32* %4
%5 = load %struct.evbuffer*, %struct.evbuffer** %3
%6 = load i32, i32* %4
%7 = call i32 @evbuffer_write_atmost(%struct.evbuffer* %5, i32 %6, i32 -1)
ret i32 %7
}

LLVM IR (-O2):
%struct.evbuffer = type { i32 }
define i32 @evbuffer_write(%struct.evbuffer* %0, i32 %1) {
%3 = tail call i32 @evbuffer_write_atmost(%struct.evbuffer* %0, i32 %1, i32 -1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printArray(double *t, int size) {
  for (int i = 0; i < size; i++)
    printf("%f,", t[i]);
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f,\00"
define void @printArray(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void t7() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<t7>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <t7+0x9>
jmp    1109 <t7+0x9>

x86 assembly (clang, -O2):
<t7>:
jmp    1100 <t7>

LLVM IR (-O0):
define void @t7() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @t7() {
br label %1
1: ; preds = %0, %1
br label %1
}
void invertl(char *lp) {
  char ch;
  ch = lp[0];
  lp[0] = lp[3];
  lp[3] = ch;
  ch = lp[1];
  lp[1] = lp[2];
  lp[2] = ch;
}


x86 assembly (clang, -O0):
<invertl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<invertl>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @invertl(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8 %12, i8* %14
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
store i8 %17, i8* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i8, i8* %3
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @invertl(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_pd(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_sqrt_pd(int /*<<< orphan*/);
__m128d t1(__m128d a, __m128d b) {
  a = _mm_sqrt_pd(a);
  b = _mm_sqrt_pd(b);
  return _mm_and_pd(a, b);
}


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

x86 assembly (clang, -O2):
<t1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <_mm_sqrt_pd@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <_mm_sqrt_pd@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_mm_and_pd@plt>

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

LLVM IR (-O2):
define i32 @t1(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sqrt_pd(i32 %0)
%4 = tail call i32 @_mm_sqrt_pd(i32 %1)
%5 = tail call i32 @_mm_and_pd(i32 %3, i32 %4)
ret i32 %5
}
int picolHash(const char *key, int modulo) {
  const char *cp;
  unsigned int hash = 0;
  for (cp = key; *cp; cp++) {
    hash = (hash << 1) ^ *cp;
  }
  return (int)(hash % modulo);
}


x86 assembly (clang, -O0):
<picolHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <picolHash+0x4a>
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <picolHash+0x1a>
mov    -0x1c(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <picolHash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %eax,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <picolHash+0x10>
jmp    1126 <picolHash+0x26>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @picolHash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = shl i32 %7, 1
%10 = sext i8 %6 to i32
%11 = xor i32 %9, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}