xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x, y;
  printf("Podaj liczbe naturalna:\n");
  scanf("%d", &x);
  y = x % 3;
  printf("Reszta z dzielenia przez 3: %d\n", y);
  return y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rbx
imul   $0x55555556,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%ebx
lea    0xe8c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Podaj liczbe naturalna:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"Reszta z dzielenia przez 3: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 3
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"Reszta z dzielenia przez 3: %d\0A\00"
@str = [24 x i8] c"Podaj liczbe naturalna:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 3
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ send_text(char *);
void UsageFault_Handler(void) {
  send_text("Usage Fault.\n");
  while (1) {
  }
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Usage Fault.\0A\00"
define void @UsageFault_Handler() {
%1 = call i32 @send_text(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"Usage Fault.\0A\00"
define void @UsageFault_Handler() {
%1 = tail call i32 @send_text(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ baz();
int /*<<< orphan*/ foobar(int /*<<< orphan*/);
void foo() {
  baz();
  foobar(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <baz@plt>
xor    %edi,%edi
call   1040 <foobar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1030 <baz@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <foobar@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 (...) @baz()
%2 = call i32 @foobar(i32 0)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @baz()
%2 = tail call i32 @foobar(i32 0)
ret void
}
void glutSetWindowTitle(const char *title) {}


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

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

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

LLVM IR (-O2):
define void @glutSetWindowTitle(i8* nocapture %0) {
ret void
}
int test_imm_1Buint8_reg(unsigned char val) {
  return ((val) & (-0x1B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -27
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *malloc_string(char *src, int len) {
  char *dst = malloc(len + 1);
  memcpy(dst, src, len);
  dst[len] = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<malloc_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_string>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @malloc_string(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Variables and functions */
int foo(int, int);
int main() { return foo(1, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3,%esi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x3,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ startUnixServer();
void startServer() { startUnixServer(); }


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

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

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

LLVM IR (-O2):
define void @startServer() {
%1 = tail call i32 (...) @startUnixServer()
ret void
}
void pci_ats_init(struct pci_dev *d) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fread(long *, int, int, int /*<<< orphan*/ *);
long get_long(FILE *f) {
  long i;
  fread(&i, sizeof(long), 1, f);
  return (i);
}


x86 assembly (clang, -O0):
<get_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_long>:
push   %rax
mov    %rdi,%rcx
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_long(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i64* %3, i32 8, i32 1, i32* %4)
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_long(i32* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @fread(i64* %2, i32 8, i32 1, i32* %0)
%5 = load i64, i64* %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, char);
void spinner(int freq) {
  static int i = 0;
  static char rot[] = "\\|/-";
  if (!(i % freq)) {
    printk("%c\b", rot[(i / freq) % 4]);
  }
  i++;
}


x86 assembly (clang, -O0):
<spinner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2f13(%rip),%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
jne    115a <spinner+0x4a>
mov    0x2f00(%rip),%eax
cltd
idivl  -0x4(%rbp)
mov    $0x4,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0xeb6(%rip),%rdi
lea    0x2ed7(%rip),%rax
movsbl (%rax,%rcx,1),%esi
call   1030 <printk@plt>
mov    0x2ed4(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ecb(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spinner>:
push   %rax
mov    0x2f15(%rip),%ecx
mov    %ecx,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    114c <spinner+0x3c>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
cltq
lea    0xeca(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xec4(%rip),%rdi
call   1030 <printk@plt>
mov    0x2ee0(%rip),%ecx
add    $0x1,%ecx
mov    %ecx,0x2ed7(%rip)
pop    %rax
ret

LLVM IR (-O0):
@spinner.i = internal global i32 0
@spinner.rot = internal global [5 x i8] c"\\|/-\00"
@.str = [4 x i8] c"%c\08\00"
define void @spinner(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @spinner.i
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1
%8 = load i32, i32* @spinner.i
%9 = load i32, i32* %2
%10 = sdiv i32 %8, %9
%11 = srem i32 %10, 4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i8], [5 x i8]* @spinner.rot, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @printk(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %14)
br label %16
16: ; preds = %7, %1
%17 = load i32, i32* @spinner.i
%18 = add nsw i32 %17, 1
store i32 %18, i32* @spinner.i
ret void
}

LLVM IR (-O2):
@spinner.i = internal unnamed_addr global i32 0
@spinner.rot = internal unnamed_addr constant [5 x i8] c"\\|/-\00"
@.str = [4 x i8] c"%c\08\00"
define void @spinner(i32 %0) {
%2 = load i32, i32* @spinner.i
%3 = srem i32 %2, %0
%4 = sdiv i32 %2, %0
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = srem i32 %4, 4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [5 x i8], [5 x i8]* @spinner.rot, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printk(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = load i32, i32* @spinner.i
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ %12, %6 ], [ %2, %1 ]
%15 = add nsw i32 %14, 1
store i32 %15, i32* @spinner.i
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void drawLine(int l, char c) {
  int i;
  for (i = 1; i <= l; i++)
    printf("%c", c);
  printf("\n");
}


x86 assembly (clang, -O0):
<drawLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1154 <drawLine+0x44>
movsbl -0x5(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <drawLine+0x18>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawLine>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    112c <drawLine+0x1c>
mov    %edi,%ebx
movsbl %sil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <drawLine+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @drawLine(i32 %0, i8 signext %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = sext i8 %1 to i32
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 1, %4 ], [ %9, %6 ]
%8 = tail call i32 @putchar(i32 %5)
%9 = add nuw i32 %7, 1
%10 = icmp eq i32 %7, %0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = tail call i32 @putchar(i32 10)
ret void
}
int gt(float x, float y) { return x > y; }


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

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

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

LLVM IR (-O2):
define i32 @gt(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void INT_Excep_PERIB_INTB137(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB137() {
ret void
}
const char *f3(void) { return "falderalde"; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"falderalde\00"
define i8* @f3() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"falderalde\00"
define i8* @f3() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void strmvback(char *cadena, int n) { strcpy(cadena, &cadena[n]); }


x86 assembly (clang, -O0):
<strmvback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmvback>:
movslq %esi,%rsi
add    %rdi,%rsi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @strmvback(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = call i32 @strcpy(i8* %5, i8* %9)
ret void
}

LLVM IR (-O2):
define void @strmvback(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @strcpy(i8* %0, i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_d2u64(double);
int /*<<< orphan*/ rgph_u32_xxh32s_u64(int /*<<< orphan*/, uintptr_t);
uint32_t rgph_u32_xxh32s_f64(double value, uintptr_t seed) {
  return rgph_u32_xxh32s_u64(rgph_d2u64(value), seed);
}


x86 assembly (clang, -O0):
<rgph_u32_xxh32s_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <rgph_d2u64@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <rgph_u32_xxh32s_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32_xxh32s_f64>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rgph_d2u64@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <rgph_u32_xxh32s_u64@plt>

LLVM IR (-O0):
define i32 @rgph_u32_xxh32s_f64(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load double, double* %3
%6 = call i32 @rgph_d2u64(double %5)
%7 = load i64, i64* %4
%8 = call i32 @rgph_u32_xxh32s_u64(i32 %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rgph_u32_xxh32s_f64(double %0, i64 %1) {
%3 = tail call i32 @rgph_d2u64(double %0)
%4 = tail call i32 @rgph_u32_xxh32s_u64(i32 %3, i64 %1)
ret i32 %4
}
void nukecr(char *s) {
  while (*s && *s != '\n')
    s++;
  *s = 0;
}


x86 assembly (clang, -O0):
<nukecr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112d <nukecr+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113d <nukecr+0x3d>
jmp    114e <nukecr+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <nukecr+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nukecr>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <nukecr+0x11>
cmp    $0xa,%al
je     1111 <nukecr+0x11>
add    $0x1,%rdi
jmp    1100 <nukecr>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @nukecr(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ absolutex();
int /*<<< orphan*/ ror16addr(int /*<<< orphan*/);
void rorAbsx16(void) { ror16addr(absolutex()); }


x86 assembly (clang, -O0):
<rorAbsx16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <absolutex@plt>
mov    %eax,%edi
call   1040 <ror16addr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rorAbsx16>:
push   %rax
xor    %eax,%eax
call   1030 <absolutex@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ror16addr@plt>

LLVM IR (-O0):
define void @rorAbsx16() {
%1 = call i32 (...) @absolutex()
%2 = call i32 @ror16addr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @rorAbsx16() {
%1 = tail call i32 (...) @absolutex()
%2 = tail call i32 @ror16addr(i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ppz8_pvi_decodebuf_samples(uint32_t pvidatalen) {
  if (pvidatalen < 0x210)
    return 0;
  return (pvidatalen - 0x210) * 2;
}


x86 assembly (clang, -O0):
<ppz8_pvi_decodebuf_samples>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x210,-0x8(%rbp)
jge    1120 <ppz8_pvi_decodebuf_samples+0x20>
movl   $0x0,-0x4(%rbp)
jmp    112e <ppz8_pvi_decodebuf_samples+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x210,%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppz8_pvi_decodebuf_samples>:
xor    %ecx,%ecx
cmp    $0x210,%edi
lea    -0x420(%rdi,%rdi,1),%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ppz8_pvi_decodebuf_samples(i32 %0) {
%2 = icmp slt i32 %0, 528
%3 = shl i32 %0, 1
%4 = add i32 %3, -1056
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write_serial_char(char);
void write_serial_string(char *str) {
  while (*str != '\0') {
    write_serial_char(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<write_serial_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <write_serial_string+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <write_serial_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <write_serial_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <write_serial_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <write_serial_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <write_serial_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @write_serial_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @write_serial_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int sscanf(char *, char *, unsigned int *);
int /*<<< orphan*/ stderr;
void parse_dec_val(char *src, unsigned int *val_ptr) {
  int i, count;
  count = sscanf(src, "%d", val_ptr);
  if (count != 1) {
    fprintf(stderr, "Illegall value - should be decimal.\n");
    exit(-1);
  }
  return;
}


x86 assembly (clang, -O0):
<parse_dec_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1040 <sscanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
je     1180 <parse_dec_val+0x50>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_dec_val>:
push   %rax
mov    %rsi,%rdx
lea    0xec5(%rip),%rsi
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1147 <parse_dec_val+0x17>
pop    %rax
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [37 x i8] c"Illegall value - should be decimal.\0A\00"
define void @parse_dec_val(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%7 = load i8*, i8** %3
%8 = load i32*, i32** %4
%9 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@stderr = global i32 0
@.str.1 = [37 x i8] c"Illegall value - should be decimal.\0A\00"
define void @parse_dec_val(i8* nocapture %0, i32* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void __attribute__((weak)) usr_mlme_orphan_ind(uint64_t OrphanAddress) {
  OrphanAddress = OrphanAddress;
}


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

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

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

LLVM IR (-O2):
define weak void @usr_mlme_orphan_ind(i32 %0) {
ret void
}
int test_imm_80int8_reg(signed char val) {
  return ((val) & (0x80 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_80int8_reg(i8 signext %0) {
%2 = icmp sgt i8 %0, -1
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
void do_define_key(int code, char *strcap) {}


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

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

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

LLVM IR (-O2):
define void @do_define_key(i32 %0, i8* nocapture %1) {
ret void
}
int Fibonacci(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else
    return (Fibonacci(n - 1) + Fibonacci(n - 2));
}


x86 assembly (clang, -O0):
<Fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <Fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <Fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <Fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <Fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <Fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <Fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <Fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <Fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <Fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @Fibonacci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
extern int isonum_722(p)
unsigned char *p;
{ return ((char)*p << 8) | p[1]; }


x86 assembly (clang, -O0):
<isonum_722>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonum_722>:
movsbl (%rdi),%ecx
shl    $0x8,%ecx
movzbl 0x1(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isonum_722(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = shl i32 %5, 8
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @isonum_722(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 0xaabbccdd;
  int z = 0x11223344;
  void *void_xptr = (void *)&x;
  void_xptr += 1;
  int *xptr = (int *)void_xptr;
  int y = *xptr;
  printf("%x", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xaabbccdd,-0x8(%rbp)
movl   $0x11223344,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i32 0, i32* %1
store i32 -1430532899, i32* %2
store i32 287454020, i32* %3
%7 = bitcast i32* %2 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = getelementptr i8, i8* %8, i64 1
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 11189196)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ max(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  max(a, b);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <max@plt>
jmp    114e <main+0x2e>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <max@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1150 <main+0x30>

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @max(i32 %5, i32 %6)
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @max(i32 %6, i32 %7)
br label %9
9: ; preds = %9, %0
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
void _closefile(void *handle) { fclose(handle); }


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

x86 assembly (clang, -O2):
<_closefile>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @_closefile(i8* nocapture %0) {
%2 = tail call i32 @fclose(i8* %0)
ret void
}
/* Variables and functions */
int do_on_knox(int);
int kill_knox(void) { return do_on_knox(1); }


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

x86 assembly (clang, -O2):
<kill_knox>:
mov    $0x1,%edi
jmp    1030 <do_on_knox@plt>

LLVM IR (-O0):
define i32 @kill_knox() {
%1 = call i32 @do_on_knox(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @kill_knox() {
%1 = tail call i32 @do_on_knox(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  printf("La edad del super modelo de profe es: %f!\n", 25);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x19,%esi
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    $0x19,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"La edad del super modelo de profe es: %f!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 25)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"La edad del super modelo de profe es: %f!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 25)
ret i32 0
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_mvwget_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_mvwget_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_mvwget_wch+0x2a>
jmp    1170 <cmd_mvwget_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mvwget_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_mvwget_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_mvwget_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
int utf8CharLength(char firstByte) {
  if ((firstByte & 0x80) == 0) {
    return 1;
  } else if ((firstByte & 0xE0) == 0xC0) {
    return 2;
  } else if ((firstByte & 0xF0) == 0xE0) {
    return 3;
  } else if ((firstByte & 0xF8) == 0xF0) {
    return 4;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<utf8CharLength>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1128 <utf8CharLength+0x28>
movl   $0x1,-0x4(%rbp)
jmp    118f <utf8CharLength+0x8f>
movsbl -0x5(%rbp),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    1148 <utf8CharLength+0x48>
movl   $0x2,-0x4(%rbp)
jmp    118f <utf8CharLength+0x8f>
movsbl -0x5(%rbp),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    1168 <utf8CharLength+0x68>
movl   $0x3,-0x4(%rbp)
jmp    118f <utf8CharLength+0x8f>
movsbl -0x5(%rbp),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    1188 <utf8CharLength+0x88>
movl   $0x4,-0x4(%rbp)
jmp    118f <utf8CharLength+0x8f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8CharLength>:
mov    $0x1,%eax
test   $0x80,%dil
je     1144 <utf8CharLength+0x44>
movzbl %dil,%ecx
mov    %ecx,%edx
and    $0xffffffe0,%edx
mov    $0x2,%eax
cmp    $0xc0,%edx
je     1144 <utf8CharLength+0x44>
mov    %ecx,%edx
and    $0xfffffff0,%edx
mov    $0x3,%eax
cmp    $0xe0,%edx
je     1144 <utf8CharLength+0x44>
and    $0xfffffff8,%ecx
xor    %eax,%eax
cmp    $0xf0,%ecx
sete   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @utf8CharLength(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 = and i32 %5, 128
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %28
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = and i32 %11, 224
%13 = icmp eq i32 %12, 192
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 2, i32* %2
br label %28
15: ; preds = %9
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = and i32 %17, 240
%19 = icmp eq i32 %18, 224
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 3, i32* %2
br label %28
21: ; preds = %15
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = and i32 %23, 248
%25 = icmp eq i32 %24, 240
br i1 %25, label %26, label %27
26: ; preds = %21
store i32 4, i32* %2
br label %28
27: ; preds = %21
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %20, %14, %8
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @utf8CharLength(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = and i32 %2, 224
%7 = icmp eq i32 %6, 192
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = and i32 %2, 240
%10 = icmp eq i32 %9, 224
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = and i32 %2, 248
%13 = icmp eq i32 %12, 240
%14 = select i1 %13, i32 4, i32 0
br label %15
15: ; preds = %11, %8, %5, %1
%16 = phi i32 [ 1, %1 ], [ 2, %5 ], [ 3, %8 ], [ %14, %11 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void setWheelSpeed(float wheelLeft, float wheelRight) {
  printf("\tSetting Wheel Speeds (%f, %f)\n", wheelLeft, wheelRight);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"\09Setting Wheel Speeds (%f, %f)\0A\00"
define void @setWheelSpeed(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), float %5, float %6)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\09Setting Wheel Speeds (%f, %f)\0A\00"
define void @setWheelSpeed(float %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), float %0, float %1)
ret void
}
short SwapShort(short num) {
  return (((num >> 0) & 0xFF) << 8) + (((num >> 8) & 0xFF) << 0);
}


x86 assembly (clang, -O0):
<SwapShort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
shl    $0x8,%eax
movswl -0x2(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x0,%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapShort>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define signext i16 @SwapShort(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = ashr i32 %4, 0
%6 = and i32 %5, 255
%7 = shl i32 %6, 8
%8 = load i16, i16* %2
%9 = sext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = shl i32 %11, 0
%13 = add nsw i32 %7, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @SwapShort(i16 signext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
char toupper(char);
char *forceUC(char *str) {
  char *ptr = (char *)NULL;
  for (ptr = str; *ptr != '\0'; ptr++) {
    *ptr = toupper(*ptr);
  }
  return str;
}


x86 assembly (clang, -O0):
<forceUC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <forceUC+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <forceUC+0x1c>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forceUC>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <forceUC+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <forceUC+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @forceUC(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_function() { printf("Welcome to my function. Feel at home.\n"); }


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Welcome to my function. Feel at home.\0A\00"
define void @my_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [38 x i8] c"Welcome to my function. Feel at home.\00"
define void @my_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}