xunge/DecIR huggingface dataset:
void wx11ie(escape_code, support) int *escape_code, *support;
{
  switch (*escape_code) {
  case 3500:
    *support = 1;
    break;
  case 3501:
    *support = 1;
    break;
  case 3502:
    *support = 1;
    break;
  case 3503:
    *support = 1;
    break;
  default:
    *support = 0;
    break;
  }
}


x86 assembly (clang, -O0):
<wx11ie>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xfffff254,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     1176 <wx11ie+0x76>
mov    -0x18(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1180 <wx11ie+0x80>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1180 <wx11ie+0x80>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1180 <wx11ie+0x80>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
jmp    1180 <wx11ie+0x80>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wx11ie>:
mov    (%rdi),%eax
and    $0xfffffffc,%eax
xor    %ecx,%ecx
cmp    $0xdac,%eax
sete   %cl
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define void @wx11ie(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* %5
switch i32 %6, label %15 [
i32 3500, label %7
i32 3501, label %9
i32 3502, label %11
i32 3503, label %13
]
7: ; preds = %2
%8 = load i32*, i32** %4
store i32 1, i32* %8
br label %17
9: ; preds = %2
%10 = load i32*, i32** %4
store i32 1, i32* %10
br label %17
11: ; preds = %2
%12 = load i32*, i32** %4
store i32 1, i32* %12
br label %17
13: ; preds = %2
%14 = load i32*, i32** %4
store i32 1, i32* %14
br label %17
15: ; preds = %2
%16 = load i32*, i32** %4
store i32 0, i32* %16
br label %17
17: ; preds = %15, %13, %11, %9, %7
ret void
}

LLVM IR (-O2):
define void @wx11ie(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, -4
%5 = icmp eq i32 %4, 3500
%6 = zext i1 %5 to i32
store i32 %6, i32* %1
ret void
}
void rec_rm(char *dir) {}


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

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

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

LLVM IR (-O2):
define void @rec_rm(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int n = 0xe4cf5906;
  printf("n: %d\n", n);
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"n: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 -456173306)
ret i32 0
}
void rop3_20_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_20_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_20_0_0>:
xor    %edx,%esi
mov    (%rdi),%al
not    %al
and    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_20_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_20_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, -1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int date_days_in_year(int);
int date_get_days_in_year(int year) { return date_days_in_year(year); }


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

x86 assembly (clang, -O2):
<date_get_days_in_year>:
jmp    1030 <date_days_in_year@plt>

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

LLVM IR (-O2):
define i32 @date_get_days_in_year(i32 %0) {
%2 = tail call i32 @date_days_in_year(i32 %0)
ret i32 %2
}
void cls(file) {
  if (file)
    (void)close(file);
}


x86 assembly (clang, -O0):
<cls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <cls+0x1f>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cls>:
test   %edi,%edi
je     111b <cls+0xb>
xor    %eax,%eax
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @cls(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @cls(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *t2(void *v) {
  volatile int *ip = (int *)v;
  sleep(2);
  if (0)
    printf("tb W\n");
  *ip += 88;
  *ip *= 3;
  sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <sleep@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x58,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
imul   $0x3,%ecx,%ecx
mov    %ecx,(%rax)
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <sleep@plt>
addl   $0x58,(%rbx)
mov    (%rbx),%eax
lea    (%rax,%rax,2),%eax
mov    %eax,(%rbx)
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @t2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = call i32 @sleep(i32 2)
%7 = load i32*, i32** %3
%8 = load volatile i32, i32* %7
%9 = add nsw i32 %8, 88
store volatile i32 %9, i32* %7
%10 = load i32*, i32** %3
%11 = load volatile i32, i32* %10
%12 = mul nsw i32 %11, 3
store volatile i32 %12, i32* %10
%13 = call i32 @sleep(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @t2(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @sleep(i32 2)
%4 = load volatile i32, i32* %2
%5 = add nsw i32 %4, 88
store volatile i32 %5, i32* %2
%6 = load volatile i32, i32* %2
%7 = mul nsw i32 %6, 3
store volatile i32 %7, i32* %2
%8 = tail call i32 @sleep(i32 1)
ret i8* null
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t g1(uint64_t x) {
  int i = 0;
  uint64_t r = x;
  do {
    r = r + 1;
  } while (i++ < 3 && r == 0);
  return r;
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    $0x3,%ecx
mov    %al,-0x19(%rbp)
jge    1147 <g1+0x47>
cmpq   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1117 <g1+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
inc    %rdi
mov    $0x1,%eax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
define i64 @g1(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i64 %0, i64* %2
store i32 0, i32* %3
%5 = load i64, i64* %2
store i64 %5, i64* %4
br label %6
6: ; preds = %16, %1
%7 = load i64, i64* %4
%8 = add nsw i64 %7, 1
store i64 %8, i64* %4
br label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = icmp slt i32 %10, 3
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 0
br label %16
16: ; preds = %13, %9
%17 = phi i1 [ false, %9 ], [ %15, %13 ]
br i1 %17, label %6, label %18
18: ; preds = %16
%19 = load i64, i64* %4
ret i64 %19
}

LLVM IR (-O2):
define i64 @g1(i64 %0) {
%2 = add i64 %0, 1
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 1, i64 %2
ret i64 %4
}
unsigned short inw(int port) {
  unsigned short value;
  asm volatile("in"
               "w"
               " %w1, %"
               "w"
               "0"
               : "=a"(value)
               : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i16 asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i32 %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ Sleep(unsigned int);
void Parrot_sleep(unsigned int seconds) { Sleep(seconds * 1000); }


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

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

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

LLVM IR (-O2):
define void @Parrot_sleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @Sleep(i32 %2)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int gettimeofday(struct timeval *restrict tp, void *restrict tzp) {
  (void)tp;
  (void)tzp;
  puts("gettimeofday: not implemented");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [30 x i8] c"gettimeofday: not implemented\00"
define i32 @gettimeofday(%struct.timeval* noalias %0, i8* noalias %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load i8*, i8** %4
%7 = call i32 @puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [30 x i8] c"gettimeofday: not implemented\00"
define i32 @gettimeofday(%struct.timeval* noalias nocapture readnone %0, i8* noalias nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void neural_layer_noise_rand(struct Layer *l) { (void)l; }


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

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

LLVM IR (-O0):
%struct.Layer = type opaque
define void @neural_layer_noise_rand(%struct.Layer* %0) {
%2 = alloca %struct.Layer*
store %struct.Layer* %0, %struct.Layer** %2
%3 = load %struct.Layer*, %struct.Layer** %2
ret void
}

LLVM IR (-O2):
%struct.Layer = type opaque
define void @neural_layer_noise_rand(%struct.Layer* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ strtoull(char const *, char **, int);
bool read_num(const char *str, uint64_t *num) {
  char *endptr;
  *num = strtoull(str, &endptr, 16);
  return str[0] && !endptr[0];
}


x86 assembly (clang, -O0):
<read_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtoull@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     115e <read_num+0x4e>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_num>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtoull@plt>
mov    %eax,(%r14)
cmpb   $0x0,(%rbx)
je     113d <read_num+0x2d>
mov    (%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
jmp    113f <read_num+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @read_num(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 @strtoull(i8* %6, i8** %5, i32 16)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
%19 = xor i1 %18, true
br label %20
20: ; preds = %14, %2
%21 = phi i1 [ false, %2 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @read_num(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @strtoull(i8* %0, i8** %3, i32 16)
store i32 %5, i32* %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %8, %2
%14 = phi i32 [ 0, %2 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int sum(double *, int);
double mean(double *data, int n) { return sum(data, n) / n; }


x86 assembly (clang, -O0):
<mean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sum@plt>
cltd
idivl  -0xc(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean>:
push   %rbx
mov    %esi,%ebx
call   1030 <sum@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @mean(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call i32 @sum(double* %5, i32 %6)
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @mean(double* %0, i32 %1) {
%3 = tail call i32 @sum(double* %0, i32 %1)
%4 = sdiv i32 %3, %1
%5 = sitofp i32 %4 to double
ret double %5
}
void glProgramParameteri(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glProgramParameteri() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void padd(unsigned int n) {
  while (n--)
    putchar(' ');
}


x86 assembly (clang, -O0):
<padd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <padd+0x2e>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    111b <padd+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padd>:
push   %rbx
test   %edi,%edi
je     112f <padd+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <padd+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @padd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @putchar(i8 signext 32)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @padd(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void f(int *restrict x, int *restrict add) {
  *x += *add;
  *x += *add;
}


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

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

LLVM IR (-O0):
define void @f(i32* noalias %0, i32* noalias %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 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %11
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @f(i32* noalias nocapture %0, i32* noalias nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = shl i32 %3, 1
%6 = add i32 %4, %5
store i32 %6, i32* %0
ret void
}
unsigned ZSTD_versionNumber(void) { return (0 * 100 * 100 + 5 * 100 + 0); }


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

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

LLVM IR (-O0):
define i32 @ZSTD_versionNumber() {
ret i32 500
}

LLVM IR (-O2):
define i32 @ZSTD_versionNumber() {
ret i32 500
}
/* Type definitions */
typedef int /*<<< orphan*/ BASIC_CONSTRAINTS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BASIC_CONSTRAINTS_it;
void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a) {
  ASN1_item_free((ASN1_VALUE *)a, &BASIC_CONSTRAINTS_it);
}


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

x86 assembly (clang, -O2):
<BASIC_CONSTRAINTS_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@BASIC_CONSTRAINTS_it = global i32 0
define void @BASIC_CONSTRAINTS_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @BASIC_CONSTRAINTS_it)
ret void
}
/* Type definitions */
struct _stat {
  int dummy;
};

/* Variables and functions */
int dll_fstat(int, struct _stat *);
int __wrap_fstat(int fd, struct _stat *buf) { return dll_fstat(fd, buf); }


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

x86 assembly (clang, -O2):
<__wrap_fstat>:
jmp    1030 <dll_fstat@plt>

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

LLVM IR (-O2):
%struct._stat = type { i32 }
define i32 @__wrap_fstat(i32 %0, %struct._stat* %1) {
%3 = tail call i32 @dll_fstat(i32 %0, %struct._stat* %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t power_get() {
  extern int power_state;
  return power_state;
}


x86 assembly (clang, -O0):
<power_get>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_get>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@power_state = external global i32
define i32 @power_get() {
%1 = load i32, i32* @power_state
ret i32 %1
}

LLVM IR (-O2):
@power_state = external global i32
define i32 @power_get() {
%1 = load i32, i32* @power_state
ret i32 %1
}
/* Variables and functions */
int _kstrtoull(char const *, unsigned int, unsigned long long *);
int kstrtoull(const char *s, unsigned int base, unsigned long long *res) {
  if (s[0] == '+')
    s++;
  return _kstrtoull(s, base, res);
}


x86 assembly (clang, -O0):
<kstrtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    113f <kstrtoull+0x2f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <_kstrtoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kstrtoull>:
xor    %eax,%eax
cmpb   $0x2b,(%rdi)
sete   %al
add    %rax,%rdi
jmp    1030 <_kstrtoull@plt>

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

LLVM IR (-O2):
define i32 @kstrtoull(i8* %0, i32 %1, i64* %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 43
%6 = zext i1 %5 to i64
%7 = getelementptr i8, i8* %0, i64 %6
%8 = tail call i32 @_kstrtoull(i8* %7, i32 %1, i64* %2)
ret i32 %8
}
void gtk_text_buffer_apply_tag() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_apply_tag() {
ret void
}
int thirdBits(void) {
  int ret = 0x24;
  ret = ret + (ret << 6);
  ret = ret + (ret << 12);
  ret = ret + (ret << 24);
  return (ret << 1) + 1;
}


x86 assembly (clang, -O0):
<thirdBits>:
push   %rbp
mov    %rsp,%rbp
movl   $0x24,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0xc,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @thirdBits() {
%1 = alloca i32
store i32 36, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 6
%5 = add nsw i32 %2, %4
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = shl i32 %7, 12
%9 = add nsw i32 %6, %8
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = load i32, i32* %1
%12 = shl i32 %11, 24
%13 = add nsw i32 %10, %12
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = shl i32 %14, 1
%16 = add nsw i32 %15, 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @thirdBits() {
ret i32 1227133513
}
unsigned xrop3_223_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_223_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_223_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_223_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_223_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
%7 = xor i32 %6, -1
%8 = or i32 %7, %3
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ perrordie(char *);
scalar_t__ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void safe_vfprintf(FILE *f, char *m, va_list ap) {
  if (vfprintf(f, m, ap) < 0)
    perrordie("vfprintf");
}


x86 assembly (clang, -O0):
<safe_vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
cmp    $0x0,%rax
jge    1159 <safe_vfprintf+0x39>
lea    0xeac(%rip),%rdi
call   1030 <perrordie@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_vfprintf>:
push   %rax
call   1040 <vfprintf@plt>
test   %rax,%rax
js     112d <safe_vfprintf+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <perrordie@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"vfprintf\00"
define void @safe_vfprintf(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @vfprintf(i32* %0, i8* %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perrordie(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
unsigned xrop3_3_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T | S;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_3_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_3_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_3_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = or i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = and i32 %33, %34
%36 = or i32 %32, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %7
%39 = and i32 %37, %38
%40 = or i32 %36, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_3_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int drv_Sample_list(void) {
  printf("Sample driver");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Sample driver\00"
define i32 @drv_Sample_list() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long get_screen_col();
long get_stat_bar_col(void) { return get_screen_col() - 1; }


x86 assembly (clang, -O0):
<get_stat_bar_col>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_screen_col@plt>
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stat_bar_col>:
push   %rax
xor    %eax,%eax
call   1030 <get_screen_col@plt>
add    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_stat_bar_col() {
%1 = call i64 (...) @get_screen_col()
%2 = sub nsw i64 %1, 1
ret i64 %2
}

LLVM IR (-O2):
define i64 @get_stat_bar_col() {
%1 = tail call i64 (...) @get_screen_col()
%2 = add nsw i64 %1, -1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int GetFileType(char *pname) {
  if (pname != NULL) {
    strcpy(pname, "GB|GBC|GBZ|GZ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<GetFileType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <GetFileType+0x27>
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileType>:
test   %rdi,%rdi
je     1126 <GetFileType+0x16>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"GB|GBC|GBZ|GZ\00"
define i32 @GetFileType(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"GB|GBC|GBZ|GZ\00"
define i32 @GetFileType(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ruijie_start_auth(char *, char *, char *,
                                     int /*<<< orphan*/);
int main() { ruijie_start_auth("kk", "123", "eth0", 0); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"kk\00"
@.str.1 = [4 x i8] c"123\00"
@.str.2 = [5 x i8] c"eth0\00"
define i32 @main() {
%1 = call i32 @ruijie_start_auth(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"kk\00"
@.str.1 = [4 x i8] c"123\00"
@.str.2 = [5 x i8] c"eth0\00"
define i32 @main() {
%1 = tail call i32 @ruijie_start_auth(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret i32 0
}
byteoff() { return (1); }


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

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

LLVM IR (-O0):
define i32 @byteoff() {
ret i32 1
}

LLVM IR (-O2):
define i32 @byteoff() {
ret i32 1
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
struct dirent ***malloc(int);
struct dirent ***ws_namelist_ptr() {
  return malloc(sizeof(struct dirent **));
}


x86 assembly (clang, -O0):
<ws_namelist_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws_namelist_ptr>:
mov    $0x8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define %struct.dirent*** @ws_namelist_ptr() {
%1 = call %struct.dirent*** @malloc(i32 8)
ret %struct.dirent*** %1
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define noalias %struct.dirent*** @ws_namelist_ptr() {
%1 = tail call %struct.dirent*** @malloc(i32 8)
ret %struct.dirent*** %1
}
/* Variables and functions */
int nvme_attach_ns(int, char **, int, char const *);
int attach_ns(int argc, char **argv) {
  const char *desc =
      "attach-ns: attach the given namespace to the "
      "given controller or comma-sep list of controllers. ID of the "
      "given namespace becomes active upon attachment to a "
      "controller. A namespace must be attached to a controller "
      "before IO commands may be directed to that namespace.";
  return nvme_attach_ns(argc, argv, 1, desc);
}


x86 assembly (clang, -O0):
<attach_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <nvme_attach_ns@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attach_ns>:
lea    0xee9(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <nvme_attach_ns@plt>

LLVM IR (-O0):
@.str = [269 x i8] c"attach-ns: attach the given namespace to the given controller or comma-sep list of controllers. ID of the given namespace becomes active upon attachment to a controller. A namespace must be attached to a controller before IO commands may be directed to that namespace.\00"
define i32 @attach_ns(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %5
%9 = call i32 @nvme_attach_ns(i32 %6, i8** %7, i32 1, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [269 x i8] c"attach-ns: attach the given namespace to the given controller or comma-sep list of controllers. ID of the given namespace becomes active upon attachment to a controller. A namespace must be attached to a controller before IO commands may be directed to that namespace.\00"
define i32 @attach_ns(i32 %0, i8** %1) {
%3 = tail call i32 @nvme_attach_ns(i32 %0, i8** %1, i32 1, i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
char tolower(int);
int esAlfa(int c) { return (tolower(c) >= 'a' && tolower(c) <= 'z'); }


x86 assembly (clang, -O0):
<esAlfa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x5(%rbp)
jl     1148 <esAlfa+0x38>
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esAlfa>:
push   %rbx
mov    %edi,%ebx
call   1030 <tolower@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x61,%cl
jl     1132 <esAlfa+0x22>
mov    %ebx,%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x7b,%cl
setl   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @esAlfa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call signext i8 @tolower(i32 %3)
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call signext i8 @tolower(i32 %8)
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @esAlfa(i32 %0) {
%2 = tail call signext i8 @tolower(i32 %0)
%3 = icmp sgt i8 %2, 96
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call signext i8 @tolower(i32 %0)
%6 = icmp slt i8 %5, 123
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite_base32hex_nonquote(char *, size_t,
                                             int /*<<< orphan*/ *);
void fwrite_base32hex(char *p, size_t len, FILE *fp) {
  fputc('\"', fp);
  fwrite_base32hex_nonquote(p, len, fp);
  fputc('\"', fp);
}


x86 assembly (clang, -O0):
<fwrite_base32hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x22,%edi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <fwrite_base32hex_nonquote@plt>
mov    -0x18(%rbp),%rsi
mov    $0x22,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwrite_base32hex>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x22,%edi
mov    %rdx,%rsi
call   1030 <fputc@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <fwrite_base32hex_nonquote@plt>
mov    $0x22,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fwrite_base32hex(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = call i32 @fputc(i8 signext 34, i32* %7)
%9 = load i8*, i8** %4
%10 = load i64, i64* %5
%11 = load i32*, i32** %6
%12 = call i32 @fwrite_base32hex_nonquote(i8* %9, i64 %10, i32* %11)
%13 = load i32*, i32** %6
%14 = call i32 @fputc(i8 signext 34, i32* %13)
ret void
}

LLVM IR (-O2):
define void @fwrite_base32hex(i8* %0, i64 %1, i32* %2) {
%4 = tail call i32 @fputc(i8 signext 34, i32* %2)
%5 = tail call i32 @fwrite_base32hex_nonquote(i8* %0, i64 %1, i32* %2)
%6 = tail call i32 @fputc(i8 signext 34, i32* %2)
ret void
}
void bwlimit(int bytes, int rate) {}


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

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

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

LLVM IR (-O2):
define void @bwlimit(i32 %0, i32 %1) {
ret void
}
void RTAvlrooGCPtrRangeRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrRangeRemove() {
ret void
}
void tracer_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @tracer_disable() {
ret void
}
void elg_pform_mpi_init() {}


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

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

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

LLVM IR (-O2):
define void @elg_pform_mpi_init() {
ret void
}
void inc_array(int arr[4]) {
  arr[0] = arr[0] + 1;
  arr[1] = arr[1] + 1;
  arr[2] = arr[2] + 1;
  arr[3] = arr[3] + 1;
}


x86 assembly (clang, -O0):
<inc_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_array>:
movdqu (%rdi),%xmm0
pcmpeqd %xmm1,%xmm1
psubd  %xmm1,%xmm0
movdqu %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @inc_array(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
ret void
}