xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ns_client_log(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 char *, char *, int);
int main() {
  int i;
  ns_client_log(NULL, NULL, NULL, 0, "Hello, %s! 2+2=%d\n", "world", 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
lea    0xed4(%rip),%r8
lea    0xee0(%rip),%r9
mov    %rdx,%rdi
mov    %rdx,%rsi
movl   $0x4,(%rsp)
call   1030 <ns_client_log@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,(%rsp)
lea    0xee1(%rip),%r8
lea    0xeed(%rip),%r9
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ns_client_log@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Hello, %s! 2+2=%d\0A\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @ns_client_log(i32* null, i32* null, i32* null, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Hello, %s! 2+2=%d\0A\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @ns_client_log(i32* null, i32* null, i32* null, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ compara();
int main() {
  compara();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @compara()
ret i32 0
}
int picked3() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @picked3() {
ret i32 0
}
unsigned long int F0(unsigned long int x, unsigned long int y,
                     unsigned long int z) {
  return ((x & y) | (z & (x | y)));
}


x86 assembly (clang, -O0):
<F0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rdx
or     -0x10(%rbp),%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F0>:
mov    %rsi,%rax
and    %rdi,%rax
or     %rdi,%rsi
and    %rdx,%rsi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @F0(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = and i64 %7, %8
%10 = load i64, i64* %6
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = or i64 %11, %12
%14 = and i64 %10, %13
%15 = or i64 %9, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @F0(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %1, %0
%5 = or i64 %1, %0
%6 = and i64 %5, %2
%7 = or i64 %6, %4
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x1f() {
  Assert_real((isxdigit(31) == 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_isxdigit.c",
              160, ("isxdigit should be 0 for 0x1f"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x1f>:
push   %rax
mov    $0x1f,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xa0,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1f\00"
define void @t_isxdigit_0x1f() {
%1 = call i64 @isxdigit(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1f\00"
define void @t_isxdigit_0x1f() {
%1 = tail call i64 @isxdigit(i32 31)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *find_driver_name(char *argv0) { return argv0; }


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

x86 assembly (clang, -O2):
<find_driver_name>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @find_driver_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @find_driver_name(i8* readnone returned %0) {
ret i8* %0
}
void setval_209(unsigned *p) { *p = 3264272009U; }


x86 assembly (clang, -O0):
<setval_209>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc290d689,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_209>:
movl   $0xc290d689,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_209(i32* nocapture writeonly %0) {
store i32 -1030695287, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testing() { printf("Hi mom\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Hi mom\00"
define void @testing() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int cont1;
  scanf("%d", &cont1);
  printf("qualquer texto\n");
  cont1 = 55;
  if (cont1 > 9999) {
    cont1 = 222 + 222;
  } else
    printf("erro\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movl   $0x37,-0x8(%rbp)
cmpl   $0x270f,-0x8(%rbp)
jle    117b <main+0x4b>
movl   $0x1bc,-0x8(%rbp)
jmp    1187 <main+0x57>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
movl   $0x37,0x4(%rsp)
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"qualquer texto\0A\00"
@.str.2 = [6 x i8] c"erro\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 55, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 9999
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 444, i32* %2
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %7
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [15 x i8] c"qualquer texto\00"
@str.3 = [5 x i8] c"erro\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
store i32 55, i32* %1
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double TimeElapsed(void) {
  struct timeval t;
  int i;
  i = gettimeofday(&t, NULL);
  if (i)
    return 0;
  return (double)(t.tv_sec + t.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<TimeElapsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     113f <TimeElapsed+0x2f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <TimeElapsed+0x4f>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xeae(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimeElapsed>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xorps  %xmm0,%xmm0
test   %eax,%eax
je     112c <TimeElapsed+0x1c>
add    $0x18,%rsp
ret
cvtsi2sdq 0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  0xebf(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @TimeElapsed() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store double 0.000000e+00, double* %1
br label %16
8: ; preds = %0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%13 = load double, double* %12
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %11, %14
store double %15, double* %1
br label %16
16: ; preds = %8, %7
%17 = load double, double* %1
ret double %17
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @TimeElapsed() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %11, %8
br label %13
13: ; preds = %0, %5
%14 = phi double [ %12, %5 ], [ 0.000000e+00, %0 ]
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ len(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void printerr(char *errmsg) { write(2, errmsg, len(errmsg)); }


x86 assembly (clang, -O0):
<printerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <len@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printerr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <len@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <write@plt>

LLVM IR (-O0):
define void @printerr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @len(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @printerr(i8* %0) {
%2 = tail call i32 @len(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
char toupper(char);
void upper(char s[]) {
  unsigned int i;
  i = 0;
  while ((s[i] = toupper(s[i])) != '\0')
    ++i;
}


x86 assembly (clang, -O0):
<upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1157 <upper+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <upper+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upper>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %ebp,%ebx
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%ebp
test   %al,%al
jne    1120 <upper+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @upper(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call signext i8 @toupper(i8 signext %6)
store i8 %7, i8* %5
%8 = icmp eq i8 %7, 0
%9 = add i32 %3, 1
br i1 %8, label %10, label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
float copysignf(float, float);
float __ocl_copysign_float(float src1, float src2) {
  return copysignf(src1, src2);
}


x86 assembly (clang, -O0):
<__ocl_copysign_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_copysign_float>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_copysign_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.copysign.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__ocl_copysign_float(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
char *get_sha256(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *test = NULL;
  test = get_sha256("test2");
  printf("SHA256 from test: %s\n", test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
call   1040 <get_sha256@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <get_sha256@plt>
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"test2\00"
@.str.1 = [22 x i8] c"SHA256 from test: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = call i8* @get_sha256(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"test2\00"
@.str.1 = [22 x i8] c"SHA256 from test: %s\0A\00"
define i32 @main() {
%1 = tail call i8* @get_sha256(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void kr_aes_free_ctx(void *ctxv) { free(ctxv); }


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

x86 assembly (clang, -O2):
<kr_aes_free_ctx>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @kr_aes_free_ctx(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void ble_rsp_flash_ps_save(const struct ble_msg_flash_ps_save_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_flash_ps_save_rsp_t = type opaque
define void @ble_rsp_flash_ps_save(%struct.ble_msg_flash_ps_save_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
struct option {
  int dummy;
};

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/);
int getopt_long(int argc, char *const *argv, const char *shortopts,
                const struct option *longopts, int *longind) {
  return _getopt_internal(argc, argv, shortopts, longopts, longind, 0);
}


x86 assembly (clang, -O0):
<getopt_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <_getopt_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_long>:
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca %struct.option*
%10 = alloca i32*
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store %struct.option* %3, %struct.option** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load %struct.option*, %struct.option** %9
%15 = load i32*, i32** %10
%16 = call i32 @_getopt_internal(i32 %11, i8** %12, i8* %13, %struct.option* %14, i32* %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @getopt_long(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4) {
%6 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* %3, i32* %4, i32 0)
ret i32 %6
}
int fib(int i) {
  if (i == 1) {
    return 1;
  } else {
    if (i == 0) {
      return 0;
    } else {
      return fib(i - 1) + fib(i - 2);
    }
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
extern char *stpcpy(char *dest, const char *src) {
  while (*dest++ = *src++)
    ;
  return dest - 1;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <stpcpy+0x3b>
jmp    110c <stpcpy+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpcpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <stpcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %4
}
void abcdef4ghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcdef4ghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_198() {
  Assert_real((isqrt(198) == 14),
              "/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/stdlib/isqrt.c",
              995, ("Integer square root of 198 should be 14"));
}


x86 assembly (clang, -O0):
<t_sqrt_198>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc6,%edi
call   1030 <isqrt@plt>
cmp    $0xe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3e3,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_198>:
push   %rax
mov    $0xc6,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xe,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3e3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 198 should be 14\00"
define void @t_sqrt_198() {
%1 = call i32 @isqrt(i32 198)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 198 should be 14\00"
define void @t_sqrt_198() {
%1 = tail call i32 @isqrt(i32 198)
%2 = icmp eq i32 %1, 14
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 995, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int div_count(int i) {
  int res = 0, tmpi = i;
  while (tmpi != 0) {
    res++;
    tmpi /= 10;
  }
  return res;
}


x86 assembly (clang, -O0):
<div_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113a <div_count+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <div_count+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @div_count(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = sdiv i32 %4, 10
%8 = add i32 %4, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
void div2(double *x, double y) {
  x[0] /= y;
  x[1] /= y;
}


x86 assembly (clang, -O0):
<div2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div2>:
movupd (%rdi),%xmm1
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm1
movupd %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @div2(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fdiv double %8, %5
store double %9, double* %7
%10 = load double, double* %4
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fdiv double %13, %10
store double %14, double* %12
ret void
}

LLVM IR (-O2):
define void @div2(double* nocapture %0, double %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = insertelement <2 x double> poison, double %1, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = fdiv <2 x double> %4, %6
%8 = bitcast double* %0 to <2 x double>*
store <2 x double> %7, <2 x double>* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int mysum(char *, ...);
  int res;
  res = mysum("abc", 2, "2", 1);
  printf("result = %d\n", res);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rdx
mov    $0x2,%esi
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <mysum@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@.str.1 = [2 x i8] c"2\00"
@.str.2 = [13 x i8] c"result = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @mysum(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t mask2bits(uint32_t mask) {
  uint32_t tmp = 0x80000000;
  int i;
  uint8_t rv = 0;
  for (i = 0; i < 32; i++, tmp >>= 1) {
    if (tmp & mask)
      rv++;
    else
      break;
  }
  return rv;
}


x86 assembly (clang, -O0):
<mask2bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1168 <mask2bits+0x68>
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     1147 <mask2bits+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114c <mask2bits+0x4c>
jmp    1168 <mask2bits+0x68>
jmp    1151 <mask2bits+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <mask2bits+0x1d>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask2bits>:
test   %edi,%edi
js     1107 <mask2bits+0x7>
xor    %eax,%eax
ret
mov    $0x80000000,%ecx
xor    %eax,%eax
xchg   %ax,%ax
mov    %rax,%rdx
add    $0x1,%rax
cmp    $0x1e,%edx
ja     1124 <mask2bits+0x24>
sar    %ecx
mov    %ecx,%edx
and    %edi,%edx
jne    1110 <mask2bits+0x10>
ret

LLVM IR (-O0):
define i64 @mask2bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
store i64 0, i64* %5
store i32 0, i32* %4
br label %6
6: ; preds = %19, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 32
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i64, i64* %5
%16 = add nsw i64 %15, 1
store i64 %16, i64* %5
br label %18
17: ; preds = %9
br label %24
18: ; preds = %14
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
%22 = load i32, i32* %3
%23 = ashr i32 %22, 1
store i32 %23, i32* %3
br label %6
24: ; preds = %17, %6
%25 = load i64, i64* %5
ret i64 %25
}

LLVM IR (-O2):
define i64 @mask2bits(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ -2147483648, %1 ]
%6 = trunc i64 %4 to i32
%7 = add nuw nsw i64 %4, 1
%8 = ashr i32 %5, 1
%9 = icmp ugt i32 %6, 30
%10 = and i32 %8, %0
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *argv0) {
  fprintf(stderr, "Usage: %s <interface to echo> <...>", argv0);
  exit(2);
}


x86 assembly (clang, -O0):
<print_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    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Usage: %s <interface to echo> <...>\00"
define void @print_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 ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Usage: %s <interface to echo> <...>\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
scalar_t__ rb_isupper(int);
int rb_tolower(int c) { return rb_isupper(c) ? (c | 0x20) : c; }


x86 assembly (clang, -O0):
<rb_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rb_isupper@plt>
cmp    $0x0,%rax
je     113b <rb_tolower+0x2b>
mov    -0x4(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <rb_tolower+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <rb_isupper@plt>
mov    %ebx,%ecx
or     $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rb_tolower(i32 %0) {
%2 = tail call i64 @rb_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void __mp_check(void) {}


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

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

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

LLVM IR (-O2):
define void @__mp_check() {
ret void
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_cofactor(float *, float *);
__attribute__((always_)) struct mat3 *psmat3_cofactor(struct mat3 *result,
                                                      struct mat3 *m) {
  mat3_cofactor((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat3_cofactor>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3_cofactor@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_cofactor(%struct.mat3* %0, %struct.mat3* %1) {
%3 = alloca %struct.mat3*
%4 = alloca %struct.mat3*
store %struct.mat3* %0, %struct.mat3** %3
store %struct.mat3* %1, %struct.mat3** %4
%5 = load %struct.mat3*, %struct.mat3** %3
%6 = bitcast %struct.mat3* %5 to float*
%7 = load %struct.mat3*, %struct.mat3** %4
%8 = bitcast %struct.mat3* %7 to float*
%9 = call i32 @mat3_cofactor(float* %6, float* %8)
%10 = load %struct.mat3*, %struct.mat3** %3
ret %struct.mat3* %10
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_cofactor(%struct.mat3* returned %0, %struct.mat3* %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = bitcast %struct.mat3* %1 to float*
%5 = tail call i32 @mat3_cofactor(float* %3, float* %4)
ret %struct.mat3* %0
}
void ChangeStudentName(PDMCSchema, S, N) struct univStruct *PDMCSchema;
struct Student **S;
char N[20];
{ AssignStudentName(S, N); }


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

x86 assembly (clang, -O2):
<ChangeStudentName>:
mov    %rsi,%rdi
mov    %rdx,%rsi
xor    %eax,%eax
jmp    1030 <AssignStudentName@plt>

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.Student = type opaque
define void @ChangeStudentName(%struct.univStruct* %0, %struct.Student** %1, i8* %2) {
%4 = alloca %struct.univStruct*
%5 = alloca %struct.Student**
%6 = alloca i8*
store %struct.univStruct* %0, %struct.univStruct** %4
store %struct.Student** %1, %struct.Student*** %5
store i8* %2, i8** %6
%7 = load %struct.Student**, %struct.Student*** %5
%8 = load i8*, i8** %6
%9 = call i32 (%struct.Student**, i8*, ...) bitcast (i32 (...)* @AssignStudentName to i32 (%struct.Student**, i8*, ...)*)(%struct.Student** %7, i8* %8)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.Student = type opaque
define void @ChangeStudentName(%struct.univStruct* nocapture readnone %0, %struct.Student** %1, i8* %2) {
%4 = tail call i32 (%struct.Student**, i8*, ...) bitcast (i32 (...)* @AssignStudentName to i32 (%struct.Student**, i8*, ...)*)(%struct.Student** %1, i8* %2)
ret void
}
int obj4func1(int a __attribute__((unused))) { return 55; }


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

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

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

LLVM IR (-O2):
define i32 @obj4func1(i32 %0) {
ret i32 55
}
__attribute__((weak)) void NMI_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define weak void @NMI_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, ...);
main() {
  long nc;
  for (nc = 0; getchar() != EOF; nc++)
    ;
  printf("\n-------------------\n");
  printf("%8ld characters\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     1164 <main+0x44>
jmp    1153 <main+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe99(%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   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2ea6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1150 <main+0x20>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str.1 = [17 x i8] c"%8ld characters\0A\00"
@str = [21 x i8] c"\0A-------------------\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 %2)
ret i32 0
}
void print_struct_help_classify() {}


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

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

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

LLVM IR (-O2):
define void @print_struct_help_classify() {
ret void
}
/* Variables and functions */
unsigned int __data2host4(unsigned int);
int /*<<< orphan*/ read_or_die(unsigned int *, int);
unsigned int read4(void) {
  unsigned int data;
  read_or_die(&data, 4);
  return __data2host4(data);
}


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

x86 assembly (clang, -O2):
<read4>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1040 <read_or_die@plt>
mov    0x4(%rsp),%edi
call   1030 <__data2host4@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read4() {
%1 = alloca i32
%2 = call i32 @read_or_die(i32* %1, i32 4)
%3 = load i32, i32* %1
%4 = call i32 @__data2host4(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @read4() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_or_die(i32* %1, i32 4)
%4 = load i32, i32* %1
%5 = call i32 @__data2host4(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ buildexpandtable2();
int /*<<< orphan*/ buildexpandtable4();
int /*<<< orphan*/ buildshrinktable2();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  buildexpandtable4();
  buildexpandtable2();
  buildshrinktable2();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @buildexpandtable4()
%2 = tail call i32 (...) @buildexpandtable2()
%3 = tail call i32 (...) @buildshrinktable2()
%4 = tail call i32 @exit(i32 0)
unreachable
}
void initialize_readline(void) {}


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

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

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

LLVM IR (-O2):
define void @initialize_readline() {
ret void
}