xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ put_long(long);
void put_hack(void) {
  long i, hack[8 + 2] = {1009,       8,          0x00245645, 0x523a2055,
                         0x6e537475, 0x66662076, 0x322e3020, 0x28313939,
                         0x302c3139, 0x39322900};
  for (i = 0; i < 8 + 2; i++)
    put_long(hack[i]);
}


x86 assembly (clang, -O0):
<put_hack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x60(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x50,%edx
call   1030 <memcpy@plt>
movq   $0x0,-0x8(%rbp)
cmpq   $0xa,-0x8(%rbp)
jge    116f <put_hack+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
call   1040 <put_long@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1145 <put_hack+0x25>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_hack>:
push   %rax
mov    $0x3f1,%edi
call   1030 <put_long@plt>
mov    $0x8,%edi
call   1030 <put_long@plt>
mov    $0x245645,%edi
call   1030 <put_long@plt>
mov    $0x523a2055,%edi
call   1030 <put_long@plt>
mov    $0x6e537475,%edi
call   1030 <put_long@plt>
mov    $0x66662076,%edi
call   1030 <put_long@plt>
mov    $0x322e3020,%edi
call   1030 <put_long@plt>
mov    $0x28313939,%edi
call   1030 <put_long@plt>
mov    $0x302c3139,%edi
call   1030 <put_long@plt>
mov    $0x39322900,%edi
pop    %rax
jmp    1030 <put_long@plt>

LLVM IR (-O0):
@__const.put_hack.hack = [10 x i64] [i64 1009, i64 8, i64 2381381, i64 1379541077, i64 1850963061, i64 1717969014, i64 841887776, i64 674314553, i64 808202553, i64 959588608]
define void @put_hack() {
%1 = alloca i64
%2 = alloca [10 x i64]
%3 = bitcast [10 x i64]* %2 to i8*
store i64 0, i64* %1
br label %4
4: ; preds = %12, %0
%5 = load i64, i64* %1
%6 = icmp slt i64 %5, 10
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %1
%9 = getelementptr inbounds [10 x i64], [10 x i64]* %2, i64 0, i64 %8
%10 = load i64, i64* %9
%11 = call i32 @put_long(i64 %10)
br label %12
12: ; preds = %7
%13 = load i64, i64* %1
%14 = add nsw i64 %13, 1
store i64 %14, i64* %1
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @put_hack() {
%1 = tail call i32 @put_long(i64 1009)
%2 = tail call i32 @put_long(i64 8)
%3 = tail call i32 @put_long(i64 2381381)
%4 = tail call i32 @put_long(i64 1379541077)
%5 = tail call i32 @put_long(i64 1850963061)
%6 = tail call i32 @put_long(i64 1717969014)
%7 = tail call i32 @put_long(i64 841887776)
%8 = tail call i32 @put_long(i64 674314553)
%9 = tail call i32 @put_long(i64 808202553)
%10 = tail call i32 @put_long(i64 959588608)
ret void
}
/* Type definitions */
struct process_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ process_sigreturn(struct process_context *);
void syscall_sigreturn(struct process_context *context) {
  process_sigreturn(context);
}


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

x86 assembly (clang, -O2):
<syscall_sigreturn>:
jmp    1030 <process_sigreturn@plt>

LLVM IR (-O0):
%struct.process_context = type { i32 }
define void @syscall_sigreturn(%struct.process_context* %0) {
%2 = alloca %struct.process_context*
store %struct.process_context* %0, %struct.process_context** %2
%3 = load %struct.process_context*, %struct.process_context** %2
%4 = call i32 @process_sigreturn(%struct.process_context* %3)
ret void
}

LLVM IR (-O2):
%struct.process_context = type { i32 }
define void @syscall_sigreturn(%struct.process_context* %0) {
%2 = tail call i32 @process_sigreturn(%struct.process_context* %0)
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
long msGettick(void) {
  struct timezone tmzone;
  struct timeval tmval;
  long ms;
  gettimeofday(&tmval, &tmzone);
  ms = (tmval.tv_sec & 0xFFFF) * 1000 + tmval.tv_usec / 1000;
  return ms;
}


x86 assembly (clang, -O0):
<msGettick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msGettick>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
movzwl 0x8(%rsp),%eax
imul   $0x3e8,%rax,%rcx
movslq 0xc(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timezone = type { i32 }
%struct.timeval = type { i32, i32 }
define i64 @msGettick() {
%1 = alloca %struct.timezone
%2 = alloca %struct.timeval
%3 = alloca i64
%4 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %1)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = and i32 %6, 65535
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = add nsw i32 %8, %11
%13 = sext i32 %12 to i64
store i64 %13, i64* %3
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
%struct.timezone = type { i32 }
%struct.timeval = type { i32, i32 }
define i64 @msGettick() {
%1 = alloca %struct.timezone
%2 = alloca %struct.timeval
%3 = bitcast %struct.timezone* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %2, %struct.timezone* %1)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 65535
%9 = mul nuw nsw i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = add nsw i32 %9, %12
%14 = sext i32 %13 to i64
ret i64 %14
}
int f(int a, int b) { return -(a == b); }


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

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @f(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = sub nsw i32 0, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int close(int /*<<< orphan*/);
int /*<<< orphan*/ fdclosedir(int /*<<< orphan*/ *);
int closedir(DIR *dirp) { return close(fdclosedir(dirp)); }


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

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

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

LLVM IR (-O2):
define i32 @closedir(i32* %0) {
%2 = tail call i32 @fdclosedir(i32* %0)
%3 = tail call i32 @close(i32 %2)
ret i32 %3
}
void writel(unsigned long v, unsigned long addr) {
  volatile unsigned long *p = (volatile unsigned long *)addr;
  *p = v;
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
define void @writel(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = inttoptr i64 %6 to i64*
store i64* %7, i64** %5
%8 = load i64, i64* %3
%9 = load i64*, i64** %5
store volatile i64 %8, i64* %9
ret void
}

LLVM IR (-O2):
define void @writel(i64 %0, i64 %1) {
%3 = inttoptr i64 %1 to i64*
store volatile i64 %0, i64* %3
ret void
}
int fill_till_slash(const unsigned char *data, char *target) {
  int i = 0;
  char c;
  while ((c = data[i]) != '/') {
    target[i++] = c;
  }
  target[i] = '\0';
  return i + 1;
}


x86 assembly (clang, -O0):
<fill_till_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl %al,%eax
cmp    $0x2f,%eax
je     114a <fill_till_slash+0x4a>
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1113 <fill_till_slash+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_till_slash>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x2f,%cl
je     1121 <fill_till_slash+0x21>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rsi,%rax,1)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
cmp    $0x2f,%cl
jne    1110 <fill_till_slash+0x10>
mov    %eax,%ecx
movb   $0x0,(%rsi,%rcx,1)
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @fill_till_slash(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 47
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 47
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %8 to i32
br label %15
15: ; preds = %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ]
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %1, i64 %17
store i8 0, i8* %18
%19 = add nuw nsw i32 %16, 1
ret i32 %19
}
double __muldf3(double a1, double a2) { return ((float)a1 * (float)a2); }


x86 assembly (clang, -O0):
<__muldf3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__muldf3>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__muldf3(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptrunc double %5 to float
%7 = load double, double* %4
%8 = fptrunc double %7 to float
%9 = fmul float %6, %8
%10 = fpext float %9 to double
ret double %10
}

LLVM IR (-O2):
define double @__muldf3(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fmul float %3, %4
%6 = fpext float %5 to double
ret double %6
}
int test_imm_2Bint64_lowword_mem(long long *val) {
  return ((*val) & (0x2B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Bint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 43
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SendRequest(char *);
int /*<<< orphan*/ scanf(char *, char *);
int ClientMain() {
  char buf[20];
  while (1) {
    scanf("%s", buf);
    SendRequest(buf);
  }
}


x86 assembly (clang, -O0):
<ClientMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <SendRequest@plt>
jmp    1128 <ClientMain+0x8>

x86 assembly (clang, -O2):
<ClientMain>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <SendRequest@plt>
jmp    1140 <ClientMain+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @ClientMain() {
%1 = alloca [20 x i8]
br label %2
2: ; preds = %0, %2
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i32 @SendRequest(i8* %5)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @ClientMain() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @SendRequest(i8* %2)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ Keccak(int, int, unsigned char const *, unsigned int, int,
                          unsigned char *, int);
void FIPS202_SHA3_256(const unsigned char *input, unsigned int inputByteLen,
                      unsigned char *output) {
  Keccak(1088, 512, input, inputByteLen, 0x06, output, 32);
}


x86 assembly (clang, -O0):
<FIPS202_SHA3_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r9
mov    $0x440,%edi
mov    $0x200,%esi
mov    $0x6,%r8d
movl   $0x20,(%rsp)
call   1030 <Keccak@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIPS202_SHA3_256>:
push   %rax
mov    %rdx,%r9
mov    %esi,%ecx
mov    %rdi,%rdx
movl   $0x20,(%rsp)
mov    $0x440,%edi
mov    $0x200,%esi
mov    $0x6,%r8d
call   1030 <Keccak@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @FIPS202_SHA3_256(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 i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @Keccak(i32 1088, i32 512, i8* %7, i32 %8, i32 6, i8* %9, i32 32)
ret void
}

LLVM IR (-O2):
define void @FIPS202_SHA3_256(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @Keccak(i32 1088, i32 512, i8* %0, i32 %1, i32 6, i8* %2, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sys_ConsoleInputInit();
void CON_SigCont(int signum) { Sys_ConsoleInputInit(); }


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

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

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

LLVM IR (-O2):
define void @CON_SigCont(i32 %0) {
%2 = tail call i32 (...) @Sys_ConsoleInputInit()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello, world\n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int isBinary(char input) {
  if (input == '1')
    return 1;
  if (input == '0')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isBinary>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    1123 <isBinary+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1143 <isBinary+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    113c <isBinary+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <isBinary+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBinary>:
and    $0xfe,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isBinary(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 49
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 48
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @isBinary(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
void f(char x[32688], double *y, double *z) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i8* nocapture %0, double* nocapture %1, double* nocapture %2) {
ret void
}
int conc_dev_is_dup(struct ipr_dev *dev, struct ipr_dev **devs, int num_devs) {
  int i;
  for (i = 0; i < num_devs; i++)
    if (dev == devs[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<conc_dev_is_dup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1157 <conc_dev_is_dup+0x57>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,8),%rax
jne    1144 <conc_dev_is_dup+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115e <conc_dev_is_dup+0x5e>
jmp    1149 <conc_dev_is_dup+0x49>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <conc_dev_is_dup+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conc_dev_is_dup>:
test   %edx,%edx
jle    111f <conc_dev_is_dup+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %rdi,(%rsi,%rcx,8)
je     1122 <conc_dev_is_dup+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <conc_dev_is_dup+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
%struct.ipr_dev = type opaque
define i32 @conc_dev_is_dup(%struct.ipr_dev* readnone %0, %struct.ipr_dev** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds %struct.ipr_dev*, %struct.ipr_dev** %1, i64 %10
%12 = load %struct.ipr_dev*, %struct.ipr_dev** %11
%13 = icmp eq %struct.ipr_dev* %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
int test_imm_38int16_reg(short val) {
  return ((val) & (-0x38 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_38int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffc8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_38int16_reg>:
test   $0xffc8,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_38int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -56
%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_38int16_reg(i16 signext %0) {
%2 = and i16 %0, -56
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int PAPI_read_ts(int, long long *, long long *);
void papif_read_ts__(int *EventSet, long long *values, long long *cycles,
                     int *check) {
  *check = PAPI_read_ts(*EventSet, values, cycles);
}


x86 assembly (clang, -O0):
<papif_read_ts__>:
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),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <PAPI_read_ts@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_read_ts__>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_read_ts@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_read_ts__(i32* %0, i64* %1, i64* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64*
%7 = alloca i64*
%8 = alloca i32*
store i32* %0, i32** %5
store i64* %1, i64** %6
store i64* %2, i64** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i64*, i64** %6
%12 = load i64*, i64** %7
%13 = call i32 @PAPI_read_ts(i32 %10, i64* %11, i64* %12)
%14 = load i32*, i32** %8
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @papif_read_ts__(i32* nocapture %0, i64* %1, i64* %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @PAPI_read_ts(i32 %5, i64* %1, i64* %2)
store i32 %6, i32* %3
ret void
}
/* Variables and functions */
int negate(int);
int subtract(int n, int s) { return n + negate(s); }


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

x86 assembly (clang, -O2):
<subtract>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <negate@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1) {
%3 = tail call i32 @negate(i32 %1)
%4 = add nsw i32 %3, %0
ret i32 %4
}
void event_init(void) {}


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

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

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

LLVM IR (-O2):
define void @event_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __NR_ioctl;
scalar_t__ errno;
int syscall(int /*<<< orphan*/, int, unsigned long, unsigned long);
int ioctl64(int fd, unsigned long nr, unsigned long arg) {
  errno = 0;
  return syscall(__NR_ioctl, fd, nr, arg);
}


x86 assembly (clang, -O0):
<ioctl64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eae(%rip),%rax
movq   $0x0,(%rax)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl64>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2eb9(%rip),%rax
movq   $0x0,(%rax)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@errno = global i64 0
@__NR_ioctl = global i32 0
define i32 @ioctl64(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
store i64 0, i64* @errno
%7 = load i32, i32* @__NR_ioctl
%8 = load i32, i32* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i64 %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
@errno = global i64 0
@__NR_ioctl = global i32 0
define i32 @ioctl64(i32 %0, i64 %1, i64 %2) {
store i64 0, i64* @errno
%4 = load i32, i32* @__NR_ioctl
%5 = tail call i32 @syscall(i32 %4, i32 %0, i64 %1, i64 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int arr[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%d ", arr[i]);
  printf("\n");
}


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
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %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 i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int adjust_interval_with_param_constraint_max(struct pmm_interval *i,
                                              struct pmm_paramdef_set *pd_set) {
  (void)i;
  (void)pd_set;
  printf("muParser not enabled at configure.\n");
  return -1;
}


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

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

LLVM IR (-O0):
%struct.pmm_interval = type { i32 }
%struct.pmm_paramdef_set = type { i32 }
@.str = [36 x i8] c"muParser not enabled at configure.\0A\00"
define i32 @adjust_interval_with_param_constraint_max(%struct.pmm_interval* %0, %struct.pmm_paramdef_set* %1) {
%3 = alloca %struct.pmm_interval*
%4 = alloca %struct.pmm_paramdef_set*
store %struct.pmm_interval* %0, %struct.pmm_interval** %3
store %struct.pmm_paramdef_set* %1, %struct.pmm_paramdef_set** %4
%5 = load %struct.pmm_interval*, %struct.pmm_interval** %3
%6 = load %struct.pmm_paramdef_set*, %struct.pmm_paramdef_set** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
%struct.pmm_interval = type { i32 }
%struct.pmm_paramdef_set = type { i32 }
@str = [35 x i8] c"muParser not enabled at configure.\00"
define i32 @adjust_interval_with_param_constraint_max(%struct.pmm_interval* nocapture readnone %0, %struct.pmm_paramdef_set* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ sigdelthpool();
void sigdie(int sig) {
  sigdelthpool();
  exit(sig);
}


x86 assembly (clang, -O0):
<sigdie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <sigdelthpool@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigdie>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <sigdelthpool@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigdie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @sigdelthpool()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @sigdie(i32 %0) {
%2 = tail call i32 (...) @sigdelthpool()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
struct vec2i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec2i_one(int /*<<< orphan*/ *);
__attribute__((always_)) struct vec2i *psvec2i_one(struct vec2i *result) {
  vec2i_one((int32_t *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2i_one>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2i_one@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_one(%struct.vec2i* %0) {
%2 = alloca %struct.vec2i*
store %struct.vec2i* %0, %struct.vec2i** %2
%3 = load %struct.vec2i*, %struct.vec2i** %2
%4 = bitcast %struct.vec2i* %3 to i32*
%5 = call i32 @vec2i_one(i32* %4)
%6 = load %struct.vec2i*, %struct.vec2i** %2
ret %struct.vec2i* %6
}

LLVM IR (-O2):
%struct.vec2i = type { i32 }
define %struct.vec2i* @psvec2i_one(%struct.vec2i* returned %0) {
%2 = getelementptr %struct.vec2i, %struct.vec2i* %0, i64 0, i32 0
%3 = tail call i32 @vec2i_one(i32* %2)
ret %struct.vec2i* %0
}
/* Variables and functions */
int /*<<< orphan*/ heap_increase(int *, int, int);
void insert(int array[], int heap_size, int key) {
  heap_size++;
  array[heap_size] = -65535;
  heap_increase(array, heap_size, key);
}


x86 assembly (clang, -O0):
<insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffff0001,(%rax,%rcx,4)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <heap_increase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert>:
movslq %esi,%rax
add    $0x1,%esi
movl   $0xffff0001,0x4(%rdi,%rax,4)
ff
jmp    1030 <heap_increase@plt>

LLVM IR (-O0):
define void @insert(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* %5
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 -65535, i32* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @heap_increase(i32* %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @insert(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 -65535, i32* %6
%7 = tail call i32 @heap_increase(i32* %0, i32 %4, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t ssd1306_read_data(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ssd1306_read_data() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
int checki(int r, const char *w) {
  if (r < 0)
    err(1, "%s", w);
  return r;
}


x86 assembly (clang, -O0):
<checki>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113e <checki+0x2e>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xec7(%rip),%rsi
call   1030 <err@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checki>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jns    112b <checki+0x1b>
mov    %rsi,%rdx
lea    0xedf(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @checki(i32 returned %0, i8* %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %6
6: ; preds = %4, %2
ret i32 %0
}
int oneOperand(int op) {
  switch (op) {
  case 0x0404:
    return 1;
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<oneOperand>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x404,%eax
jne    1126 <oneOperand+0x26>
jmp    111a <oneOperand+0x1a>
movl   $0x1,-0x4(%rbp)
jmp    112d <oneOperand+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @oneOperand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1028, label %5
]
5: ; preds = %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @oneOperand(i32 %0) {
%2 = icmp eq i32 %0, 1028
%3 = zext i1 %2 to i32
ret i32 %3
}
long double __complex__ fun_qcomplex(long double __complex__ a,
                                     long double __complex__ b) {
  return a;
}


x86 assembly (clang, -O0):
<fun_qcomplex>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_qcomplex>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @fun_qcomplex({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0, { x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = alloca { x86_fp80, x86_fp80 }
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%5 = load x86_fp80, x86_fp80* %4
%6 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3, i32 0, i32 1
store x86_fp80 %5, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %3
ret { x86_fp80, x86_fp80 } %10
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @fun_qcomplex({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0, { x86_fp80, x86_fp80 }* nocapture readnone byval({ x86_fp80, x86_fp80 }) align 16 %1) {
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %4, 0
%8 = insertvalue { x86_fp80, x86_fp80 } %7, x86_fp80 %6, 1
ret { x86_fp80, x86_fp80 } %8
}
int fcmplt(float a, float b) { return a < b; }


x86 assembly (clang, -O0):
<fcmplt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmplt>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @fcmplt(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fcmplt(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_output(int /*<<< orphan*/, int, int);
void status_on(void) { gpio_output(0, 15, 1); }


x86 assembly (clang, -O0):
<status_on>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xf,%esi
mov    $0x1,%edx
call   1030 <gpio_output@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<status_on>:
xor    %edi,%edi
mov    $0xf,%esi
mov    $0x1,%edx
jmp    1030 <gpio_output@plt>

LLVM IR (-O0):
define void @status_on() {
%1 = call i32 @gpio_output(i32 0, i32 15, i32 1)
ret void
}

LLVM IR (-O2):
define void @status_on() {
%1 = tail call i32 @gpio_output(i32 0, i32 15, i32 1)
ret void
}
void fldcw_default(void) {
  asm(" pushw $0x037F ; fldcw (%esp) ; addl $2, %esp");
}


x86 assembly (clang, -O0):
<fldcw_default>:
push   %rbp
mov    %rsp,%rbp
pushw  $0x37f
fldcw  (%esp)
add    $0x2,%esp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fldcw_default>:
pushw  $0x37f
fldcw  (%esp)
add    $0x2,%esp
ret

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

LLVM IR (-O2):
define void @fldcw_default() {
tail call void asm sideeffect " pushw $$0x037F ; fldcw (%esp) ; addl $$2, %esp", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int do_164() { return 164; }


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

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

LLVM IR (-O0):
define i32 @do_164() {
ret i32 164
}

LLVM IR (-O2):
define i32 @do_164() {
ret i32 164
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
int /*<<< orphan*/ addword(int /*<<< orphan*/);
void ADD_HOST_REG_IMM_W(int host_reg, uint16_t imm) {
  addbyte(0x66);
  if (host_reg & 8)
    addbyte(0x41);
  addbyte(0x81);
  addbyte(0xC0 | (host_reg & 7));
  addword(imm);
}


x86 assembly (clang, -O0):
<ADD_HOST_REG_IMM_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1040 <addbyte@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1151 <ADD_HOST_REG_IMM_W+0x31>
mov    $0x41,%edi
call   1040 <addbyte@plt>
mov    $0x81,%edi
call   1040 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc0,%edi
call   1040 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADD_HOST_REG_IMM_W>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1040 <addbyte@plt>
test   $0x8,%bpl
je     1141 <ADD_HOST_REG_IMM_W+0x21>
mov    $0x41,%edi
call   1040 <addbyte@plt>
mov    $0x81,%edi
call   1040 <addbyte@plt>
and    $0x7,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
call   1040 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addword@plt>

LLVM IR (-O0):
define void @ADD_HOST_REG_IMM_W(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = load i32, i32* %3
%7 = and i32 %6, 8
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @addbyte(i32 65)
br label %11
11: ; preds = %9, %2
%12 = call i32 @addbyte(i32 129)
%13 = load i32, i32* %3
%14 = and i32 %13, 7
%15 = or i32 192, %14
%16 = call i32 @addbyte(i32 %15)
%17 = load i32, i32* %4
%18 = call i32 @addword(i32 %17)
ret void
}

LLVM IR (-O2):
define void @ADD_HOST_REG_IMM_W(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = and i32 %0, 8
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @addbyte(i32 65)
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @addbyte(i32 129)
%10 = and i32 %0, 7
%11 = or i32 %10, 192
%12 = tail call i32 @addbyte(i32 %11)
%13 = tail call i32 @addword(i32 %1)
ret void
}
/* Variables and functions */
float atan2f(float, float);
float num_atan2(float a, float b) { return atan2f(a, b); }


x86 assembly (clang, -O0):
<num_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_atan2>:
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @num_atan2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @num_atan2(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
void INT_Excep_SCI1_RXI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI1_RXI1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
long error(const char *message) {
  printf("Error: %s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define i64 @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define i64 @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}