xunge/DecIR huggingface dataset:
int test(int x) {
  int z = (x == 42);
  if (z) {
    return 4;
  } else {
    return 5;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112c <test+0x2c>
movl   $0x4,-0x4(%rbp)
jmp    1133 <test+0x33>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = icmp eq i32 %0, 42
%3 = select i1 %2, i32 4, i32 5
ret i32 %3
}
int test_imm_30int8_mem(signed char *val) {
  return ((*val) & (0x30 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_30int8_mem(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 = and i32 %5, 48
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_30int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 48
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void finalize_lowPANcompression() {}


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

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

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

LLVM IR (-O2):
define void @finalize_lowPANcompression() {
ret void
}
/* Variables and functions */
uintptr_t maxuptr(uintptr_t a, uintptr_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<maxuptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <maxuptr+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <maxuptr+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxuptr>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @maxuptr(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
char *strdup(char *);
char *strrchr(char *, char);
char *xbasename(char *str) {
  char *p;
  p = strrchr(str, '/');
  if (!p) {
    p = str;
  }
  return (strdup(p));
}


x86 assembly (clang, -O0):
<xbasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <xbasename+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
cmovne %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
define i8* @xbasename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = call i8* @strdup(i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @xbasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* %0, i8* %2
%5 = tail call i8* @strdup(i8* %4)
ret i8* %5
}
long fac(long x) {
  long t = 1l;
  while (x > 1l)
    t *= x--;
  return (t);
}


x86 assembly (clang, -O0):
<fac>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x1,-0x8(%rbp)
jle    1138 <fac+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fac+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fac>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1121 <fac+0x21>
mov    $0x1,%eax
imul   %rdi,%rax
lea    -0x1(%rdi),%rcx
cmp    $0x2,%rdi
mov    %rcx,%rdi
ja     1110 <fac+0x10>
ret

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

LLVM IR (-O2):
define i64 @fac(i64 %0) {
%2 = icmp sgt i64 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = add nsw i64 %5, -1
%7 = mul nsw i64 %4, %5
%8 = icmp ugt i64 %5, 2
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ ansi_move_cursor(int, int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void move_cursor(int row, int col) {
  ansi_move_cursor(row, col);
  if (!0)
    fflush(stdout);
}


x86 assembly (clang, -O0):
<move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ansi_move_cursor@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_cursor>:
push   %rax
call   1030 <ansi_move_cursor@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @move_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @ansi_move_cursor(i32 %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @ansi_move_cursor(i32 %0, i32 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nibble_sort_word(unsigned long *);
void nibble_sort_jarkko(unsigned long *buf) {
  unsigned long *b = buf;
  for (int i = 0; i < 1024; i++) {
    nibble_sort_word(&b[i]);
  }
}


x86 assembly (clang, -O0):
<nibble_sort_jarkko>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    115a <nibble_sort_jarkko+0x4a>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <nibble_sort_word@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <nibble_sort_jarkko+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_sort_jarkko>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%rdi
call   1030 <nibble_sort_word@plt>
add    $0x8,%rbx
cmp    $0x2000,%rbx
jne    1120 <nibble_sort_jarkko+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @nibble_sort_jarkko(i64* %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %7, %3 ]
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = tail call i32 @nibble_sort_word(i64* %5)
%7 = add nuw nsw i64 %4, 1
%8 = icmp eq i64 %7, 1024
br i1 %8, label %2, label %3
}
/* Variables and functions */
int /*<<< orphan*/ to_point(int, int /*<<< orphan*/);
int /*<<< orphan*/ turn(int /*<<< orphan*/);
int turn_right() {
  turn(to_point(1, 0));
  return 1;
}


x86 assembly (clang, -O0):
<turn_right>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_right>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <to_point@plt>
mov    %eax,%edi
call   1030 <turn@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @turn_right() {
%1 = call i32 @to_point(i32 1, i32 0)
%2 = call i32 @turn(i32 %1)
ret i32 1
}

LLVM IR (-O2):
define i32 @turn_right() {
%1 = tail call i32 @to_point(i32 1, i32 0)
%2 = tail call i32 @turn(i32 %1)
ret i32 1
}
main() {
  __attribute__((unused)) int a1 = -1UL;
  __attribute__((unused)) int b1 = ~0UL;
  __attribute__((unused)) unsigned c1 = -1UL;
  __attribute__((unused)) unsigned d1 = ~0UL;
  __attribute__((unused)) long int a2 = -1UL;
  __attribute__((unused)) long int b2 = ~0UL;
  __attribute__((unused)) long unsigned c2 = -1UL;
  __attribute__((unused)) long unsigned d2 = ~0UL;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
movq   $0xffffffffffffffff,-0x28(%rbp)
ff
movq   $0xffffffffffffffff,-0x30(%rbp)
ff
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void brother(int a, int b, int c) {
  if (a)
    abort();
}


x86 assembly (clang, -O0):
<brother>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <brother+0x22>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brother>:
test   %edi,%edi
jne    1115 <brother+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @brother(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
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @brother(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_unban(char *channel, char *mask) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s -b %s", "MODE", channel, mask);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_unban>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeb2(%rip),%rdx
lea    0xeb7(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_unban>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
lea    0xecb(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s %s -b %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_unban(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%11 = call i32 @net_send(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s %s -b %s\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_unban(i8* %0, i8* %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @net_send(i8* %4)
ret void
}
int iminmax(int a, int b, int c) {
  if (a < b)
    a = b;
  if (a > c)
    a = c;
  return a;
}


x86 assembly (clang, -O0):
<iminmax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    111f <iminmax+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1131 <iminmax+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iminmax>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

LLVM IR (-O0):
define i32 @iminmax(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
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
store i32 %11, i32* %4
br label %12
12: ; preds = %10, %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %6
store i32 %17, i32* %4
br label %18
18: ; preds = %16, %12
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @iminmax(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
void wiringPiSetupGpio() {}


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

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

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

LLVM IR (-O2):
define void @wiringPiSetupGpio() {
ret void
}
void gpio_sdhc_active(int module) {}


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

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

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

LLVM IR (-O2):
define void @gpio_sdhc_active(i32 %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ isHexDigit(int);
int readChar(void) {
  int c = getchar();
  while (c != EOF && !isHexDigit(c)) {
    c = getchar();
  }
  return c;
}


x86 assembly (clang, -O0):
<readChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2eaa(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     115c <readChar+0x3c>
mov    -0x4(%rbp),%edi
call   1030 <isHexDigit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    116c <readChar+0x4c>
jmp    117b <readChar+0x5b>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    1132 <readChar+0x12>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1159 <readChar+0x39>
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <isHexDigit@plt>
test   %eax,%eax
jne    1159 <readChar+0x39>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
jne    1140 <readChar+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @readChar() {
%1 = alloca i32
%2 = call i32 (...) @getchar()
store i32 %2, i32* %1
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* %1
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i32, i32* %1
%9 = call i32 @isHexDigit(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %7, %3
%13 = phi i1 [ false, %3 ], [ %11, %7 ]
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = call i32 (...) @getchar()
store i32 %15, i32* %1
br label %3
16: ; preds = %12
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @readChar() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %12, label %4
4: ; preds = %0, %8
%5 = phi i32 [ %9, %8 ], [ %1, %0 ]
%6 = tail call i32 @isHexDigit(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %4
12: ; preds = %4, %8, %0
%13 = phi i32 [ %1, %0 ], [ %9, %8 ], [ %5, %4 ]
ret i32 %13
}
void test_fixit_insert(void) {}


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

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

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

LLVM IR (-O2):
define void @test_fixit_insert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ puts(char *);
prompt() {
  puts("hit any key to continue");
  getchar();
}


x86 assembly (clang, -O0):
<prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"hit any key to continue\00"
define i32 @prompt() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [24 x i8] c"hit any key to continue\00"
define i32 @prompt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void movsx_reg32_m16(int reg32, unsigned short *m16) {
  put8(0x0F);
  put8(0xBF);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m16));
}


x86 assembly (clang, -O0):
<movsx_reg32_m16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsx_reg32_m16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0xbf,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @movsx_reg32_m16(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i16*
store i32 %0, i32* %3
store i16* %1, i16** %4
%5 = call i32 @put8(i32 15)
%6 = call i32 @put8(i32 191)
%7 = load i32, i32* %3
%8 = shl i32 %7, 3
%9 = or i32 %8, 5
%10 = call i32 @put8(i32 %9)
%11 = load i16*, i16** %4
%12 = ptrtoint i16* %11 to i32
%13 = call i32 @put32(i32 %12)
ret void
}

LLVM IR (-O2):
define void @movsx_reg32_m16(i32 %0, i16* %1) {
%3 = tail call i32 @put8(i32 15)
%4 = tail call i32 @put8(i32 191)
%5 = shl i32 %0, 3
%6 = or i32 %5, 5
%7 = tail call i32 @put8(i32 %6)
%8 = ptrtoint i16* %1 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @put32(i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef void *uint32_t;

/* Variables and functions */
void *bswap_32(void *);
uint64_t __attribute__((const)) bswap_64(uint64_t x) {
  union {
    uint64_t ll;
    uint32_t l[2];
  } w, r;
  w.ll = x;
  r.l[0] = bswap_32(w.l[1]);
  r.l[1] = bswap_32(w.l[0]);
  return r.ll;
}


x86 assembly (clang, -O0):
<bswap_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <bswap_32@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <bswap_32@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_64>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
call   1030 <bswap_32@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <bswap_32@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.anon = type { [2 x i8*] }
define i32 @bswap_64(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca %union.anon
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to [2 x i8*]*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 1
%9 = load i8*, i8** %8
%10 = call i8* @bswap_32(i8* %9)
%11 = bitcast %union.anon* %4 to [2 x i8*]*
%12 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 0
store i8* %10, i8** %12
%13 = bitcast %union.anon* %3 to [2 x i8*]*
%14 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 0
%15 = load i8*, i8** %14
%16 = call i8* @bswap_32(i8* %15)
%17 = bitcast %union.anon* %4 to [2 x i8*]*
%18 = getelementptr inbounds [2 x i8*], [2 x i8*]* %17, i64 0, i64 1
store i8* %16, i8** %18
%19 = bitcast %union.anon* %4 to i32*
%20 = load i32, i32* %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @bswap_64(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i8* @bswap_32(i8* undef)
%5 = tail call i8* @bswap_32(i8* %3)
%6 = ptrtoint i8* %4 to i64
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cd_last_track();
int /*<<< orphan*/ cd_present();
long raw_track_length(int /*<<< orphan*/);
unsigned long cd_disc_length_frames(void) {
  long frames = raw_track_length(cd_last_track());
  if (!cd_present())
    return 0;
  return frames;
}


x86 assembly (clang, -O0):
<cd_disc_length_frames>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <cd_last_track@plt>
mov    %eax,%edi
call   1030 <raw_track_length@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <cd_present@plt>
cmp    $0x0,%eax
jne    1167 <cd_disc_length_frames+0x37>
movq   $0x0,-0x8(%rbp)
jmp    116f <cd_disc_length_frames+0x3f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_disc_length_frames>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <cd_last_track@plt>
mov    %eax,%edi
call   1030 <raw_track_length@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <cd_present@plt>
test   %eax,%eax
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @cd_disc_length_frames() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @cd_last_track()
%4 = call i64 @raw_track_length(i32 %3)
store i64 %4, i64* %2
%5 = call i32 (...) @cd_present()
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
store i64 0, i64* %1
br label %10
8: ; preds = %0
%9 = load i64, i64* %2
store i64 %9, i64* %1
br label %10
10: ; preds = %8, %7
%11 = load i64, i64* %1
ret i64 %11
}

LLVM IR (-O2):
define i64 @cd_disc_length_frames() {
%1 = tail call i32 (...) @cd_last_track()
%2 = tail call i64 @raw_track_length(i32 %1)
%3 = tail call i32 (...) @cd_present()
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i64 0, i64 %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%lld\n", 0 ? 1LL : 2);
  printf("%lld\n", 1 ? 1 : 2LL);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
void _siwiStubsImplementation(void) {}


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

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

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

LLVM IR (-O2):
define void @_siwiStubsImplementation() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fd_lis3dh_read_fifo();
void fd_hal_accelerometer_read_fifo(void) { fd_lis3dh_read_fifo(); }


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

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

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

LLVM IR (-O2):
define void @fd_hal_accelerometer_read_fifo() {
%1 = tail call i32 (...) @fd_lis3dh_read_fifo()
ret void
}
void cpu_sti() { __asm__ __volatile__("sti"); }


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

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

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

LLVM IR (-O2):
define void @cpu_sti() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage() {
  printf("\nUsage:\n   %s\n\n",
         "resample"
         "  [\n"
         "                -square <pixsiz> | \n"
         "                -scale <scale factor> | \n"
         "                -size <width/height> | \n"
         "                -scalex <x scale factor> -scaley <y scale factor> |\n"
         "                <x pixel size> <y pixel size> \n"
         "             ]\n"
         "             [ -nearest_neighbor | -logical_or ]\n"
         "             <infile> <outfile>\n"
         "             [-license] [-version] [-help]");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [383 x i8] c"resample [\0A -square <pixsiz> | \0A -scale <scale factor> | \0A -size <width/height> | \0A -scalex <x scale factor> -scaley <y scale factor> |\0A <x pixel size> <y pixel size> \0A ]\0A [ -nearest_neighbor | -logical_or ]\0A <infile> <outfile>\0A [-license] [-version] [-help]\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([383 x i8], [383 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [383 x i8] c"resample [\0A -square <pixsiz> | \0A -scale <scale factor> | \0A -size <width/height> | \0A -scalex <x scale factor> -scaley <y scale factor> |\0A <x pixel size> <y pixel size> \0A ]\0A [ -nearest_neighbor | -logical_or ]\0A <infile> <outfile>\0A [-license] [-version] [-help]\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([383 x i8], [383 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void U422ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @U422ToABGR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_attribute_lookup();
int /*<<< orphan*/ clean_model_lookup();
int /*<<< orphan*/ clean_primitive_lookup();
int /*<<< orphan*/ clean_set_lookup();
int /*<<< orphan*/ clean_sl_lookup();
void sv_clear_input_tables() {
  clean_attribute_lookup();
  clean_model_lookup();
  clean_sl_lookup();
  clean_primitive_lookup();
  clean_set_lookup();
}


x86 assembly (clang, -O0):
<sv_clear_input_tables>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clean_attribute_lookup@plt>
mov    $0x0,%al
call   1070 <clean_model_lookup@plt>
mov    $0x0,%al
call   1060 <clean_sl_lookup@plt>
mov    $0x0,%al
call   1050 <clean_primitive_lookup@plt>
mov    $0x0,%al
call   1040 <clean_set_lookup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sv_clear_input_tables>:
push   %rax
xor    %eax,%eax
call   1030 <clean_attribute_lookup@plt>
xor    %eax,%eax
call   1070 <clean_model_lookup@plt>
xor    %eax,%eax
call   1060 <clean_sl_lookup@plt>
xor    %eax,%eax
call   1050 <clean_primitive_lookup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clean_set_lookup@plt>

LLVM IR (-O0):
define void @sv_clear_input_tables() {
%1 = call i32 (...) @clean_attribute_lookup()
%2 = call i32 (...) @clean_model_lookup()
%3 = call i32 (...) @clean_sl_lookup()
%4 = call i32 (...) @clean_primitive_lookup()
%5 = call i32 (...) @clean_set_lookup()
ret void
}

LLVM IR (-O2):
define void @sv_clear_input_tables() {
%1 = tail call i32 (...) @clean_attribute_lookup()
%2 = tail call i32 (...) @clean_model_lookup()
%3 = tail call i32 (...) @clean_sl_lookup()
%4 = tail call i32 (...) @clean_primitive_lookup()
%5 = tail call i32 (...) @clean_set_lookup()
ret void
}
/* Variables and functions */
int foo(int, int);
__attribute__((always_)) int bar(int a, int b) {
  int c = a + b;
  c = foo(c, a * b);
  return c;
}


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

x86 assembly (clang, -O2):
<bar>:
lea    (%rsi,%rdi,1),%eax
imul   %edi,%esi
mov    %eax,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = call i32 @foo(i32 %9, i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = mul nsw i32 %1, %0
%5 = tail call i32 @foo(i32 %3, i32 %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat64(const char *file, mode_t mode) {
  return open(file, O_WRONLY | O_CREAT | O_TRUNC | 0, mode);
}


x86 assembly (clang, -O0):
<creat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ec5(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
or     $0x0,%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat64>:
mov    0x2eb1(%rip),%rcx
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @creat64(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 i32, i32* @O_WRONLY
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = or i32 %10, 0
%12 = load i32, i32* %4
%13 = call i32 @open(i8* %5, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @creat64(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ utf8_get_char(char const *, char const **);
const char *utf8_move_forward(const char *str, int nr) {
  int i = 0;
  const char *next = str;
  for (i = 0; i < nr; i++) {
    utf8_get_char(next, &next);
  }
  return next;
}


x86 assembly (clang, -O0):
<utf8_move_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <utf8_move_forward+0x4c>
mov    -0x18(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <utf8_get_char@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <utf8_move_forward+0x25>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_move_forward>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
test   %esi,%esi
jle    1141 <utf8_move_forward+0x31>
mov    %esi,%ebx
mov    %rsp,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rsi
call   1030 <utf8_get_char@plt>
mov    (%rsp),%rdi
add    $0xffffffff,%ebx
jne    1130 <utf8_move_forward+0x20>
mov    %rdi,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @utf8_move_forward(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* %0, i8** %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %13
6: ; preds = %2, %6
%7 = phi i8* [ %12, %6 ], [ %0, %2 ]
%8 = phi i32 [ %10, %6 ], [ 0, %2 ]
%9 = call i32 @utf8_get_char(i8* %7, i8** %3)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %1
%12 = load i8*, i8** %3
br i1 %11, label %13, label %6
13: ; preds = %6, %2
%14 = phi i8* [ %0, %2 ], [ %12, %6 ]
ret i8* %14
}
void RTLogDefaultInit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogDefaultInit() {
ret void
}
int max_path_length() { return 1024; }


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

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

LLVM IR (-O0):
define i32 @max_path_length() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @max_path_length() {
ret i32 1024
}
/* Variables and functions */
void *malloc(long);
void *PaUtil_AllocateMemory(long size) {
  void *result = malloc(size);
  return result;
}


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

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

LLVM IR (-O0):
define i8* @PaUtil_AllocateMemory(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @PaUtil_AllocateMemory(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ pageIndexToMemory(int);
void copyBlocks(int destIndex, int originIndex, int cantPages) {
  memcpy(pageIndexToMemory(destIndex), pageIndexToMemory(originIndex),
         cantPages * 4 * 1024);
}


x86 assembly (clang, -O0):
<copyBlocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pageIndexToMemory@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <pageIndexToMemory@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
shl    $0x2,%edx
shl    $0xa,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyBlocks>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <pageIndexToMemory@plt>
mov    %eax,%r14d
mov    %ebp,%edi
call   1030 <pageIndexToMemory@plt>
shl    $0xc,%ebx
mov    %r14d,%edi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @copyBlocks(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
%8 = call i32 @pageIndexToMemory(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @pageIndexToMemory(i32 %9)
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, 4
%13 = mul nsw i32 %12, 1024
%14 = call i32 @memcpy(i32 %8, i32 %10, i32 %13)
ret void
}

LLVM IR (-O2):
define void @copyBlocks(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pageIndexToMemory(i32 %0)
%5 = tail call i32 @pageIndexToMemory(i32 %1)
%6 = shl nsw i32 %2, 12
%7 = tail call i32 @memcpy(i32 %4, i32 %5, i32 %6)
ret void
}
/* Variables and functions */
bool nrf52_errata_194(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_194() {
ret i32 0
}
/* Variables and functions */
double parse(char *);
double domain(char *to, char *from) {
  int i;
  double f = 1.0;
  char done = 0;
  if (*to != ' ')
    f *= parse(to);
  f /= parse(from);
  return f;
}


x86 assembly (clang, -O0):
<domain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movb   $0x0,-0x21(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1154 <domain+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <parse@plt>
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <parse@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<domain>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
cmpb   $0x20,(%rdi)
jne    1127 <domain+0x17>
movsd  0xedb(%rip),%xmm0
jmp    112c <domain+0x1c>
call   1030 <parse@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <parse@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @domain(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double
%7 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
store double 1.000000e+00, double* %6
store i8 0, i8* %7
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 32
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call double @parse(i8* %13)
%15 = load double, double* %6
%16 = fmul double %15, %14
store double %16, double* %6
br label %17
17: ; preds = %12, %2
%18 = load i8*, i8** %4
%19 = call double @parse(i8* %18)
%20 = load double, double* %6
%21 = fdiv double %20, %19
store double %21, double* %6
%22 = load double, double* %6
ret double %22
}

LLVM IR (-O2):
define double @domain(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 32
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call double @parse(i8* %0)
br label %7
7: ; preds = %5, %2
%8 = phi double [ %6, %5 ], [ 1.000000e+00, %2 ]
%9 = tail call double @parse(i8* %1)
%10 = fdiv double %8, %9
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glVertex3sv(int /*<<< orphan*/ *);
void Vertex3sv(GLshort v[3]) { glVertex3sv(v); }


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

x86 assembly (clang, -O2):
<Vertex3sv>:
jmp    1030 <glVertex3sv@plt>

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

LLVM IR (-O2):
define void @Vertex3sv(i32* %0) {
%2 = tail call i32 @glVertex3sv(i32* %0)
ret void
}
void cacheex_load_config_file(void) {}


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

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

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

LLVM IR (-O2):
define void @cacheex_load_config_file() {
ret void
}
int chmatch(char c, char *chars) {
  for (; *chars; chars++)
    if (c == *chars)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<chmatch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <chmatch+0x50>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113a <chmatch+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1157 <chmatch+0x57>
jmp    113f <chmatch+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <chmatch+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmatch>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <chmatch+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <chmatch+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <chmatch+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @chmatch(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i8 %9, %0
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}