xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xaf() {
  Assert_real((isalnum(175) == 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_isalnum.c",
              880, ("isalnum should be 0 for 0xaf"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xaf>:
push   %rax
mov    $0xaf,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x370,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xaf\00"
define void @t_isalnum_0xaf() {
%1 = call i64 @isalnum(i32 175)
%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 880, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xaf\00"
define void @t_isalnum_0xaf() {
%1 = tail call i64 @isalnum(i32 175)
%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 880, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fun713() { return 713; }


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

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

LLVM IR (-O0):
define i32 @fun713() {
ret i32 713
}

LLVM IR (-O2):
define i32 @fun713() {
ret i32 713
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ output_w32(int);
void emit_fabss(int s, int d) {
  assert(s == 31);
  assert(d == 31);
  assem_debug("fabss s%d,s%d", d, s);
  output_w32(0x1e20c000 | s << 5 | d);
}


x86 assembly (clang, -O0):
<emit_fabss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1f,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x4(%rbp),%edi
shl    $0x5,%edi
or     $0x1e20c000,%edi
or     -0x8(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fabss>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x1f,%ebx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x1f,%ebp
sete   %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <assem_debug@plt>
shl    $0x5,%ebx
or     %ebp,%ebx
or     $0x1e20c000,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fabss s%d,s%d\00"
define void @emit_fabss(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 = icmp eq i32 %5, 31
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 31
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %3
%17 = shl i32 %16, 5
%18 = or i32 505462784, %17
%19 = load i32, i32* %4
%20 = or i32 %18, %19
%21 = call i32 @output_w32(i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fabss s%d,s%d\00"
define void @emit_fabss(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 31
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 31
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%10 = shl i32 %0, 5
%11 = or i32 %10, %1
%12 = or i32 %11, 505462784
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
/* Variables and functions */
int errno;
int socket(int, int, int);
int os_socket(int af, int type, int protocol) {
  int sock;
  sock = socket(af, type, protocol);
  if (sock == -1)
    sock = -errno;
  return sock;
}


x86 assembly (clang, -O0):
<os_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>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    114a <os_socket+0x3a>
xor    %eax,%eax
mov    0x2e9b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_socket>:
push   %rax
call   1030 <socket@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ togle_led();
int /*<<< orphan*/ wait(int);
void main() {
  for (;;) {
    togle_led();
    wait(2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1030 <togle_led@plt>
mov    $0x2,%edi
call   1040 <wait@plt>
jmp    1129 <main+0x9>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <togle_led@plt>
mov    $0x2,%edi
call   1040 <wait@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @togle_led()
%3 = call i32 @wait(i32 2)
br label %1
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @togle_led()
%3 = tail call i32 @wait(i32 2)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ GPIOPinWrite(int, int, int);
void LedSetBlue() {
  GPIOPinWrite(0x40025000, 0x00000004, 0x00000004);
  GPIOPinWrite(0x40025000, 0x00000002 | 0x00000008, 0);
}


x86 assembly (clang, -O0):
<LedSetBlue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40025000,%edi
mov    $0x4,%edx
mov    %edx,%esi
call   1030 <GPIOPinWrite@plt>
mov    $0x40025000,%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <GPIOPinWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedSetBlue>:
push   %rax
mov    $0x40025000,%edi
mov    $0x4,%esi
mov    $0x4,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40025000,%edi
mov    $0xa,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <GPIOPinWrite@plt>

LLVM IR (-O0):
define void @LedSetBlue() {
%1 = call i32 @GPIOPinWrite(i32 1073893376, i32 4, i32 4)
%2 = call i32 @GPIOPinWrite(i32 1073893376, i32 10, i32 0)
ret void
}

LLVM IR (-O2):
define void @LedSetBlue() {
%1 = tail call i32 @GPIOPinWrite(i32 1073893376, i32 4, i32 4)
%2 = tail call i32 @GPIOPinWrite(i32 1073893376, i32 10, i32 0)
ret void
}
/* Variables and functions */
double cos(double);
int sin(double);
double fd(double x) { return x * cos(x) + 2 * sin(x) - 5; }


x86 assembly (clang, -O0):
<fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
add    %eax,%eax
cvtsi2sd %eax,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
addsd  0xea2(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @cos(double %4)
%6 = load double, double* %2
%7 = call i32 @sin(double %6)
%8 = mul nsw i32 2, %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %3, double %5, double %9)
%11 = fsub double %10, 5.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @fd(double %0) {
%2 = tail call double @cos(double %0)
%3 = tail call i32 @sin(double %0)
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %5)
%7 = fadd double %6, -5.000000e+00
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ malloc(size_t);
void *tree_zmalloc_init(int /*<<< orphan*/, void *);
void *tree_zmalloc(size_t size, void *parent) {
  return tree_zmalloc_init(malloc(size + (sizeof(void *) * 3)), parent);
}


x86 assembly (clang, -O0):
<tree_zmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <tree_zmalloc_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_zmalloc>:
push   %rbx
mov    %rsi,%rbx
add    $0x18,%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <tree_zmalloc_init@plt>

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

LLVM IR (-O2):
define i8* @tree_zmalloc(i64 %0, i8* %1) {
%3 = add i64 %0, 24
%4 = tail call i32 @malloc(i64 %3)
%5 = tail call i8* @tree_zmalloc_init(i32 %4, i8* %1)
ret i8* %5
}
void eglBindAPI(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglBindAPI() {
ret void
}
/* Variables and functions */
unsigned long manager_peek(char const *);
unsigned long __attribute__((visibility("default")))
pthread_workqueue_peek_np(const char *key) {
  return manager_peek(key);
}


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

x86 assembly (clang, -O2):
<pthread_workqueue_peek_np>:
jmp    1030 <manager_peek@plt>

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

LLVM IR (-O2):
define i64 @pthread_workqueue_peek_np(i8* %0) {
%2 = tail call i64 @manager_peek(i8* %0)
ret i64 %2
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
main() {
  int len;
  char line[1000];
  while ((len = get_line(line, 1000)) > 0) {
    reverse(line);
    printf("%s", line);
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <get_line@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <get_line@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
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]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @get_line(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i32 @reverse(i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %4
13: ; preds = %4
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @MRCC_IRQHandler() {
ret void
}
int do_658() { return 658; }


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

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

LLVM IR (-O0):
define i32 @do_658() {
ret i32 658
}

LLVM IR (-O2):
define i32 @do_658() {
ret i32 658
}
void arr_clear(int *str, int lenght) {
  int i;
  for (i = 0; i < lenght; i++) {
    str[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<arr_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <arr_clear+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <arr_clear+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_clear>:
test   %esi,%esi
jle    1126 <arr_clear+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @arr_clear(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int i = 0;
  char *no = "n";
  if (argc > 1) {
    no = argv[1];
  }
  while (i == 0) {
    printf("%s\n", no);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1153 <main+0x43>
cmpl   $0x0,-0x14(%rbp)
jne    1172 <main+0x62>
mov    -0x20(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    1153 <main+0x43>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     111f <main+0xf>
mov    0x8(%rsi),%rbx
jmp    1126 <main+0x16>
lea    0xeda(%rip),%rbx
lea    0xed5(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1130 <main+0x20>

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

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ]
br label %9
9: ; preds = %9, %7
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC16F1619_stop(void) {
  serial_close(0);
  ;
}


x86 assembly (clang, -O0):
<PIC16F1619_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <serial_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F1619_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC16F1619_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F1619_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void bad_build_id() {
  fputs("\nIncorrect RVS_Build_Id sequence\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<bad_build_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bad_build_id>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AIncorrect RVS_Build_Id sequence\0A\00"
@stderr = global i32 0
define void @bad_build_id() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0AIncorrect RVS_Build_Id sequence\0A\00"
@stderr = global i32 0
define void @bad_build_id() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ toupper_arg1(char *);
int /*<<< orphan*/ toupper_stdin();
int main(int argc, char **argv) {
  if (argc > 1) {
    toupper_arg1(argv[1]);
  } else {
    toupper_stdin();
  }
  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)
cmpl   $0x1,-0x8(%rbp)
jle    1152 <main+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <toupper_arg1@plt>
jmp    1159 <main+0x39>
mov    $0x0,%al
call   1040 <toupper_stdin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1030 <toupper_arg1@plt>
jmp    1138 <main+0x18>
xor    %eax,%eax
call   1040 <toupper_stdin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @toupper_arg1(i8* %11)
br label %15
13: ; preds = %2
%14 = call i32 (...) @toupper_stdin()
br label %15
15: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @toupper_arg1(i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @toupper_stdin()
br label %10
10: ; preds = %8, %4
ret i32 0
}
/* Variables and functions */
char memcmp(char *data1, char *data2, unsigned int num) {
  while (*(data1) == *(data2)) {
    ++data1;
    ++data2;
    if (--num < 1)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<memcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115d <memcmp+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x1,%eax
jae    1158 <memcmp+0x58>
movb   $0x0,-0x1(%rbp)
jmp    1161 <memcmp+0x61>
jmp    110f <memcmp+0xf>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp>:
mov    %edx,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1124 <memcmp+0x24>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <memcmp+0x10>
xor    %eax,%eax
ret
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @memcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %11, %3
%5 = phi i8* [ %0, %3 ], [ %12, %11 ]
%6 = phi i8* [ %1, %3 ], [ %13, %11 ]
%7 = phi i32 [ %2, %3 ], [ %14, %11 ]
%8 = load i8, i8* %5
%9 = load i8, i8* %6
%10 = icmp eq i8 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = add i32 %7, -1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %11
%17 = phi i8 [ 0, %11 ], [ 1, %4 ]
ret i8 %17
}
/* Type definitions */
struct lex_buf {
  int dummy;
};

/* Variables and functions */
int EOF;
int getch(struct lex_buf *);
int skip_comment(struct lex_buf *buf) {
  int c;
  do {
    c = getch(buf);
  } while ((c != '\n') && (c != EOF));
  return c;
}


x86 assembly (clang, -O0):
<skip_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getch@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1149 <skip_comment+0x39>
mov    -0xc(%rbp),%eax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111c <skip_comment+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getch@plt>
cmp    $0xa,%eax
je     1132 <skip_comment+0x22>
cmp    (%r14),%eax
jne    1120 <skip_comment+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.lex_buf = type { i32 }
@EOF = global i32 0
define i32 @skip_comment(%struct.lex_buf* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @getch(%struct.lex_buf* %0)
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x94() {
  Assert_real((isascii(148) == 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_isascii.c",
              745, ("isascii should be 0 for 0x94"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x94\00"
define void @t_isascii_0x94() {
%1 = call i64 @isascii(i32 148)
%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 745, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x94\00"
define void @t_isascii_0x94() {
%1 = tail call i64 @isascii(i32 148)
%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 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void nr_free_ivector(int *v, long nl, long nh) { free((char *)(v + nl - 1)); }


x86 assembly (clang, -O0):
<nr_free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr_free_ivector>:
lea    (%rdi,%rsi,4),%rdi
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @nr_free_ivector(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
%11 = bitcast i32* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @nr_free_ivector(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
void R_RemapShader(const char *from, const char *to, int timeOffset) {}


x86 assembly (clang, -O0):
<R_RemapShader>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @R_RemapShader(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
unsigned int f1(unsigned int x, unsigned int y) { return x & ((1 << y) - 1); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
void ff_hevc_put_hevc_uni_epel_hv4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ final(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *str) {
  { fprintf(stderr, "Usage: %s [xpect-file] <[tty to use]>\n\n", str); };
  final(1, NULL);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <final@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <final@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s [xpect-file] <[tty to use]>\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @final(i32 1, i32* null)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: %s [xpect-file] <[tty to use]>\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @final(i32 1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgEventPrintStats();
int /*<<< orphan*/ printf(char *);
void c() {
  printf("Function c()\n");
  fgEventPrintStats();
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fgEventPrintStats@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Function c()\0A\00"
define void @c() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @fgEventPrintStats()
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Function c()\00"
define void @c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fgEventPrintStats()
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=23 REPO_URL=heads/master "
         "REVISION=r3p2-01rel4-137c649 CHANGED_REVISION=137c649 "
         "CHANGE_DATE=2014-12-25 17:45:49 +0900 BUILD_DATE=Fri Dec 26 20:48:48 "
         "HKT 2014 BUILD=release TARGET_PLATFORM=pegasus-m400 "
         "MALI_PLATFORM=pegasus-m400 KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [401 x i8] c"malidrv: API_VERSION=23 REPO_URL=heads/master REVISION=r3p2-01rel4-137c649 CHANGED_REVISION=137c649 CHANGE_DATE=2014-12-25 17:45:49 +0900 BUILD_DATE=Fri Dec 26 20:48:48 HKT 2014 BUILD=release TARGET_PLATFORM=pegasus-m400 MALI_PLATFORM=pegasus-m400 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([401 x i8], [401 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [401 x i8] c"malidrv: API_VERSION=23 REPO_URL=heads/master REVISION=r3p2-01rel4-137c649 CHANGED_REVISION=137c649 CHANGE_DATE=2014-12-25 17:45:49 +0900 BUILD_DATE=Fri Dec 26 20:48:48 HKT 2014 BUILD=release TARGET_PLATFORM=pegasus-m400 MALI_PLATFORM=pegasus-m400 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([401 x i8], [401 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
size_t libkeccak_state_unmarshal(int /*<<< orphan*/ *, void const *);
__attribute__((
    __deprecated__("Use libkeccak_state_unmarshal(NULL, data) instead of "
                   "libkeccak_state_unmarshal_skip(data)"))) size_t
libkeccak_state_unmarshal_skip(const void *restrict data) {
  return libkeccak_state_unmarshal(NULL, data);
}


x86 assembly (clang, -O0):
<libkeccak_state_unmarshal_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <libkeccak_state_unmarshal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libkeccak_state_unmarshal_skip>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <libkeccak_state_unmarshal@plt>

LLVM IR (-O0):
define i64 @libkeccak_state_unmarshal_skip(i8* noalias %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @libkeccak_state_unmarshal(i32* null, i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @libkeccak_state_unmarshal_skip(i8* noalias %0) {
%2 = tail call i64 @libkeccak_state_unmarshal(i32* null, i8* %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
void db_sqlite3_freedb(sqlite3 *pdb) { sqlite3_close(pdb); }


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

x86 assembly (clang, -O2):
<db_sqlite3_freedb>:
jmp    1030 <sqlite3_close@plt>

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

LLVM IR (-O2):
define void @db_sqlite3_freedb(i32* %0) {
%2 = tail call i32 @sqlite3_close(i32* %0)
ret void
}
int test_imm_F5int8_mem(signed char *val) {
  return ((*val) & (0xF5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -11
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct vector {
  int dummy;
};
struct point {
  int dummy;
};
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct point **);
struct point **new_points(struct vector *, unsigned int);
struct object *new_polyline(struct point **, unsigned int);
struct object *new_polyline2(struct vector *vs, unsigned npts) {
  struct point **pts = new_points(vs, npts);
  struct object *out = new_polyline(pts, npts);
  free(pts);
  return out;
}


x86 assembly (clang, -O0):
<new_polyline2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <new_points@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <new_polyline@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_polyline2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1050 <new_points@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <new_polyline@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.object = type { i32 }
%struct.vector = type { i32 }
%struct.point = type { i32 }
define %struct.object* @new_polyline2(%struct.vector* %0, i32 %1) {
%3 = alloca %struct.vector*
%4 = alloca i32
%5 = alloca %struct.point**
%6 = alloca %struct.object*
store %struct.vector* %0, %struct.vector** %3
store i32 %1, i32* %4
%7 = load %struct.vector*, %struct.vector** %3
%8 = load i32, i32* %4
%9 = call %struct.point** @new_points(%struct.vector* %7, i32 %8)
store %struct.point** %9, %struct.point*** %5
%10 = load %struct.point**, %struct.point*** %5
%11 = load i32, i32* %4
%12 = call %struct.object* @new_polyline(%struct.point** %10, i32 %11)
store %struct.object* %12, %struct.object** %6
%13 = load %struct.point**, %struct.point*** %5
%14 = call i32 @free(%struct.point** %13)
%15 = load %struct.object*, %struct.object** %6
ret %struct.object* %15
}

LLVM IR (-O2):
%struct.object = type { i32 }
%struct.vector = type { i32 }
%struct.point = type { i32 }
define %struct.object* @new_polyline2(%struct.vector* %0, i32 %1) {
%3 = tail call %struct.point** @new_points(%struct.vector* %0, i32 %1)
%4 = tail call %struct.object* @new_polyline(%struct.point** %3, i32 %1)
%5 = tail call i32 @free(%struct.point** %3)
ret %struct.object* %4
}
void snd_info_card_disconnect(struct snd_card *card) {}


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

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

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

LLVM IR (-O2):
%struct.snd_card = type opaque
define void @snd_info_card_disconnect(%struct.snd_card* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bbm_byte_write(void *, unsigned short, int, int);
int fc8300_deinit(void *handle, unsigned short devid) {
  bbm_byte_write(handle, devid, 0x0001, 0x00);
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
xor    %ecx,%ecx
movzwl -0xa(%rbp),%esi
call   1030 <bbm_byte_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <bbm_byte_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fc8300_deinit(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = load i16, i16* %4
%7 = call i32 @bbm_byte_write(i8* %5, i16 zeroext %6, i32 1, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @fc8300_deinit(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i32 1, i32 0)
ret i32 0
}
/* Variables and functions */
int foo(int);
int foo2(int);
int main() { return foo(3) + foo2(4); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1040 <foo@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1030 <foo2@plt>
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 3)
%2 = tail call i32 @foo2(i32 4)
%3 = add nsw i32 %2, %1
ret i32 %3
}
int count(char *string) {
  int length = 0;
  while (string[length] != '\0') {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <count+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <count+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <count+0x10>
ret

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

LLVM IR (-O2):
define i32 @count(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}