xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ int80(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void setCursorPos(int pos) { int80(14, pos, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<setCursorPos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xe,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCursorPos>:
mov    %edi,%esi
mov    $0xe,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <int80@plt>

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

LLVM IR (-O2):
define void @setCursorPos(i32 %0) {
%2 = tail call i32 @int80(i32 14, i32 %0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int neg_mod(int n, int m) {
  do {
    if (!(n >= 0 && n < m)) {
      fprintf(stderr, "Assertion failure\n");
      abort();
    }
  } while (0);
  return (n == 0 ? 0 : m - n);
}


x86 assembly (clang, -O0):
<neg_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1144 <neg_mod+0x24>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1160 <neg_mod+0x40>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1165 <neg_mod+0x45>
cmpl   $0x0,-0x4(%rbp)
jne    1179 <neg_mod+0x59>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1182 <neg_mod+0x62>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_mod>:
test   %edi,%edi
js     1130 <neg_mod+0x10>
sub    %edi,%esi
jle    1130 <neg_mod+0x10>
test   %edi,%edi
cmove  %edi,%esi
mov    %esi,%eax
ret
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Assertion failure\0A\00"
define i32 @neg_mod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %16, label %12
12: ; preds = %8, %5
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
br label %25
21: ; preds = %17
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = sub nsw i32 %22, %23
br label %25
25: ; preds = %21, %20
%26 = phi i32 [ 0, %20 ], [ %24, %21 ]
ret i32 %26
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Assertion failure\0A\00"
define i32 @neg_mod(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = icmp sgt i32 %1, %0
%5 = and i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %2
%11 = icmp eq i32 %0, 0
%12 = sub nsw i32 %1, %0
%13 = select i1 %11, i32 0, i32 %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
void serialClose(int fd) {
  tcflush(fd, TCIOFLUSH);
  close(fd);
}


x86 assembly (clang, -O0):
<serialClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialClose>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define void @serialClose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @TCIOFLUSH
%5 = call i32 @tcflush(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
ret void
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define void @serialClose(i32 %0) {
%2 = load i32, i32* @TCIOFLUSH
%3 = tail call i32 @tcflush(i32 %0, i32 %2)
%4 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x71() {
  Assert_real((isprint(113)),
              "/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_isprint.c",
              570, ("isprint should be 1 for q"));
}


x86 assembly (clang, -O0):
<t_isprint_0x71>:
push   %rbp
mov    %rsp,%rbp
mov    $0x71,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x23a,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x71>:
push   %rax
mov    $0x71,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x23a,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for q\00"
define void @t_isprint_0x71() {
%1 = call i32 @isprint(i32 113)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 570, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for q\00"
define void @t_isprint_0x71() {
%1 = tail call i32 @isprint(i32 113)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 570, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int quit(struct BinTree *dict, char *in) { return 0; }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.BinTree = type opaque
define i32 @quit(%struct.BinTree* %0, i8* %1) {
%3 = alloca %struct.BinTree*
%4 = alloca i8*
store %struct.BinTree* %0, %struct.BinTree** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.BinTree = type opaque
define i32 @quit(%struct.BinTree* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(void) {
  for (int i = 0; i <= 100; i++) {
    printf("\rPercent complete: %d%%", i);
    fflush(stdout);
    sleep(1);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1187 <main+0x57>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%r14
mov    0x2e8e(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
add    $0x1,%ebp
cmp    $0x65,%ebp
jne    1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0DPercent complete: %d%%\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 100
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
%11 = call i32 @sleep(i32 1)
br label %12
12: ; preds = %6
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %3
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0DPercent complete: %d%%\00"
@stdout = global i32 0
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @putchar(i32 10)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %9, %3 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @sleep(i32 1)
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, 101
br i1 %10, label %1, label %3
}
/* Variables and functions */
int /*<<< orphan*/ irq_kill();
int /*<<< orphan*/ write32(int, int);
void irq_shutdown(void) {
  write32((0xd800000 + 0x03c), 0);
  write32((0xd800000 + 0x038), 0xffffffff);
  irq_kill();
}


x86 assembly (clang, -O0):
<irq_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd80003c,%edi
xor    %esi,%esi
call   1030 <write32@plt>
mov    $0xd800038,%edi
mov    $0xffffffff,%esi
call   1030 <write32@plt>
mov    $0x0,%al
call   1040 <irq_kill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_shutdown>:
push   %rax
mov    $0xd80003c,%edi
xor    %esi,%esi
call   1030 <write32@plt>
mov    $0xd800038,%edi
mov    $0xffffffff,%esi
call   1030 <write32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <irq_kill@plt>

LLVM IR (-O0):
define void @irq_shutdown() {
%1 = call i32 @write32(i32 226492476, i32 0)
%2 = call i32 @write32(i32 226492472, i32 -1)
%3 = call i32 (...) @irq_kill()
ret void
}

LLVM IR (-O2):
define void @irq_shutdown() {
%1 = tail call i32 @write32(i32 226492476, i32 0)
%2 = tail call i32 @write32(i32 226492472, i32 -1)
%3 = tail call i32 (...) @irq_kill()
ret void
}
float osGet3DSliderState(void) { return *(volatile float *)0x1FF81080; }


x86 assembly (clang, -O0):
<osGet3DSliderState>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1ff81080,%eax
movss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<osGet3DSliderState>:
movss  0x1ff81080,%xmm0
f8 1f
ret

LLVM IR (-O0):
define float @osGet3DSliderState() {
%1 = load volatile float, float* inttoptr (i64 536350848 to float*)
ret float %1
}

LLVM IR (-O2):
define float @osGet3DSliderState() {
%1 = load volatile float, float* inttoptr (i64 536350848 to float*)
ret float %1
}
void ASN1_item_sign(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_sign() {
ret void
}
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
double clock();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("main\n");
  clock_t start, end;
  start = clock();
  end = clock();
  double time_taken1 = end - start;
  printf("time taken = %g\n", time_taken1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <clock@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <clock@plt>
subsd  (%rsp),%xmm0
lea    0xea4(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"main\0A\00"
@.str.1 = [17 x i8] c"time taken = %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call double (...) @clock()
store double %6, double* %2
%7 = call double (...) @clock()
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %2
%10 = fsub double %8, %9
store double %10, double* %4
%11 = load double, double* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"time taken = %g\0A\00"
@str = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = tail call double (...) @clock()
%3 = tail call double (...) @clock()
%4 = fsub double %3, %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int __sbtolower(int);
int tolower(int c) { return (__sbtolower(c)); }


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

x86 assembly (clang, -O2):
<tolower>:
jmp    1030 <__sbtolower@plt>

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i32 @__sbtolower(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fill_elements(size_t *, int);
void create_zigzag(size_t zigzag[(8 * 8)]) {
  fill_elements(zigzag, 0);
  fill_elements(zigzag, 1);
}


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

x86 assembly (clang, -O2):
<create_zigzag>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <fill_elements@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <fill_elements@plt>

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

LLVM IR (-O2):
define void @create_zigzag(i64* %0) {
%2 = tail call i32 @fill_elements(i64* %0, i32 0)
%3 = tail call i32 @fill_elements(i64* %0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ do_cpuid(int /*<<< orphan*/, int /*<<< orphan*/ *);
uint32_t cpuid_eax(uint32_t op) {
  uint32_t regs[4];
  do_cpuid(op, regs);
  return regs[0];
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1030 <do_cpuid@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
sub    $0x18,%rsp
mov    %rsp,%rsi
call   1030 <do_cpuid@plt>
mov    (%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @do_cpuid(i32 %4, i32* %5)
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @do_cpuid(i32 %0, i32* %4)
%6 = load i32, i32* %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a, i;
  i = 0;
  a = 0;
  while (i <= 100) {
    a = a + i;
    i++;
  }
  printf("%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0xc(%rbp)
jg     114e <main+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
screen(n) int n;
{
  if (isatty(1))
    printf("%8d\b\b\b\b\b\b\b\b", n);
}


x86 assembly (clang, -O0):
<screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <isatty@plt>
cmp    $0x0,%eax
je     1151 <screen+0x31>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <isatty@plt>
test   %eax,%eax
je     1143 <screen+0x23>
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%8d\08\08\08\08\08\08\08\08\00"
define i32 @screen(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @isatty to i32 (i32, ...)*)(i32 1)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"%8d\08\08\08\08\08\08\08\08\00"
define i32 @screen(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @isatty to i32 (i32, ...)*)(i32 1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ switch_panes_content();
int /*<<< orphan*/ try_activate_view_mode();
void switch_panes(void) {
  switch_panes_content();
  try_activate_view_mode();
}


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

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

LLVM IR (-O0):
define void @switch_panes() {
%1 = call i32 (...) @switch_panes_content()
%2 = call i32 (...) @try_activate_view_mode()
ret void
}

LLVM IR (-O2):
define void @switch_panes() {
%1 = tail call i32 (...) @switch_panes_content()
%2 = tail call i32 (...) @try_activate_view_mode()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pshparse();
int main() {
  pshparse();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pshparse()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void printSyntax(char *name) {
  fprintf(
      stderr,
      "Argument error. Syntax:\n   %s [BSSID] [MONITOR-IF] <MAC-LIST-FILE>\n",
      name);
  fprintf(stderr,
          "\t[BSSID]\t\t  identifier of network target\n\t[MONITOR-IF]\t  "
          "wireless interface in monitor mode\n\t<MAC-LIST-FILE>\t  if omitted "
          "starts broadcast jammer\n");
}


x86 assembly (clang, -O0):
<printSyntax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xefd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSyntax>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf10(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"Argument error. Syntax:\0A %s [BSSID] [MONITOR-IF] <MAC-LIST-FILE>\0A\00"
@.str.1 = [147 x i8] c"\09[BSSID]\09\09 identifier of network target\0A\09[MONITOR-IF]\09 wireless interface in monitor mode\0A\09<MAC-LIST-FILE>\09 if omitted starts broadcast jammer\0A\00"
define void @printSyntax(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"Argument error. Syntax:\0A %s [BSSID] [MONITOR-IF] <MAC-LIST-FILE>\0A\00"
@.str.1 = [147 x i8] c"\09[BSSID]\09\09 identifier of network target\0A\09[MONITOR-IF]\09 wireless interface in monitor mode\0A\09<MAC-LIST-FILE>\09 if omitted starts broadcast jammer\0A\00"
define void @printSyntax(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bputc(int);
int /*<<< orphan*/ swbytealign();
void WriteEoi() {

  swbytealign();
  bputc(0xff);
  bputc(0xd9);
}


x86 assembly (clang, -O0):
<WriteEoi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <swbytealign@plt>
mov    $0xff,%edi
call   1030 <bputc@plt>
mov    $0xd9,%edi
call   1030 <bputc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteEoi>:
push   %rax
xor    %eax,%eax
call   1040 <swbytealign@plt>
mov    $0xff,%edi
call   1030 <bputc@plt>
mov    $0xd9,%edi
pop    %rax
jmp    1030 <bputc@plt>

LLVM IR (-O0):
define void @WriteEoi() {
%1 = call i32 (...) @swbytealign()
%2 = call i32 @bputc(i32 255)
%3 = call i32 @bputc(i32 217)
ret void
}

LLVM IR (-O2):
define void @WriteEoi() {
%1 = tail call i32 (...) @swbytealign()
%2 = tail call i32 @bputc(i32 255)
%3 = tail call i32 @bputc(i32 217)
ret void
}
/* Type definitions */
struct evbuffer {
  int dummy;
};
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bufferevent_free(struct bufferevent *);
struct evbuffer *bufferevent_get_output(struct bufferevent *);
scalar_t__ evbuffer_get_length(struct evbuffer *);
void disconnect_after_write(struct bufferevent *bev, void *context) {
  struct evbuffer *output = bufferevent_get_output(bev);
  if (evbuffer_get_length(output) == 0)
    bufferevent_free(bev);
}


x86 assembly (clang, -O0):
<disconnect_after_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bufferevent_get_output@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <evbuffer_get_length@plt>
cmp    $0x0,%rax
jne    1169 <disconnect_after_write+0x39>
mov    -0x8(%rbp),%rdi
call   1050 <bufferevent_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconnect_after_write>:
push   %rbx
mov    %rdi,%rbx
call   1030 <bufferevent_get_output@plt>
mov    %rax,%rdi
call   1040 <evbuffer_get_length@plt>
test   %rax,%rax
je     1148 <disconnect_after_write+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <bufferevent_free@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
%struct.evbuffer = type { i32 }
define void @disconnect_after_write(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
%5 = alloca %struct.evbuffer*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
%6 = load %struct.bufferevent*, %struct.bufferevent** %3
%7 = call %struct.evbuffer* @bufferevent_get_output(%struct.bufferevent* %6)
store %struct.evbuffer* %7, %struct.evbuffer** %5
%8 = load %struct.evbuffer*, %struct.evbuffer** %5
%9 = call i64 @evbuffer_get_length(%struct.evbuffer* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.bufferevent*, %struct.bufferevent** %3
%13 = call i32 @bufferevent_free(%struct.bufferevent* %12)
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
%struct.evbuffer = type { i32 }
define void @disconnect_after_write(%struct.bufferevent* %0, i8* nocapture readnone %1) {
%3 = tail call %struct.evbuffer* @bufferevent_get_output(%struct.bufferevent* %0)
%4 = tail call i64 @evbuffer_get_length(%struct.evbuffer* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @bufferevent_free(%struct.bufferevent* %0)
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct peespi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct peespi *);
void t1_espi_destroy(struct peespi *espi) { kfree(espi); }


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

x86 assembly (clang, -O2):
<t1_espi_destroy>:
jmp    1030 <kfree@plt>

LLVM IR (-O0):
%struct.peespi = type { i32 }
define void @t1_espi_destroy(%struct.peespi* %0) {
%2 = alloca %struct.peespi*
store %struct.peespi* %0, %struct.peespi** %2
%3 = load %struct.peespi*, %struct.peespi** %2
%4 = call i32 @kfree(%struct.peespi* %3)
ret void
}

LLVM IR (-O2):
%struct.peespi = type { i32 }
define void @t1_espi_destroy(%struct.peespi* %0) {
%2 = tail call i32 @kfree(%struct.peespi* %0)
ret void
}
/* Variables and functions */
int rand();
int get_random_pivot(int *array, int left, int right) {
  int size = (right - left) + 1;
  int r = rand();
  return left + (r % size);
}


x86 assembly (clang, -O0):
<get_random_pivot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_pivot>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
sub    %esi,%ebx
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_random_pivot(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %7
%13 = call i32 (...) @rand()
store i32 %13, i32* %8
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = srem i32 %15, %16
%18 = add nsw i32 %14, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_random_pivot(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = sub i32 1, %1
%5 = add i32 %4, %2
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, %5
%8 = add nsw i32 %7, %1
ret i32 %8
}
int charff(char **s, char c) {
  for (; **s; (*s)++)
    if (**s == c)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<charff>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     1158 <charff+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1140 <charff+0x40>
movl   $0x1,-0x4(%rbp)
jmp    115f <charff+0x5f>
jmp    1145 <charff+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110e <charff+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charff>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
xor    %eax,%eax
test   %dl,%dl
je     1123 <charff+0x23>
add    $0x1,%rcx
nop
cmp    %sil,%dl
je     1124 <charff+0x24>
mov    %rcx,(%rdi)
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <charff+0x10>
ret
mov    $0x1,%eax
ret

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

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


x86 assembly (clang, -O0):
<div7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<div7>:
mov    %edi,%eax
imul   $0x24924925,%rax,%rax
shr    $0x20,%rax
sub    %eax,%edi
shr    %edi
add    %edi,%eax
shr    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @div7(i32 %0) {
%2 = udiv i32 %0, 7
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test2_f1(int /*<<< orphan*/);
int /*<<< orphan*/ test2_f2();
void test2_f3() { test2_f1(test2_f2()); }


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

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

LLVM IR (-O0):
define void @test2_f3() {
%1 = call i32 (...) @test2_f2()
%2 = call i32 @test2_f1(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test2_f3() {
%1 = tail call i32 (...) @test2_f2()
%2 = tail call i32 @test2_f1(i32 %1)
ret void
}
/* Variables and functions */
int getword(int);
int inlist(int link, int word) {
  while (link != 0L) {
    if (word == getword(link + ((int)0)))
      return ((int)1);
    link = getword(link + ((int)2));
  }
  return ((int)0);
}


x86 assembly (clang, -O0):
<inlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1169 <inlist+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
add    $0x0,%edi
call   1030 <getword@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    1156 <inlist+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1170 <inlist+0x60>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1030 <getword@plt>
mov    %eax,-0x8(%rbp)
jmp    111e <inlist+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inlist>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
test   %edi,%edi
je     1143 <inlist+0x33>
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
call   1030 <getword@plt>
cmp    %ebp,%eax
je     113d <inlist+0x2d>
add    $0x2,%ebx
mov    %ebx,%edi
call   1030 <getword@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1120 <inlist+0x10>
jmp    1143 <inlist+0x33>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @inlist(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %8
%5 = phi i32 [ %10, %8 ], [ %0, %2 ]
%6 = tail call i32 @getword(i32 %5)
%7 = icmp eq i32 %6, %1
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = add nsw i32 %5, 2
%10 = tail call i32 @getword(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %8, %2
%13 = phi i32 [ 0, %2 ], [ 0, %8 ], [ 1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/
parseConfigurationFileOptionsInDirectoryWithLeafname(char const *, char *);
void parseConfigurationFileOptionsInDirectory(const char *directory) {
  parseConfigurationFileOptionsInDirectoryWithLeafname(directory, ".ctags");
}


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

x86 assembly (clang, -O2):
<parseConfigurationFileOptionsInDirectory>:
lea    0xee9(%rip),%rsi
jmp    1030 <parseConfigurationFileOptionsInDirectoryWithLeafname@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c".ctags\00"
define void @parseConfigurationFileOptionsInDirectory(i8* %0) {
%2 = tail call i32 @parseConfigurationFileOptionsInDirectoryWithLeafname(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ arch_accel();
uint32_t mpeg2_detect_accel(void) {
  uint32_t accel;
  accel = 0;
  accel = arch_accel();
  return accel;
}


x86 assembly (clang, -O0):
<mpeg2_detect_accel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <arch_accel@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @mpeg2_detect_accel() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 (...) @arch_accel()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @mpeg2_detect_accel() {
%1 = tail call i64 (...) @arch_accel()
ret i64 %1
}
int test01(const char *s1) { return __builtin_strncmp(s1, "abcde", 3); }


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

x86 assembly (clang, -O2):
<test01>:
lea    0xee9(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
define i32 @test01(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
define i32 @test01(i8* nocapture %0) {
%2 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(int);
void printchar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)outbyte(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <outbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define void @printchar(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 %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @outbyte(i32 %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @outbyte(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strlen(char const *);
int strendswith(const char *s1, const char *s2) {
  int len1 = strlen(s1);
  int len2 = strlen(s2);
  if (len2 > len1)
    return -1;
  return strcmp(s1 + (len1 - len2), s2);
}


x86 assembly (clang, -O0):
<strendswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1160 <strendswith+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <strendswith+0x5b>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
cltq
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strendswith>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebp
jge    1147 <strendswith+0x27>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
movslq %ebp,%rax
add    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strendswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sub nsw i32 %3, %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
long long __builtin_wasm_trunc_u_i64_f64(double);
long long trunc_u_i64_f64(double f) {
  return __builtin_wasm_trunc_u_i64_f64(f);
}


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

x86 assembly (clang, -O2):
<trunc_u_i64_f64>:
jmp    1030 <__builtin_wasm_trunc_u_i64_f64@plt>

LLVM IR (-O0):
define i64 @trunc_u_i64_f64(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @__builtin_wasm_trunc_u_i64_f64(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @trunc_u_i64_f64(double %0) {
%2 = tail call i64 @__builtin_wasm_trunc_u_i64_f64(double %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ convert(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  argc--;
  if (argc != 2) {
    printf("usage: txt2bin <input.txt> <output.bin>\n");
    return 1;
  }
  convert(argv[1], argv[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1161 <main+0x41>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <convert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1137 <main+0x17>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <convert@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"usage: txt2bin <input.txt> <output.bin>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %20
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @convert(i8* %15, i8* %18)
store i32 0, i32* %3
br label %20
20: ; preds = %12, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@str = [40 x i8] c"usage: txt2bin <input.txt> <output.bin>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @convert(i8* %8, i8* %10)
br label %12
12: ; preds = %6, %4
%13 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %13
}