xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d %d %d", num / 3 - 1, num / 3, num / 3 + 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
lea    (%rax,%rcx,1),%edx
lea    (%rax,%rcx,1),%esi
add    $0xffffffff,%esi
add    %eax,%ecx
add    $0x1,%ecx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 3
%6 = add nsw i32 %5, -1
%7 = add nsw i32 %5, 1
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
char *frob();
int /*<<< orphan*/ oof();
void test(int code) {
  char *temp = frob();
  int rotate = (code == 22);
  if (temp == 0 && !rotate)
    oof();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <frob@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x16,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <test+0x41>
cmpl   $0x0,-0x14(%rbp)
jne    1161 <test+0x41>
mov    $0x0,%al
call   1030 <oof@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <frob@plt>
cmp    $0x16,%ebx
je     113c <test+0x1c>
test   %rax,%rax
jne    113c <test+0x1c>
xor    %eax,%eax
pop    %rbx
jmp    1030 <oof@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @test(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i8* (...) @frob()
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 22
%8 = zext i1 %7 to i32
store i32 %8, i32* %4
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i32 (...) @oof()
br label %16
16: ; preds = %14, %11, %1
ret void
}

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = tail call i8* (...) @frob()
%3 = icmp eq i32 %0, 22
%4 = icmp ne i8* %2, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (...) @oof()
br label %8
8: ; preds = %6, %1
ret void
}
int kernels_eternal(void) {
#pragma acc kernels
  {
    while (1)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<kernels_eternal>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <kernels_eternal+0x9>
jmp    1109 <kernels_eternal+0x9>

x86 assembly (clang, -O2):
<kernels_eternal>:
jmp    1100 <kernels_eternal>

LLVM IR (-O0):
define i32 @kernels_eternal() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i32 @kernels_eternal() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int init(void) {
  do {
    if (3 >= 2) {
      fprintf(stderr, "Command-line file requester selected.\n");
    }
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <init+0x9>
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Command-line file requester selected.\0A\00"
define i32 @init() {
br label %1
1: ; preds = %0
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Command-line file requester selected.\0A\00"
define i32 @init() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xb0() {
  Assert_real((islower(176) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              885, ("islower should be 0 for 0xb0"));
}


x86 assembly (clang, -O0):
<t_islower_0xb0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x375,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xb0>:
push   %rax
mov    $0xb0,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x375,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb0\00"
define void @t_islower_0xb0() {
%1 = call i64 @islower(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xb0\00"
define void @t_islower_0xb0() {
%1 = tail call i64 @islower(i32 176)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 885, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn95() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn95");
  return result;
}


x86 assembly (clang, -O0):
<fn95>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn95>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn95\00"
define i8* @fn95() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn95\00"
define i8* @fn95() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
void regerror(txt) char *txt;
{ msg("RE error: %s", txt); }


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

x86 assembly (clang, -O2):
<regerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <msg@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"RE error: %s\00"
define void @regerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @msg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"RE error: %s\00"
define void @regerror(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @msg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ really(char *);
int main(void) {
  char *p = malloc(10);
  really(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <really@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <really@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @really(i8* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @really(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bottom();
int main() {
loop:
  bottom();
  goto loop;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bottom@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <bottom@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @bottom()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @bottom()
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m119SetChrRAMBankPtr();
int /*<<< orphan*/ mmc3setParams8000(int /*<<< orphan*/, int /*<<< orphan*/);
void m119setParams8000(uint16_t addr, uint8_t val) {
  mmc3setParams8000(addr, val);
  m119SetChrRAMBankPtr();
}


x86 assembly (clang, -O0):
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   1040 <mmc3setParams8000@plt>
mov    $0x0,%al
call   1030 <m119SetChrRAMBankPtr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
call   1040 <mmc3setParams8000@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <m119SetChrRAMBankPtr@plt>

LLVM IR (-O0):
define void @m119setParams8000(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 @mmc3setParams8000(i32 %5, i32 %6)
%8 = call i32 (...) @m119SetChrRAMBankPtr()
ret void
}

LLVM IR (-O2):
define void @m119setParams8000(i32 %0, i32 %1) {
%3 = tail call i32 @mmc3setParams8000(i32 %0, i32 %1)
%4 = tail call i32 (...) @m119SetChrRAMBankPtr()
ret void
}
int signum(int n) { return (n > 0) - (n < 0); }


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
sar    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @signum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @signum(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = ashr i32 %0, 31
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl_fd(char const *s, int fd) {
  if (s)
    write(fd, s, ft_strlen(s));
  else
    write(fd, "(null)", 4);
  write(fd, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <ft_putendl_fd+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
jmp    1178 <ft_putendl_fd+0x58>
mov    -0xc(%rbp),%edi
lea    0xe92(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
lea    0xe85(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %rdi,%rdi
je     113b <ft_putendl_fd+0x1b>
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
jmp    1149 <ft_putendl_fd+0x29>
lea    0xebe(%rip),%rsi
mov    %ebp,%edi
mov    $0x4,%edx
call   1030 <write@plt>
lea    0xeb2(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @ft_strlen(i8* %10)
%12 = call i32 @write(i32 %8, i8* %9, i32 %11)
br label %16
13: ; preds = %2
%14 = load i32, i32* %4
%15 = call i32 @write(i32 %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4)
br label %16
16: ; preds = %13, %7
%17 = load i32, i32* %4
%18 = call i32 @write(i32 %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @ft_strlen(i8* %0)
%6 = tail call i32 @write(i32 %1, i8* %0, i32 %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4)
br label %9
9: ; preds = %7, %4
%10 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
const char *db_create_entities_table_sql(void) {
  static const char *query =
      "CREATE TABLE entities ("
      "    id         INTEGER         NOT NULL AUTO_INCREMENT,"
      "    name       VARCHAR(100)    NOT NULL,"
      "    shortname  VARCHAR(10)     NOT NULL,"
      "    currency   CHAR(30)        NOT NULL DEFAULT 'USD',"
      "    parent     INT             NOT NULL,"
      "    aggregate  BOOLEAN         NOT NULL DEFAULT FALSE,"
      "    enabled    BOOLEAN         NOT NULL DEFAULT TRUE,"
      "  CONSTRAINT entities_pk"
      "    PRIMARY KEY (id),"
      "  CONSTRAINT entities_parent_fk"
      "    FOREIGN KEY (parent)"
      "    REFERENCES entities(id)"
      ");";
  return query;
}


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

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

LLVM IR (-O0):
@db_create_entities_table_sql.query = internal global i8* getelementptr inbounds ([489 x i8], [489 x i8]* @.str, i32 0, i32 0)
@.str = [489 x i8] c"CREATE TABLE entities ( id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, shortname VARCHAR(10) NOT NULL, currency CHAR(30) NOT NULL DEFAULT 'USD', parent INT NOT NULL, aggregate BOOLEAN NOT NULL DEFAULT FALSE, enabled BOOLEAN NOT NULL DEFAULT TRUE, CONSTRAINT entities_pk PRIMARY KEY (id), CONSTRAINT entities_parent_fk FOREIGN KEY (parent) REFERENCES entities(id));\00"
define i8* @db_create_entities_table_sql() {
%1 = load i8*, i8** @db_create_entities_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [489 x i8] c"CREATE TABLE entities ( id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, shortname VARCHAR(10) NOT NULL, currency CHAR(30) NOT NULL DEFAULT 'USD', parent INT NOT NULL, aggregate BOOLEAN NOT NULL DEFAULT FALSE, enabled BOOLEAN NOT NULL DEFAULT TRUE, CONSTRAINT entities_pk PRIMARY KEY (id), CONSTRAINT entities_parent_fk FOREIGN KEY (parent) REFERENCES entities(id));\00"
define i8* @db_create_entities_table_sql() {
ret i8* getelementptr inbounds ([489 x i8], [489 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int socket(int, int, int);
int plat_socket(int domain, int type, int protocol) {
  return (socket(domain, type, protocol));
}


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

x86 assembly (clang, -O2):
<plat_socket>:
jmp    1030 <socket@plt>

LLVM IR (-O0):
define i32 @plat_socket(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 = load i32, i32* %6
%10 = call i32 @socket(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @plat_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void uDMAIntRegister(unsigned long ulIntChannel, void (*pfnHandler)(void)) {
  DEBUG_ASSERT(pfnHandler);
  DEBUG_ASSERT((ulIntChannel == 62) || (ulIntChannel == 63));
  IntRegister(ulIntChannel, pfnHandler);
  IntEnable(ulIntChannel);
}


x86 assembly (clang, -O0):
<uDMAIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <DEBUG_ASSERT@plt>
mov    $0x1,%al
cmpq   $0x3e,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1166 <uDMAIntRegister+0x36>
cmpq   $0x3f,-0x8(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1050 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <IntRegister@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1050 <DEBUG_ASSERT@plt>
mov    %rbx,%rax
and    $0xfffffffffffffffe,%rax
xor    %edi,%edi
cmp    $0x3e,%rax
sete   %dil
xor    %eax,%eax
call   1050 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <IntRegister@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @uDMAIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = call i32 (void ()*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (void ()*, ...)*)(void ()* %5)
%7 = load i64, i64* %3
%8 = icmp eq i64 %7, 62
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i64, i64* %3
%11 = icmp eq i64 %10, 63
br label %12
12: ; preds = %9, %2
%13 = phi i1 [ true, %2 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %14)
%16 = load i64, i64* %3
%17 = load void ()*, void ()** %4
%18 = call i32 (i64, void ()*, ...) bitcast (i32 (...)* @IntRegister to i32 (i64, void ()*, ...)*)(i64 %16, void ()* %17)
%19 = load i64, i64* %3
%20 = call i32 (i64, ...) bitcast (i32 (...)* @IntEnable to i32 (i64, ...)*)(i64 %19)
ret void
}

LLVM IR (-O2):
define void @uDMAIntRegister(i64 %0, void ()* %1) {
%3 = tail call i32 (void ()*, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (void ()*, ...)*)(void ()* %1)
%4 = and i64 %0, -2
%5 = icmp eq i64 %4, 62
%6 = zext i1 %5 to i32
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @DEBUG_ASSERT to i32 (i32, ...)*)(i32 %6)
%8 = tail call i32 (i64, void ()*, ...) bitcast (i32 (...)* @IntRegister to i32 (i64, void ()*, ...)*)(i64 %0, void ()* %1)
%9 = tail call i32 (i64, ...) bitcast (i32 (...)* @IntEnable to i32 (i64, ...)*)(i64 %0)
ret void
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_line(char *, char *);
main() {
  int len;
  char newLine[1000];
  char revLine[1000];
  while ((len = get_line(newLine, 1000)) > 0) {
    reverse_line(revLine, newLine);
    printf("%s", revLine);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118a <main+0x5a>
lea    -0x7e0(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1050 <reverse_line@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1187 <main+0x57>
lea    0x3f0(%rsp),%r14
mov    %rsp,%rbx
lea    0xea1(%rip),%r15
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <reverse_line@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
store i32 0, i32* %1
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @get_line(i8* %6, i32 1000)
store i32 %7, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @reverse_line(i8* %10, i8* %11)
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @get_line(i8* %3, i32 1000)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 @reverse_line(i8* %4, i8* %3)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = call i32 @get_line(i8* %3, i32 1000)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
int CentreX(int x, char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CentreX(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ Hash128to64(int /*<<< orphan*/, int /*<<< orphan*/);
uint64_t HashLen16(uint64_t u, uint64_t v) { return Hash128to64(u, v); }


x86 assembly (clang, -O0):
<HashLen16>:
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 <Hash128to64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashLen16>:
jmp    1030 <Hash128to64@plt>

LLVM IR (-O0):
define i32 @HashLen16(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 @Hash128to64(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @HashLen16(i32 %0, i32 %1) {
%3 = tail call i32 @Hash128to64(i32 %0, i32 %1)
ret i32 %3
}
void fd68(int n) {
a : {
  typedef int(*b)[n];
P01A:
  goto P01A;
  {
    typedef int(*c)[n];
  P012A:
    goto P012A;
    0;
  }
P01B:
  goto P01B;
  {
    typedef int(*d)[n];
  p013A:
    goto p013A;
    goto a;
  P013A:
    goto P013A;
    0;
  }
P01C:
  goto P01C;
  ;
  typedef int(*e)[n];
P014A:
  goto P014A;
  0;
};
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd68>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd68+0x7>

x86 assembly (clang, -O2):
<fd68>:
jmp    1100 <fd68>

LLVM IR (-O0):
define void @fd68(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %6, %3
br label %6
7: ; No predecessors!
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %10, %7
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %15, %12
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd68(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int mutlak_deger(int x) {
  int y;
  if (x >= 0)
    y = x;
  else
    y = -1 * x;
  return y;
}


x86 assembly (clang, -O0):
<mutlak_deger>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <mutlak_deger+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <mutlak_deger+0x26>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutlak_deger>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mutlak_deger(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
changeline(l, txt) long l;
char *txt;
{
  deleteline(l);
  addline(l, txt);
}


x86 assembly (clang, -O0):
<changeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <deleteline@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <addline@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeline>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <deleteline@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <addline@plt>

LLVM IR (-O0):
define i32 @changeline(i64 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
%6 = load i64, i64* %4
%7 = call i32 (i64, ...) bitcast (i32 (...)* @deleteline to i32 (i64, ...)*)(i64 %6)
%8 = load i64, i64* %4
%9 = load i8*, i8** %5
%10 = call i32 (i64, i8*, ...) bitcast (i32 (...)* @addline to i32 (i64, i8*, ...)*)(i64 %8, i8* %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @changeline(i64 %0, i8* %1) {
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @deleteline to i32 (i64, ...)*)(i64 %0)
%4 = tail call i32 (i64, i8*, ...) bitcast (i32 (...)* @addline to i32 (i64, i8*, ...)*)(i64 %0, i8* %1)
ret i32 undef
}
/* Variables and functions */
int gpio_get_value(unsigned int);
int /*<<< orphan*/ might_sleep();
int gpio_get_value_cansleep(unsigned gpio) {
  might_sleep();
  return gpio_get_value(gpio);
}


x86 assembly (clang, -O0):
<gpio_get_value_cansleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <might_sleep@plt>
mov    -0x4(%rbp),%edi
call   1030 <gpio_get_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_get_value_cansleep>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <might_sleep@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <gpio_get_value@plt>

LLVM IR (-O0):
define i32 @gpio_get_value_cansleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @might_sleep()
%4 = load i32, i32* %2
%5 = call i32 @gpio_get_value(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @gpio_get_value_cansleep(i32 %0) {
%2 = tail call i32 (...) @might_sleep()
%3 = tail call i32 @gpio_get_value(i32 %0)
ret i32 %3
}
int soma_digitos(int n) {
  if (n == 0) {
    return 0;
  }
  return soma_digitos(n / 10) + n % 10;
}


x86 assembly (clang, -O0):
<soma_digitos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <soma_digitos+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1159 <soma_digitos+0x49>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <soma_digitos@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma_digitos>:
xor    %eax,%eax
test   %edi,%edi
je     113b <soma_digitos+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <soma_digitos+0x10>
ret

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

LLVM IR (-O2):
define i32 @soma_digitos(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = sdiv i32 %4, 10
%7 = srem i32 %4, 10
%8 = add nsw i32 %7, %5
%9 = add i32 %4, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_r8(struct cpu *, int /*<<< orphan*/, unsigned char);
void cpu_xor_flags(struct cpu *cpu, unsigned char a, unsigned char b,
                   unsigned char t) {
  unsigned char z = t ? 0 : ((unsigned char)(0x80));
  unsigned char n = 0;
  unsigned char h = 0;
  unsigned char c = 0;
  cpu_set_r8(cpu, (0), z | n | h | c);
}


x86 assembly (clang, -O0):
<cpu_xor_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%edx
mov    $0x80,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0xc(%rbp)
movb   $0x0,-0xd(%rbp)
movb   $0x0,-0xe(%rbp)
movb   $0x0,-0xf(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
movzbl -0xe(%rbp),%ecx
or     %ecx,%eax
movzbl -0xf(%rbp),%ecx
or     %ecx,%eax
xor    %esi,%esi
movzbl %al,%edx
call   1030 <cpu_set_r8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_xor_flags>:
xor    %edx,%edx
test   %ecx,%ecx
sete   %dl
shl    $0x7,%edx
xor    %esi,%esi
jmp    1030 <cpu_set_r8@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_xor_flags(%struct.cpu* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca %struct.cpu*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store %struct.cpu* %0, %struct.cpu** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%13 = load i8, i8* %8
%14 = zext i8 %13 to i32
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 128
%18 = trunc i32 %17 to i8
store i8 %18, i8* %9
store i8 0, i8* %10
store i8 0, i8* %11
store i8 0, i8* %12
%19 = load %struct.cpu*, %struct.cpu** %5
%20 = load i8, i8* %9
%21 = zext i8 %20 to i32
%22 = load i8, i8* %10
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = load i8, i8* %11
%26 = zext i8 %25 to i32
%27 = or i32 %24, %26
%28 = load i8, i8* %12
%29 = zext i8 %28 to i32
%30 = or i32 %27, %29
%31 = trunc i32 %30 to i8
%32 = call i32 @cpu_set_r8(%struct.cpu* %19, i32 0, i8 zeroext %31)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_xor_flags(%struct.cpu* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = icmp eq i8 %3, 0
%6 = select i1 %5, i8 -128, i8 0
%7 = tail call i32 @cpu_set_r8(%struct.cpu* %0, i32 0, i8 zeroext %6)
ret void
}
void write16bit(data) int data;
{
  eputc((unsigned)((data & 0xff00) >> 8));
  eputc((unsigned)(data & 0xff));
}


x86 assembly (clang, -O0):
<write16bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff00,%edi
sar    $0x8,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <eputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write16bit>:
push   %rbx
mov    %edi,%ebx
movzbl %bh,%edi
xor    %eax,%eax
call   1030 <eputc@plt>
movzbl %bl,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <eputc@plt>

LLVM IR (-O0):
define void @write16bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = ashr i32 %4, 8
%6 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %8)
ret void
}

LLVM IR (-O2):
define void @write16bit(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %3)
%5 = and i32 %0, 255
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @eputc to i32 (i32, ...)*)(i32 %5)
ret void
}
void init_char(char *lo1, char *lo2) {
  int i;
  for (i = 0; i < 5; i++) {
    lo1[i] = 0;
    lo2[i] = 0;
  }
}


x86 assembly (clang, -O0):
<init_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1143 <init_char+0x43>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <init_char+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_char>:
movb   $0x0,(%rdi)
movb   $0x0,(%rsi)
movb   $0x0,0x1(%rdi)
movb   $0x0,0x1(%rsi)
movb   $0x0,0x2(%rdi)
movb   $0x0,0x2(%rsi)
movb   $0x0,0x3(%rdi)
movb   $0x0,0x3(%rsi)
movb   $0x0,0x4(%rdi)
movb   $0x0,0x4(%rsi)
ret

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

LLVM IR (-O2):
define void @init_char(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 0, i8* %0
store i8 0, i8* %1
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %3
%4 = getelementptr inbounds i8, i8* %1, i64 1
store i8 0, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %1, i64 2
store i8 0, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 3
store i8 0, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 4
store i8 0, i8* %9
%10 = getelementptr inbounds i8, i8* %1, i64 4
store i8 0, i8* %10
ret void
}
void foo046() {}


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

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

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

LLVM IR (-O2):
define void @foo046() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void timeval_print(const struct timeval *t) {
  printf("%ld", (long int)t->tv_sec * 1000 + (long int)t->tv_usec / 1000);
}


x86 assembly (clang, -O0):
<timeval_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,0x8(%rax),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
add    %rax,%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_print>:
imul   $0x3e8,0x8(%rdi),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  (%rdi)
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x7,%rdx
add    %rdx,%rsi
add    %rcx,%rsi
lea    0xec3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [4 x i8] c"%ld\00"
define void @timeval_print(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sdiv i64 %9, 1000
%11 = add nsw i64 %6, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %11)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [4 x i8] c"%ld\00"
define void @timeval_print(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sdiv i64 %6, 1000
%8 = add nsw i64 %7, %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %8)
ret void
}
void writeblanks(start, end) char *start;
char *end;
{
  char *p;
  for (p = start; p < end; p++)
    *p = ' ';
}


x86 assembly (clang, -O0):
<writeblanks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    113a <writeblanks+0x3a>
mov    -0x18(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <writeblanks+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeblanks>:
cmp    %rsi,%rdi
jae    112a <writeblanks+0x1a>
push   %rax
mov    %rsi,%rdx
sub    %rdi,%rdx
mov    $0x20,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @writeblanks(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %13, %2
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ult i8* %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8*, i8** %5
store i8 32, i8* %12
br label %13
13: ; preds = %11
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %5
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @writeblanks(i8* writeonly %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
br label %8
8: ; preds = %4, %2
ret void
}
void longa() {
  int i, j;
  for (i = 0; i < 1000000; i++)
    j = i;
}


x86 assembly (clang, -O0):
<longa>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    112c <longa+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <longa+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @longa() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adc8(int /*<<< orphan*/);
int /*<<< orphan*/ indirectly();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
void adcIndirectLongy8(void) { adc8(readmem65816(indirectly())); }


x86 assembly (clang, -O0):
<adcIndirectLongy8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectly@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <adc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcIndirectLongy8>:
push   %rax
xor    %eax,%eax
call   1040 <indirectly@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <adc8@plt>

LLVM IR (-O0):
define void @adcIndirectLongy8() {
%1 = call i32 (...) @indirectly()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @adc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcIndirectLongy8() {
%1 = tail call i32 (...) @indirectly()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @adc8(i32 %2)
ret void
}