xunge/DecIR huggingface dataset:
double foo(double x, double y) {
  volatile int i = 0;
  return i < 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1130 <foo+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    113a <foo+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
js     1112 <foo+0x12>
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp slt i32 %5, 0
%7 = select i1 %6, double %0, double %1
ret double %7
}
/* Type definitions */
typedef scalar_t__ base;

/* Variables and functions */
int /*<<< orphan*/ barrier();
void putc(int c) {
  unsigned long base = (0UL);
  if (!base)
    return;
  while ((*(volatile unsigned char *)((base) + 0x18)) & (1 << 5))
    barrier();
  (*(volatile unsigned char *)((base) + 0x00)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <putc+0x23>
jmp    1165 <putc+0x55>
jmp    1138 <putc+0x28>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     115a <putc+0x4a>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1138 <putc+0x28>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
br label %24
7: ; preds = %1
br label %8
8: ; preds = %16, %7
%9 = load i64, i64* %3
%10 = add i64 %9, 24
%11 = inttoptr i64 %10 to i8*
%12 = load volatile i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %8
%17 = call i32 (...) @barrier()
br label %8
18: ; preds = %8
%19 = load i32, i32* %2
%20 = trunc i32 %19 to i8
%21 = load i64, i64* %3
%22 = add i64 %21, 0
%23 = inttoptr i64 %22 to i8*
store volatile i8 %20, i8* %23
br label %24
24: ; preds = %18, %6
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
ret void
}
void print_eapol(char *eapol) {}


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

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

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

LLVM IR (-O2):
define void @print_eapol(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void pl(char *str) {
  write(1, "\n", 1);
  write(1, str, strlen(str));
}


x86 assembly (clang, -O0):
<pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edx
lea    0xec8(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @pl(i8* %0) {
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 1, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_primes();
int main(int argc, char *argv[]) {
  read_primes();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <read_primes@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @read_primes()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @read_primes()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ u_long;
typedef scalar_t__ u_int;
struct TYPE_3__ {
  scalar_t__ x_base;
  scalar_t__ x_private;
};
typedef TYPE_1__ XDR;

/* Variables and functions */
u_int xdrmem_getpos(const XDR *xdrs) {
  return (u_long)xdrs->x_private - (u_long)xdrs->x_base;
}


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

x86 assembly (clang, -O2):
<xdrmem_getpos>:
mov    0x8(%rdi),%rax
sub    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define i64 @xdrmem_getpos(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sub nsw i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64 }
define i64 @xdrmem_getpos(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = sub nsw i64 %3, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr(char const *s) {
  int i;
  if (!s)
    return;
  i = 0;
  while (s[i])
    i++;
  write(1, s, i);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_putstr+0x1c>
jmp    1164 <ft_putstr+0x54>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1153 <ft_putstr+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ft_putstr+0x23>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
test   %rdi,%rdi
je     1137 <ft_putstr+0x27>
mov    %rdi,%rsi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = tail call i32 @write(i32 1, i8* %0, i32 %10)
br label %12
12: ; preds = %1, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump(int);
int /*<<< orphan*/ dump_leaf(int, int);
int main(int argc, char *argv[]) {
  dump(0x00000001);
  dump_leaf(0x00000007, 0x00000000);
  dump(0x80000001);
  dump(0xC0000001);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <dump@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <dump_leaf@plt>
mov    $0x80000001,%edi
call   1040 <dump@plt>
mov    $0xc0000001,%edi
call   1040 <dump@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <dump@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <dump_leaf@plt>
mov    $0x80000001,%edi
call   1040 <dump@plt>
mov    $0xc0000001,%edi
call   1040 <dump@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @dump(i32 1)
%6 = call i32 @dump_leaf(i32 7, i32 0)
%7 = call i32 @dump(i32 -2147483647)
%8 = call i32 @dump(i32 -1073741823)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @dump(i32 1)
%4 = tail call i32 @dump_leaf(i32 7, i32 0)
%5 = tail call i32 @dump(i32 -2147483647)
%6 = tail call i32 @dump(i32 -1073741823)
ret i32 0
}
void set_color1(unsigned int *p, int style) { *p |= style << (32 - 12); }


x86 assembly (clang, -O0):
<set_color1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x14,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_color1>:
shl    $0x14,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_color1(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 20
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @set_color1(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 20
%4 = load i32, i32* %0
%5 = or i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
double pow(int, double);
double libxmp_note_to_period_mix(int n, int b) {
  double d = (double)n + (double)b / 12800;
  return 13696.0 / pow(2, d / 12);
}


x86 assembly (clang, -O0):
<libxmp_note_to_period_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libxmp_note_to_period_mix>:
push   %rax
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
divsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xed1(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @libxmp_note_to_period_mix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 1.280000e+04
%11 = fadd double %7, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = fdiv double %12, 1.200000e+01
%14 = call double @pow(i32 2, double %13)
%15 = fdiv double 1.369600e+04, %14
ret double %15
}

LLVM IR (-O2):
define double @libxmp_note_to_period_mix(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fdiv double %4, 1.280000e+04
%6 = fadd double %5, %3
%7 = fdiv double %6, 1.200000e+01
%8 = tail call double @pow(i32 2, double %7)
%9 = fdiv double 1.369600e+04, %8
ret double %9
}
/* Variables and functions */
int identity(char);
char tand0(char x) {
  char y = (identity(x) & 0) ? 42 : 43;
  return y;
}


x86 assembly (clang, -O0):
<tand0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <identity@plt>
mov    %eax,%edx
and    $0x0,%edx
mov    $0x2b,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tand0>:
push   %rax
call   1030 <identity@plt>
mov    $0x2b,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @tand0(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @identity(i8 signext %4)
%6 = and i32 %5, 0
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 42, i32 43
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @tand0(i8 signext %0) {
%2 = tail call i32 @identity(i8 signext %0)
ret i8 43
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int init_module(void) {
  printk("init_module called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"init_module called\0A\00"
define i32 @init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ aryt(int);
int /*<<< orphan*/ dziwneFor(int *, int);
int /*<<< orphan*/ sprPostAndPre(int *, int);
int main() {
  int tab[] = {1, 2, 3, 4, 5};
  dziwneFor(tab, 5);
  sprPostAndPre(tab, 3);
  aryt(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <dziwneFor@plt>
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1050 <sprPostAndPre@plt>
mov    $0xa,%edi
call   1030 <aryt@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <dziwneFor@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <sprPostAndPre@plt>
mov    $0xa,%edi
call   1030 <aryt@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.tab = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @dziwneFor(i32* %4, i32 5)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @sprPostAndPre(i32* %6, i32 3)
%8 = call i32 @aryt(i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.tab = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @dziwneFor(i32* %3, i32 5)
%5 = call i32 @sprPostAndPre(i32* %3, i32 3)
%6 = call i32 @aryt(i32 10)
ret i32 0
}
void func2(int var1, int var2) {
  var1 = var2 << 1;
  var1 = var2 >> 1;
}


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

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

LLVM IR (-O0):
define void @func2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = ashr i32 %7, 1
store i32 %8, i32* %3
ret void
}

LLVM IR (-O2):
define void @func2(i32 %0, i32 %1) {
ret void
}
char *get_basename(char *path) {
  char *pos;
  char *result;
  pos = path;
  result = path;
  while (*pos != '\0') {
    if (*(pos++) == '/')
      result = pos;
  }
  return result;
}


x86 assembly (clang, -O0):
<get_basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <get_basename+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    114b <get_basename+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <get_basename+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basename>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <get_basename+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <get_basename+0x10>
ret

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

LLVM IR (-O2):
define i8* @get_basename(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void die_no_conn(const char *message) {
  if (errno) {
    perror(message);
  } else {
    printf("ERROR: %s\n", message);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<die_no_conn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <die_no_conn+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    116b <die_no_conn+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<die_no_conn>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <die_no_conn+0x23>
mov    %rsi,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die_no_conn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @die_no_conn(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
unsigned char getCommand(unsigned char *packet) {
  int commanda = (packet[5] & 0xf);
  int commandb = (packet[6] & 0xf);
  if (commanda != commandb) {
    fprintf(stderr, "Commands a and b don't match!\n");
  }
  return commanda;
}


x86 assembly (clang, -O0):
<getCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1159 <getCommand+0x49>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCommand>:
push   %rbx
mov    0x5(%rdi),%bl
mov    0x6(%rdi),%al
and    $0xf,%bl
and    $0xf,%al
cmp    %al,%bl
je     1135 <getCommand+0x25>
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Commands a and b don't match!\0A\00"
define zeroext i8 @getCommand(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, 15
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 15
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %1
%19 = load i32, i32* @stderr
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %18, %1
%22 = load i32, i32* %3
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Commands a and b don't match!\0A\00"
define zeroext i8 @getCommand(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = load i8, i8* %2
%4 = and i8 %3, 15
%5 = getelementptr inbounds i8, i8* %0, i64 6
%6 = load i8, i8* %5
%7 = and i8 %6, 15
%8 = icmp eq i8 %4, %7
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
ret i8 %4
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int ResolveSockaddr(struct sockaddr *src, const char *host, const size_t hostln,
                    const unsigned short port) {
  return 0;
}


x86 assembly (clang, -O0):
<ResolveSockaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @ResolveSockaddr(%struct.sockaddr* %0, i8* %1, i64 %2, i16 zeroext %3) {
%5 = alloca %struct.sockaddr*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i16
store %struct.sockaddr* %0, %struct.sockaddr** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i16 %3, i16* %8
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @ResolveSockaddr(%struct.sockaddr* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i16 zeroext %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rd_word(char const **, char);
int write_word();
int rd_wrt_addr(const char **p, char delimiter) {
  if (!rd_word(p, delimiter))
    return 0;
  return write_word();
}


x86 assembly (clang, -O0):
<rd_wrt_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <rd_word@plt>
cmp    $0x0,%eax
jne    1154 <rd_wrt_addr+0x34>
movl   $0x0,-0x4(%rbp)
jmp    115e <rd_wrt_addr+0x3e>
mov    $0x0,%al
call   1040 <write_word@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_wrt_addr>:
push   %rax
call   1030 <rd_word@plt>
test   %eax,%eax
je     1132 <rd_wrt_addr+0x12>
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_word@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rd_wrt_addr(i8** %0, i8 signext %1) {
%3 = tail call i32 @rd_word(i8** %0, i8 signext %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @write_word()
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
void wifi_evt_system_sw_exception(
    const struct wifi_msg_system_sw_exception_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_system_sw_exception_evt_t = type opaque
define void @wifi_evt_system_sw_exception(%struct.wifi_msg_system_sw_exception_evt_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ av_strerror(int, char *, size_t);
char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum) {
  av_strerror(errnum, errbuf, errbuf_size);
  return errbuf;
}


x86 assembly (clang, -O0):
<av_make_error_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <av_strerror@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_make_error_string>:
push   %rbx
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <av_strerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @av_make_error_string(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 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i32 @av_strerror(i32 %7, i8* %8, i64 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @av_make_error_string(i8* returned %0, i64 %1, i32 %2) {
%4 = tail call i32 @av_strerror(i32 %2, i8* %0, i64 %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wfree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<wfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @wfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
int wctomb(char *s, wchar_t wc) {
  if (s == NULL) {
    return 0;
  } else {
    *s = (char)wc;
    return 1;
  };
}


x86 assembly (clang, -O0):
<wctomb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <wctomb+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1136 <wctomb+0x36>
mov    -0x18(%rbp),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb>:
test   %rdi,%rdi
je     110e <wctomb+0xe>
mov    %sil,(%rdi)
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @wctomb(i8* writeonly %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = trunc i64 %1 to i8
store i8 %5, i8* %0
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
int hashidx(char key) {
  if (key < 'A')
    return (0);
  if (key <= 'Z')
    return (1 + key - 'A');
  if (key < 'a')
    return (27);
  if (key <= 'z')
    return (28 + key - 'a');
  return (54);
}


x86 assembly (clang, -O0):
<hashidx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jge    1123 <hashidx+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1181 <hashidx+0x81>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1142 <hashidx+0x42>
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <hashidx+0x81>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jge    115b <hashidx+0x5b>
movl   $0x1b,-0x4(%rbp)
jmp    1181 <hashidx+0x81>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     117a <hashidx+0x7a>
movsbl -0x5(%rbp),%eax
add    $0x1c,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <hashidx+0x81>
movl   $0x36,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashidx>:
xor    %eax,%eax
cmp    $0x41,%dil
jl     1130 <hashidx+0x30>
cmp    $0x5a,%dil
ja     1114 <hashidx+0x14>
add    $0xffffffc0,%edi
mov    %edi,%eax
ret
mov    $0x1b,%eax
cmp    $0x61,%dil
jb     1130 <hashidx+0x30>
mov    %edi,%ecx
add    $0xffffffbb,%ecx
cmp    $0x7b,%dil
mov    $0x36,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hashidx(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 slt i32 %5, 65
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %32
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 1, %14
%16 = sub nsw i32 %15, 65
store i32 %16, i32* %2
br label %32
17: ; preds = %8
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp slt i32 %19, 97
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 27, i32* %2
br label %32
22: ; preds = %17
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 122
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = add nsw i32 28, %28
%30 = sub nsw i32 %29, 97
store i32 %30, i32* %2
br label %32
31: ; preds = %22
store i32 54, i32* %2
br label %32
32: ; preds = %31, %26, %21, %12, %7
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @hashidx(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 65
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = icmp ult i8 %0, 91
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = add nsw i32 %2, -64
br label %14
8: ; preds = %4
%9 = icmp ult i8 %0, 97
br i1 %9, label %14, label %10
10: ; preds = %8
%11 = icmp ult i8 %0, 123
%12 = add nsw i32 %2, -69
%13 = select i1 %11, i32 %12, i32 54
br label %14
14: ; preds = %10, %8, %1, %6
%15 = phi i32 [ %7, %6 ], [ 0, %1 ], [ 27, %8 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ check_parenthesis(char **);
int eval_expr(char *str) { check_parenthesis(&str); }


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

x86 assembly (clang, -O2):
<eval_expr>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <check_parenthesis@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @eval_expr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @check_parenthesis(i8** %2)
ret i32 undef
}
void avpriv_put_string() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_put_string() {
ret void
}
int is_option(const char *const str) {
  return ((str[0] == '-') && str[1]) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_option>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    112e <is_option+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_option>:
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
jne    1110 <is_option+0x10>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_option(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void f() {
  const int b;
  const int *c;
  int *const d;
  const int *const e;
  typedef const int foo;
  foo f;
  const int g[5];
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca [5 x i32]
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t rgb16ToRgb32(uint16_t c) {
  return 0xff000000 | ((((c) << 3) & 0xf8) | (((c) >> 2) & 0x7)) |
         ((((c) << 5) & 0xfc00) | (((c) >> 1) & 0x300)) |
         ((((c) << 8) & 0xf80000) | (((c) << 3) & 0x70000));
}


x86 assembly (clang, -O0):
<rgb16ToRgb32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
and    $0xf8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x7,%ecx
or     %ecx,%eax
or     $0xff000000,%eax
mov    -0x4(%rbp),%ecx
shl    $0x5,%ecx
and    $0xfc00,%ecx
mov    -0x4(%rbp),%edx
sar    $0x1,%edx
and    $0x300,%edx
or     %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xf80000,%ecx
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
and    $0x70000,%edx
or     %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb16ToRgb32>:
lea    0x0(,%rdi,8),%eax
movzbl %al,%r8d
mov    %edi,%edx
shr    $0x2,%edx
and    $0x7,%edx
mov    %edi,%esi
shl    $0x5,%esi
and    $0xfc00,%esi
mov    %edi,%ecx
shr    %ecx
and    $0x300,%ecx
shl    $0x8,%edi
and    $0xf80000,%edi
and    $0x70000,%eax
or     %edi,%eax
or     %edx,%eax
or     %r8d,%eax
or     %ecx,%eax
add    %esi,%eax
add    $0xff000000,%eax
ret

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

LLVM IR (-O2):
define i32 @rgb16ToRgb32(i32 %0) {
%2 = shl i32 %0, 3
%3 = and i32 %2, 248
%4 = lshr i32 %0, 2
%5 = and i32 %4, 7
%6 = shl i32 %0, 5
%7 = and i32 %6, 64512
%8 = lshr i32 %0, 1
%9 = and i32 %8, 768
%10 = shl i32 %0, 8
%11 = and i32 %10, 16252928
%12 = and i32 %2, 458752
%13 = or i32 %12, %11
%14 = or i32 %13, %5
%15 = or i32 %14, %3
%16 = or i32 %15, %9
%17 = or i32 %16, %7
%18 = or i32 %17, -16777216
ret i32 %18
}
int execute_munmap() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_munmap() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello git!\n");
  return 0;
}


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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [11 x i8] c"hello git!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int check(char *str, char currentChar) {
  int result = 0;
  int i = 0;
  char c;
  while ((c = str[i++]) && !(result = (c == currentChar)))
    ;
  return result;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x15(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x16(%rbp)
je     1162 <check+0x62>
movsbl -0x15(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x10(%rbp)
xor    $0xff,%al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
test   $0x1,%al
jne    1172 <check+0x72>
jmp    1177 <check+0x77>
jmp    111c <check+0x1c>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
movzbl (%rdi),%eax
test   %al,%al
je     1116 <check+0x16>
add    $0x1,%rdi
cmp    %sil,%al
jne    1100 <check>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i64 [ %9, %8 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = add nuw i64 %4, 1
%10 = icmp eq i8 %6, %1
br i1 %10, label %11, label %3
11: ; preds = %3, %8
%12 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %12
}
int main(void) {
  int patatino = 27;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int validate_author_url(const char *url) {
  if (url == NULL) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<validate_author_url>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <validate_author_url+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1126 <validate_author_url+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_author_url>:
cmp    $0x1,%rdi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @validate_author_url(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void flush(struct forth_instance *fi) {
  fflush(stdin);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fflush@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
@stdin = global i32 0
@stdout = global i32 0
define void @flush(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load i32, i32* @stdin
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
@stdin = global i32 0
@stdout = global i32 0
define void @flush(%struct.forth_instance* nocapture readnone %0) {
%2 = load i32, i32* @stdin
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
void init_cycfg_peripherals(void) {}


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

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

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

LLVM IR (-O2):
define void @init_cycfg_peripherals() {
ret void
}
void nm_writeb(unsigned char value, unsigned char *ptr) { *ptr = value; }


x86 assembly (clang, -O0):
<nm_writeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nm_writeb>:
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @nm_writeb(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
store i8 %5, i8* %6
ret void
}

LLVM IR (-O2):
define void @nm_writeb(i8 zeroext %0, i8* nocapture writeonly %1) {
store i8 %0, i8* %1
ret void
}