xunge/DecIR huggingface dataset:
int DC_getMaxMessageSize(void) { return (16384); }


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

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

LLVM IR (-O0):
define i32 @DC_getMaxMessageSize() {
ret i32 16384
}

LLVM IR (-O2):
define i32 @DC_getMaxMessageSize() {
ret i32 16384
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void add(int x, int y) { printf("%i\n", (x + y)); }


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

x86 assembly (clang, -O2):
<add>:
add    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int keypad_getchar();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  while (1) {
    int the_key = keypad_getchar();
    printf("%c", the_key);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <keypad_getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <keypad_getchar@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x10>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @keypad_getchar()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fgetc(int /*<<< orphan*/ *);
void skipBytes(FILE *f, int length) {
  for (; length > 0; --length)
    if (fgetc(f) == EOF)
      return;
}


x86 assembly (clang, -O0):
<skipBytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115a <skipBytes+0x4a>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%rax
jne    1147 <skipBytes+0x37>
jmp    115a <skipBytes+0x4a>
jmp    114c <skipBytes+0x3c>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <skipBytes+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipBytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <skipBytes+0x37>
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2ec3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <fgetc@plt>
cmp    (%r15),%rax
je     1147 <skipBytes+0x37>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jg     1130 <skipBytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i64 0
define void @skipBytes(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = tail call i64 @fgetc(i32* %0)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
%9 = add nsw i32 %5, -1
%10 = icmp sgt i32 %5, 1
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
void *malloc(long);
void *_xte_malloc(long in_bytes, int in_zone, char const *in_file,
                  long in_line) {
  return malloc(in_bytes);
}


x86 assembly (clang, -O0):
<_xte_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xte_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @_xte_malloc(i64 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i64 %0, i64* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = call i8* @malloc(i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @_xte_malloc(i64 %0, i32 %1, i8* nocapture readnone %2, i64 %3) {
%5 = tail call i8* @malloc(i64 %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("\nMACRO1 Defined\n");
  printf("\nMACRO2 Defined\n");
  int result = 2 * (2 + 5);
  printf("result : %d\n", result);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\0AMACRO1 Defined\0A\00"
@.str.1 = [17 x i8] c"\0AMACRO2 Defined\0A\00"
@.str.2 = [13 x i8] c"result : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 14, i32* %1
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [13 x i8] c"result : %d\0A\00"
@str = [16 x i8] c"\0AMACRO1 Defined\00"
@str.3 = [16 x i8] c"\0AMACRO2 Defined\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pr_procmask(char *);
void sig_int(int signo) { pr_procmask("\nin sig_int:"); }


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <pr_procmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"\0Ain sig_int:\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pr_procmask(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\0Ain sig_int:\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @pr_procmask(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void YUY2ToYRow_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToYRow_SSE2() {
ret void
}
int test_imm_B9uint16_reg(unsigned short val) {
  return ((val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 185
%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_B9uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 185
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t nibble_fill(uint64_t u) {
  u &= 0xf;
  u |= u << 4;
  u |= u << 8;
  u |= u << 16;
  u |= u << 32;
  return u;
}


x86 assembly (clang, -O0):
<nibble_fill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nibble_fill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = shl i32 %5, 4
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 16
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = shl i32 %17, 32
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @nibble_fill(i32 %0) {
ret i32 poison
}
pct(x) int x;
{ return (rand() % 100 < x); }


x86 assembly (clang, -O0):
<pct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    -0x4(%rbp),%edx
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pct>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setl   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 100
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @pct(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int compute_pixblt_b_cycles(int left_partials, int right_partials,
                            int full_words, int rows, int op_timing, int bpp) {
  int srcwords, dstwords;
  if (left_partials)
    full_words += 1;
  if (right_partials)
    full_words += 1;
  srcwords = full_words * bpp / 16;
  dstwords = full_words;
  return (dstwords * op_timing + srcwords * 2) * rows + 2;
}


x86 assembly (clang, -O0):
<compute_pixblt_b_cycles>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112b <compute_pixblt_b_cycles+0x2b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113e <compute_pixblt_b_cycles+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
imul   -0x10(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_pixblt_b_cycles>:
cmp    $0x1,%edi
sbb    $0xffffffff,%edx
cmp    $0x1,%esi
sbb    $0xffffffff,%edx
imul   %edx,%r9d
lea    0xf(%r9),%eax
test   %r9d,%r9d
cmovns %r9d,%eax
sar    $0x4,%eax
imul   %r8d,%edx
lea    (%rdx,%rax,2),%eax
imul   %ecx,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @compute_pixblt_b_cycles(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %6
%18 = load i32, i32* %9
%19 = add nsw i32 %18, 1
store i32 %19, i32* %9
br label %20
20: ; preds = %17, %6
%21 = load i32, i32* %8
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %9
%25 = add nsw i32 %24, 1
store i32 %25, i32* %9
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %9
%28 = load i32, i32* %12
%29 = mul nsw i32 %27, %28
%30 = sdiv i32 %29, 16
store i32 %30, i32* %13
%31 = load i32, i32* %9
store i32 %31, i32* %14
%32 = load i32, i32* %14
%33 = load i32, i32* %11
%34 = mul nsw i32 %32, %33
%35 = load i32, i32* %13
%36 = mul nsw i32 %35, 2
%37 = add nsw i32 %34, %36
%38 = load i32, i32* %10
%39 = mul nsw i32 %37, %38
%40 = add nsw i32 %39, 2
ret i32 %40
}

LLVM IR (-O2):
define i32 @compute_pixblt_b_cycles(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ne i32 %0, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %8, %2
%10 = icmp ne i32 %1, 0
%11 = zext i1 %10 to i32
%12 = add nsw i32 %9, %11
%13 = mul nsw i32 %12, %5
%14 = sdiv i32 %13, 16
%15 = mul nsw i32 %12, %4
%16 = shl nsw i32 %14, 1
%17 = add nsw i32 %16, %15
%18 = mul nsw i32 %17, %3
%19 = add nsw i32 %18, 2
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ doStuffWithValueImpl(int);
void doStuffWithValue(int value) { doStuffWithValueImpl(value); }


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

x86 assembly (clang, -O2):
<doStuffWithValue>:
jmp    1030 <doStuffWithValueImpl@plt>

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

LLVM IR (-O2):
define void @doStuffWithValue(i32 %0) {
%2 = tail call i32 @doStuffWithValueImpl(i32 %0)
ret void
}
void send_back_files(cm_sysfile, cm_revision_file) char *cm_sysfile;
char *cm_revision_file;
{
  char buf[1024];
  sprintf(buf, "sf=%s;vf=%s;", cm_sysfile, cm_revision_file);
  error("%%%%stat;%s\n", buf);
}


x86 assembly (clang, -O0):
<send_back_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_back_files>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <error@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"sf=%s;vf=%s;\00"
@.str.1 = [13 x i8] c"%%%%stat;%s\0A\00"
define void @send_back_files(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"sf=%s;vf=%s;\00"
@.str.1 = [13 x i8] c"%%%%stat;%s\0A\00"
define void @send_back_files(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int debug_display_pt_at(int);
int debug_display_pt_pid(int pid) {
  int ptbr_addr = 29696 + pid * 10 * 2;
  return debug_display_pt_at(ptbr_addr);
}


x86 assembly (clang, -O0):
<debug_display_pt_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x7400,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <debug_display_pt_at@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_display_pt_pid>:
lea    (%rdi,%rdi,4),%eax
lea    0x7400(,%rax,4),%edi
jmp    1030 <debug_display_pt_at@plt>

LLVM IR (-O0):
define i32 @debug_display_pt_pid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 10
%6 = mul nsw i32 %5, 2
%7 = add nsw i32 29696, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @debug_display_pt_at(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @debug_display_pt_pid(i32 %0) {
%2 = mul i32 %0, 20
%3 = add nsw i32 %2, 29696
%4 = tail call i32 @debug_display_pt_at(i32 %3)
ret i32 %4
}
/* Type definitions */
struct target_ops {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tcomplain();
void tdefault_load(struct target_ops *self, const char *arg1, int arg2) {
  tcomplain();
}


x86 assembly (clang, -O0):
<tdefault_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <tcomplain@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.target_ops = type { i32 }
define void @tdefault_load(%struct.target_ops* %0, i8* %1, i32 %2) {
%4 = alloca %struct.target_ops*
%5 = alloca i8*
%6 = alloca i32
store %struct.target_ops* %0, %struct.target_ops** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (...) @tcomplain()
ret void
}

LLVM IR (-O2):
%struct.target_ops = type { i32 }
define void @tdefault_load(%struct.target_ops* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (...) @tcomplain()
ret void
}
void setup_olpc_ofw_pgd(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_olpc_ofw_pgd() {
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int getRndNum(int nmbOfTurnouts) {
  srand(time(NULL));
  int rand_nbr = (rand() % nmbOfTurnouts);
  return rand_nbr;
}


x86 assembly (clang, -O0):
<getRndNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRndNum>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getRndNum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @rand()
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @getRndNum(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_compression_mode_pg(struct list_head *, int);
uint8_t set_9840_comp(struct list_head *m, int lvl) {
  ;
  return set_compression_mode_pg(m, lvl);
}


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

x86 assembly (clang, -O2):
<set_9840_comp>:
jmp    1030 <set_compression_mode_pg@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @set_9840_comp(%struct.list_head* %0, i32 %1) {
%3 = tail call i32 @set_compression_mode_pg(%struct.list_head* %0, i32 %1)
ret i32 %3
}
void HalfFloat1Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @HalfFloat1Row_NEON() {
ret void
}
void glMapBufferRange(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glMapBufferRange() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hidecon_end();
void oshide_finish(void) { hidecon_end(); }


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

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

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

LLVM IR (-O2):
define void @oshide_finish() {
%1 = tail call i32 (...) @hidecon_end()
ret void
}
long get_offset(int itr, int count) {
  int offset = 18 * 9;
  int n = 1;
  while (itr) {
    itr /= 10;
    n++;
  }
  return (n + offset * (count + 1)) * sizeof(char);
}


x86 assembly (clang, -O0):
<get_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xa2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <get_offset+0x3e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1118 <get_offset+0x18>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
cltq
shl    $0x0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_offset>:
mov    $0x1,%eax
test   %edi,%edi
je     1132 <get_offset+0x32>
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <get_offset+0x10>
imul   $0xa2,%esi,%ecx
add    %ecx,%eax
add    $0xa2,%eax
cltq
ret

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

LLVM IR (-O2):
define i64 @get_offset(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ 1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add i32 %6, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ 1, %2 ], [ %8, %4 ]
%13 = mul i32 %1, 162
%14 = add i32 %13, 162
%15 = add nsw i32 %14, %12
%16 = sext i32 %15 to i64
ret i64 %16
}
int gcd(int a, int b) {
  if (a > b)
    return gcd(b, a);
  if (b % a == 0)
    return a;
  return gcd(b % a, a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113d <gcd+0x2d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    116c <gcd+0x5c>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1158 <gcd+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <gcd+0x5c>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%eax
mov    %edx,%esi
mov    %eax,%edx
cmp    %eax,%esi
jg     1110 <gcd+0x10>
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @gcd(i32 %10, i32 %11)
store i32 %12, i32* %3
br label %26
13: ; preds = %2
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = load i32, i32* %4
store i32 %19, i32* %3
br label %26
20: ; preds = %13
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
%24 = load i32, i32* %4
%25 = call i32 @gcd(i32 %23, i32 %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %20, %18, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %0, %2 ], [ %8, %7 ]
%5 = phi i32 [ %1, %2 ], [ %4, %7 ]
%6 = icmp sgt i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3, %9
%8 = phi i32 [ %5, %3 ], [ %10, %9 ]
br label %3
9: ; preds = %3
%10 = srem i32 %5, %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %9
ret i32 %4
}
void fc31(int n) {
  {
    typedef int(*b)[n];
    goto a;
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc31(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
br label %20
5: ; No predecessors!
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %5, %1
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc31(i32 %0) {
ret void
}
unsigned int inportl(unsigned short __port) {
  unsigned int __val;
  __asm__ volatile("inl %1,%0" : "=a"(__val) : "dN"(__port));
  return __val;
}


x86 assembly (clang, -O0):
<inportl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @inportl(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl $1,$0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ realloc(char *, scalar_t__);
int /*<<< orphan*/ strcat(char *, char const *);
scalar_t__ strlen(char const *);
void concat(char **s1, const char *s2) {
  if (s2) {
    *s1 = (char *)realloc(*s1, strlen(*s1) + strlen(s2) + 1 + 1);
    strcat(*s1, s2);
  }
}


x86 assembly (clang, -O0):
<concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a1 <concat+0x71>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdi
add    %rax,%rsi
add    $0x1,%rsi
add    $0x1,%rsi
call   1040 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concat>:
test   %rsi,%rsi
je     1182 <concat+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    (%r12,%rax,1),%rsi
add    $0x2,%rsi
mov    %r15,%rdi
call   1040 <realloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <strcat@plt>
ret

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

LLVM IR (-O2):
define void @concat(i8** nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = load i8*, i8** %0
%6 = tail call i64 @strlen(i8* dereferenceable(1) %5)
%7 = tail call i64 @strlen(i8* %1)
%8 = add i64 %6, 2
%9 = add i64 %8, %7
%10 = tail call i64 @realloc(i8* %5, i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %0
%12 = tail call i32 @strcat(i8* %11, i8* %1)
br label %13
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
ge() { call("ccge"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"ccge\00"
define i32 @ge() {
%1 = alloca i32
%2 = call i32 @call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccge\00"
define i32 @ge() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void kprint(char *string) {
  int color = 0x07;
  volatile char *video = (volatile char *)0xB8000;
  while (*string != 0) {
    *video = *string;
    string++;
    video++;
    *video = color;
    video++;
  }
}


x86 assembly (clang, -O0):
<kprint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1168 <kprint+0x68>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <kprint+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kprint>:
mov    (%rdi),%al
test   %al,%al
je     112c <kprint+0x2c>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,0xb8000(%rcx,%rcx,1)
movb   $0x7,0xb8001(%rcx,%rcx,1)
07
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <kprint+0x10>
ret

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

LLVM IR (-O2):
define void @kprint(i8* nocapture %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 ], [ inttoptr (i64 753664 to i8*), %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
store volatile i8 %5, i8* %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = getelementptr inbounds i8, i8* %6, i64 1
store volatile i8 7, i8* %9
%10 = getelementptr inbounds i8, i8* %6, i64 2
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port14__clear();
void Msp430InterruptC__0__HplInterrupt__clear(void) {
  HplMsp430InterruptP__Port14__clear();
}


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

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

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

LLVM IR (-O2):
define void @Msp430InterruptC__0__HplInterrupt__clear() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port14__clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ funkcja(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int iloraz, reszta, l1, l2;
  scanf("%d %d", &l1, &l2);
  funkcja(l1, l2, &iloraz, &reszta);
  printf("Iloraz: %d\nReszta: %d\n", iloraz, reszta);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <funkcja@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <funkcja@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [23 x i8] c"Iloraz: %d\0AReszta: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @funkcja(i32 %6, i32 %7, i32* %1, i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [23 x i8] c"Iloraz: %d\0AReszta: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @funkcja(i32 %10, i32 %11, i32* %1, i32* %2)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(char **p, char **q) { return strcmp(*p, *q); }


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(i8** %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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcmp(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
void TIM1_BRK_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM1_BRK_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_exception_1111();
void m68k_op_1111(void) { m68ki_exception_1111(); }


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

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

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

LLVM IR (-O2):
define void @m68k_op_1111() {
%1 = tail call i32 (...) @m68ki_exception_1111()
ret void
}
void eglGetDisplay(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ copro_pdp11_read8(int /*<<< orphan*/);
uint32_t dbg_memread(uint32_t addr) { return copro_pdp11_read8(addr); }


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

x86 assembly (clang, -O2):
<dbg_memread>:
jmp    1030 <copro_pdp11_read8@plt>

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

LLVM IR (-O2):
define i32 @dbg_memread(i32 %0) {
%2 = tail call i32 @copro_pdp11_read8(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ left_shift32();
int main() {
  left_shift32();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <left_shift32@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @left_shift32()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ update_z_conf(float, float);
void vff_update_z_conf(float z_meas, float conf) {
  update_z_conf(z_meas, conf);
}


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

x86 assembly (clang, -O2):
<vff_update_z_conf>:
jmp    1030 <update_z_conf@plt>

LLVM IR (-O0):
define void @vff_update_z_conf(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 @update_z_conf(float %5, float %6)
ret void
}

LLVM IR (-O2):
define void @vff_update_z_conf(float %0, float %1) {
%3 = tail call i32 @update_z_conf(float %0, float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inb(int);
void fw_cfg_skip(int len) {
  while (len--)
    inb(0x511);
}


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

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

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

LLVM IR (-O2):
define void @fw_cfg_skip(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @inb(i32 1297)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void initialize(int *sum, int *low, int *high) {
  *sum = 0;
  *low = -1;
  *high = -1;
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
movl   $0x0,(%rdi)
movl   $0xffffffff,(%rsi)
movl   $0xffffffff,(%rdx)
ret

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

LLVM IR (-O2):
define void @initialize(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 -1, i32* %1
store i32 -1, i32* %2
ret void
}
int securestore_key_init(char *seed, int len) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @securestore_key_init(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}