xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int);
void mergeSort(int *array, int arrayLen) {
  int midpoint;
  if (arrayLen < 2) {
    return;
  } else {
    midpoint = arrayLen / 2;
    mergeSort(array, midpoint);
    mergeSort(array + midpoint, arrayLen - midpoint);
    merge(array, midpoint, arrayLen);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    113e <mergeSort+0x1e>
jmp    1181 <mergeSort+0x61>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    $0x1,%esi
jg     1126 <mergeSort+0x6>
ret
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
mov    %ebx,%esi
call   1030 <mergeSort@plt>
lea    (%r14,%rbx,4),%rdi
mov    %ebp,%esi
sub    %ebx,%esi
call   1030 <mergeSort@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <merge@plt>

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %1, 1
tail call void @mergeSort(i32* %0, i32 %6)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %6
tail call void @mergeSort(i32* %8, i32 %9)
%10 = tail call i32 @merge(i32* %0, i32 %6, i32 %1)
br label %4
}
int mIsCanadaState(int ccode) { return (ccode >= 393 && ccode <= 405); }


x86 assembly (clang, -O0):
<mIsCanadaState>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x189,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <mIsCanadaState+0x26>
cmpl   $0x195,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mIsCanadaState>:
add    $0xfffffe77,%edi
xor    %eax,%eax
cmp    $0xd,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @mIsCanadaState(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 393
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 405
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mIsCanadaState(i32 %0) {
%2 = add i32 %0, -393
%3 = icmp ult i32 %2, 13
%4 = zext i1 %3 to i32
ret i32 %4
}
int lw_sock_accept(int *new_sock, char *ip, int *port, int listening_sock) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @lw_sock_accept(i32* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_trace();
void dummy_function(void) { print_trace(); }


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

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

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

LLVM IR (-O2):
define void @dummy_function() {
%1 = tail call i32 (...) @print_trace()
ret void
}
void put_16(unsigned char *s, unsigned c, int e) {
  e &= 1;
  s[e] = c >> 8;
  s[1 - e] = c;
}


x86 assembly (clang, -O0):
<put_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    $0x1,%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_16>:
mov    %esi,%eax
and    $0x1,%edx
mov    %ah,(%rdi,%rdx,1)
xor    $0x1,%rdx
mov    %al,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @put_16(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = and i32 %7, 1
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 %11, i8* %15
%16 = load i32, i32* %5
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = sub nsw i32 1, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
store i8 %17, i8* %22
ret void
}

LLVM IR (-O2):
define void @put_16(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = and i32 %2, 1
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = zext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = trunc i32 %1 to i8
%10 = xor i32 %4, 1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %9, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ write8x8(int, int, int, int, int, int, int, int);
void stop() {
  write8x8(0x0, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x0);
  delay(10000);
  write8x8(0xff, 0xbd, 0xdb, 0xe7, 0xe7, 0xdb, 0xbd, 0xff);
  delay(10000);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x42,%esi
mov    $0x24,%r9d
mov    $0x18,%r8d
mov    %r9d,%edx
mov    %r8d,%ecx
movl   $0x42,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <write8x8@plt>
mov    $0x2710,%edi
call   1040 <delay@plt>
mov    $0xff,%edi
mov    $0xbd,%esi
mov    $0xdb,%r9d
mov    $0xe7,%r8d
mov    %r9d,%edx
mov    %r8d,%ecx
movl   $0xbd,(%rsp)
movl   $0xff,0x8(%rsp)
call   1030 <write8x8@plt>
mov    $0x2710,%edi
call   1040 <delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop>:
push   %rax
xor    %edi,%edi
mov    $0x42,%esi
mov    $0x24,%edx
mov    $0x18,%ecx
mov    $0x18,%r8d
mov    $0x24,%r9d
push   $0x0
push   $0x42
call   1030 <write8x8@plt>
add    $0x10,%rsp
mov    $0x2710,%edi
call   1040 <delay@plt>
mov    $0xff,%edi
mov    $0xbd,%esi
mov    $0xdb,%edx
mov    $0xe7,%ecx
mov    $0xe7,%r8d
mov    $0xdb,%r9d
push   $0xff
push   $0xbd
call   1030 <write8x8@plt>
add    $0x10,%rsp
mov    $0x2710,%edi
pop    %rax
jmp    1040 <delay@plt>

LLVM IR (-O0):
define void @stop() {
%1 = call i32 @write8x8(i32 0, i32 66, i32 36, i32 24, i32 24, i32 36, i32 66, i32 0)
%2 = call i32 @delay(i32 10000)
%3 = call i32 @write8x8(i32 255, i32 189, i32 219, i32 231, i32 231, i32 219, i32 189, i32 255)
%4 = call i32 @delay(i32 10000)
ret void
}

LLVM IR (-O2):
define void @stop() {
%1 = tail call i32 @write8x8(i32 0, i32 66, i32 36, i32 24, i32 24, i32 36, i32 66, i32 0)
%2 = tail call i32 @delay(i32 10000)
%3 = tail call i32 @write8x8(i32 255, i32 189, i32 219, i32 231, i32 231, i32 219, i32 189, i32 255)
%4 = tail call i32 @delay(i32 10000)
ret void
}
void swap(int i, int j, int arr[]) {
  int t = arr[i];
  arr[i] = arr[j];
  arr[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %edi,%rax
mov    (%rdx,%rax,4),%ecx
movslq %esi,%rsi
mov    (%rdx,%rsi,4),%edi
mov    %edi,(%rdx,%rax,4)
mov    %ecx,(%rdx,%rsi,4)
ret

LLVM IR (-O0):
define void @swap(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** %6
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %6
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int dlclose(void *handle) { abort(); }


x86 assembly (clang, -O0):
<dlclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<dlclose>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @dlclose(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @dlclose(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage() {
  printf("Usage: pck2tlx <input-file>\n");
  printf("Convert PocketTopo calibration file to TopoLinux format.\n");
  printf("Output is written to stdout. Redirect if needed.\n");
  printf("Input file is a calibration file exported by PocketTopo as text.\n");
}


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

x86 assembly (clang, -O2):
<Usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: pck2tlx <input-file>\0A\00"
@.str.1 = [58 x i8] c"Convert PocketTopo calibration file to TopoLinux format.\0A\00"
@.str.2 = [50 x i8] c"Output is written to stdout. Redirect if needed.\0A\00"
@.str.3 = [66 x i8] c"Input file is a calibration file exported by PocketTopo as text.\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Usage: pck2tlx <input-file>\00"
@str.4 = [57 x i8] c"Convert PocketTopo calibration file to TopoLinux format.\00"
@str.5 = [49 x i8] c"Output is written to stdout. Redirect if needed.\00"
@str.6 = [65 x i8] c"Input file is a calibration file exported by PocketTopo as text.\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int ntohl(int);
uint64_t little_endian_ntohll(uint64_t value) {
  const uint32_t high_part = ntohl(value >> 32);
  const uint32_t low_part = ntohl(value & 0xFFFFFFFFLL);
  return (((uint64_t)low_part << 32) | high_part);
}


x86 assembly (clang, -O0):
<little_endian_ntohll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <ntohl@plt>
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,%edi
call   1030 <ntohl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<little_endian_ntohll>:
push   %rbx
mov    %edi,%ebx
call   1030 <ntohl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @little_endian_ntohll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 32
%7 = call i32 @ntohl(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = and i64 %9, 4294967295
%11 = trunc i64 %10 to i32
%12 = call i32 @ntohl(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = shl i32 %13, 32
%15 = load i32, i32* %3
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @little_endian_ntohll(i32 %0) {
%2 = tail call i32 @ntohl(i32 poison)
%3 = tail call i32 @ntohl(i32 %0)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ write(int **);
void f() {
  int *a;
  write(&a);
  return;
}


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

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    %rsp,%rdi
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f() {
%1 = alloca i32*
%2 = call i32 @write(i32** %1)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @write(i32** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xda() {
  Assert_real((isdigit(218) == 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_isdigit.c",
              1095, ("isdigit should be 0 for 0xda"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xda>:
push   %rax
mov    $0xda,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x447,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xda\00"
define void @t_isdigit_0xda() {
%1 = call i64 @isdigit(i32 218)
%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 1095, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xda\00"
define void @t_isdigit_0xda() {
%1 = tail call i64 @isdigit(i32 218)
%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 1095, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fileinfo_list_link {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link(struct genlist const *, int);
struct fileinfo_list_link *fileinfo_list_link(const struct fileinfo_list *tthis,
                                              int index) {
  return ((struct fileinfo_list_link *)genlist_link(
      (const struct genlist *)tthis, index));
}


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

x86 assembly (clang, -O2):
<fileinfo_list_link>:
jmp    1030 <genlist_link@plt>

LLVM IR (-O0):
%struct.fileinfo_list_link = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_link(%struct.fileinfo_list* %0, i32 %1) {
%3 = alloca %struct.fileinfo_list*
%4 = alloca i32
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %3
store i32 %1, i32* %4
%5 = load %struct.fileinfo_list*, %struct.fileinfo_list** %3
%6 = bitcast %struct.fileinfo_list* %5 to %struct.genlist*
%7 = load i32, i32* %4
%8 = call i64 @genlist_link(%struct.genlist* %6, i32 %7)
%9 = inttoptr i64 %8 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %9
}

LLVM IR (-O2):
%struct.fileinfo_list_link = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo_list_link* @fileinfo_list_link(%struct.fileinfo_list* %0, i32 %1) {
%3 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%4 = tail call i64 @genlist_link(%struct.genlist* %3, i32 %1)
%5 = inttoptr i64 %4 to %struct.fileinfo_list_link*
ret %struct.fileinfo_list_link* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_line() { printf("====================================\n"); }


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

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

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

LLVM IR (-O2):
@str = [37 x i8] c"====================================\00"
define void @display_line() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
int lshift(int a, int b) {
  if (b == 0)
    return a;
  return a << b;
}


x86 assembly (clang, -O0):
<lshift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <lshift+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <lshift+0x2a>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lshift>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @lshift(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_71(void) {
  { a_0_55(((((21)))), "THEN?"); }
}


x86 assembly (clang, -O0):
<a_0_71>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_71>:
lea    0xee9(%rip),%rsi
mov    $0x15,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"THEN?\00"
define void @a_0_71() {
%1 = call i32 @a_0_55(i32 21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"THEN?\00"
define void @a_0_71() {
%1 = tail call i32 @a_0_55(i32 21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void JvConvertArgv(void) {}


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

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

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

LLVM IR (-O2):
define void @JvConvertArgv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ w(int /*<<< orphan*/);
void W(const char *_) {
  for (; *_; w(*_++))
    ;
}


x86 assembly (clang, -O0):
<W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <W+0x3a>
jmp    112e <W+0x1e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <w@plt>
jmp    111c <W+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<W>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <W+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <w@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <W+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @W(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @w(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
long SDHostCmdSend(unsigned long ulBase, unsigned long ulCmd, unsigned ulArg) {
  (*((volatile unsigned long *)(ulBase + 0x0000022C))) |= 0x000E0000;
  if (((*((volatile unsigned long *)(ulBase + 0x00000224))) & 0x1)) {
    return -1;
  }
  (*((volatile unsigned long *)(ulBase + 0x00000208))) = ulArg;
  (*((volatile unsigned long *)(ulBase + 0x0000020C))) = ulCmd;
  return 0;
}


x86 assembly (clang, -O0):
<SDHostCmdSend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x22c(%rax),%rcx
or     $0xe0000,%rcx
mov    %rcx,0x22c(%rax)
mov    -0x10(%rbp),%rax
mov    0x224(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     114e <SDHostCmdSend+0x4e>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1175 <SDHostCmdSend+0x75>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rcx,0x208(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x20c(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDHostCmdSend>:
orq    $0xe0000,0x22c(%rdi)
mov    0x224(%rdi),%rcx
mov    $0xffffffffffffffff,%rax
test   $0x1,%cl
jne    1130 <SDHostCmdSend+0x30>
mov    %edx,%eax
mov    %rax,0x208(%rdi)
mov    %rsi,0x20c(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @SDHostCmdSend(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i64, i64* %5
%9 = add i64 %8, 556
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 917504
store volatile i64 %12, i64* %10
%13 = load i64, i64* %5
%14 = add i64 %13, 548
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = and i64 %16, 1
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %3
store i64 -1, i64* %4
br label %30
20: ; preds = %3
%21 = load i32, i32* %7
%22 = zext i32 %21 to i64
%23 = load i64, i64* %5
%24 = add i64 %23, 520
%25 = inttoptr i64 %24 to i64*
store volatile i64 %22, i64* %25
%26 = load i64, i64* %6
%27 = load i64, i64* %5
%28 = add i64 %27, 524
%29 = inttoptr i64 %28 to i64*
store volatile i64 %26, i64* %29
store i64 0, i64* %4
br label %30
30: ; preds = %20, %19
%31 = load i64, i64* %4
ret i64 %31
}

LLVM IR (-O2):
define i64 @SDHostCmdSend(i64 %0, i64 %1, i32 %2) {
%4 = add i64 %0, 556
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 917504
store volatile i64 %7, i64* %5
%8 = add i64 %0, 548
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, 1
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = zext i32 %2 to i64
%15 = add i64 %0, 520
%16 = inttoptr i64 %15 to i64*
store volatile i64 %14, i64* %16
%17 = add i64 %0, 524
%18 = inttoptr i64 %17 to i64*
store volatile i64 %1, i64* %18
br label %19
19: ; preds = %3, %13
%20 = phi i64 [ 0, %13 ], [ -1, %3 ]
ret i64 %20
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};

/* Variables and functions */
int sockaddr_storage_size() { return sizeof(struct sockaddr_storage); }


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

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

LLVM IR (-O0):
define i32 @sockaddr_storage_size() {
ret i32 4
}

LLVM IR (-O2):
define i32 @sockaddr_storage_size() {
ret i32 4
}
/* Type definitions */
struct winsize {
  int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int tio_get_rows(void) {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_row;
}


x86 assembly (clang, -O0):
<tio_get_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_get_rows>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @tio_get_rows() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @tio_get_rows() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
double sgnd(double val) { return (0. < val) - (val < 0.); }


x86 assembly (clang, -O0):
<sgnd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgnd>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @sgnd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double 0.000000e+00, %3
%5 = zext i1 %4 to i32
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @sgnd(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt double %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int strlen(char s[]) {
  int i = 0;
  int len = 0;
  while (s[i++] != 0) {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1143 <strlen+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <strlen+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
double M_PI;
double to_degrees(double r) { return r * (180.0 / M_PI); }


x86 assembly (clang, -O0):
<to_degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_degrees>:
mov    0x2ee1(%rip),%rax
movsd  0xef1(%rip),%xmm1
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @to_degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double 1.800000e+02, %4
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @to_degrees(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double 1.800000e+02, %2
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ yogrt_set_interval1(int);
int iyogrt_set_interval1__(int *seconds) {
  yogrt_set_interval1(*seconds);
  return *seconds;
}


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

x86 assembly (clang, -O2):
<iyogrt_set_interval1__>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <yogrt_set_interval1@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iyogrt_set_interval1__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @yogrt_set_interval1(i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @iyogrt_set_interval1__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @yogrt_set_interval1(i32 %2)
%4 = load i32, i32* %0
ret i32 %4
}
void _initialize_ser_e7000pc() {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @_initialize_ser_e7000pc() {
ret void
}
/* Variables and functions */
scalar_t__ resample_interpolate_generic(unsigned int const);
int resample_interpolate8(const unsigned int channel) {
  return (int)resample_interpolate_generic(channel);
}


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

x86 assembly (clang, -O2):
<resample_interpolate8>:
jmp    1030 <resample_interpolate_generic@plt>

LLVM IR (-O0):
define i32 @resample_interpolate8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @resample_interpolate_generic(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @resample_interpolate8(i32 %0) {
%2 = tail call i64 @resample_interpolate_generic(i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *strdup(char *);
char *func2(void) { return strdup("foo"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i8* @func2() {
%1 = call i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define noalias i8* @func2() {
%1 = tail call dereferenceable_or_null(4) i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int hash(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word[201] = {0};
  int m = 0;
  scanf("%s", word);
  m = hash(word);
  printf("%d", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc9,%edx
call   1050 <memset@plt>
movl   $0x0,-0xd4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,-0xd4(%rbp)
mov    -0xd4(%rbp),%esi
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0xb9(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xe6f(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xe58(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [201 x i8]
%2 = getelementptr inbounds [201 x i8], [201 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int system(char *);
int main(void) { return system("x64sc.exe -sounddev dummy"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"x64sc.exe -sounddev dummy\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [26 x i8] c"x64sc.exe -sounddev dummy\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int speccost(int kill, int numamp, int amp) {
  return kill * 6 + (kill - 1) * 48 + numamp * (amp * 6 + (amp - 1) * 48);
}


x86 assembly (clang, -O0):
<speccost>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x6,-0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
imul   $0x30,%ecx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   $0x6,-0xc(%rbp),%edx
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
imul   $0x30,%esi,%esi
add    %esi,%edx
imul   %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<speccost>:
imul   $0x36,%edx,%eax
add    $0xffffffd0,%eax
imul   %esi,%eax
imul   $0x36,%edi,%ecx
add    %ecx,%eax
add    $0xffffffd0,%eax
ret

LLVM IR (-O0):
define i32 @speccost(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 6
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = mul nsw i32 %10, 48
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = mul nsw i32 %14, 6
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
%18 = mul nsw i32 %17, 48
%19 = add nsw i32 %15, %18
%20 = mul nsw i32 %13, %19
%21 = add nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @speccost(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %2, 54
%5 = add i32 %4, -48
%6 = mul nsw i32 %5, %1
%7 = mul i32 %0, 54
%8 = add i32 %7, -48
%9 = add i32 %8, %6
ret i32 %9
}
double ls_cost_nm9_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<ls_cost_nm9_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm9_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm9_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm9_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ a_dimension(int, int /*<<< orphan*/);
void op_dimlclp() { a_dimension(1, 0); }


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

x86 assembly (clang, -O2):
<op_dimlclp>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <a_dimension@plt>

LLVM IR (-O0):
define void @op_dimlclp() {
%1 = call i32 @a_dimension(i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @op_dimlclp() {
%1 = tail call i32 @a_dimension(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ traverse_file(char *);
void traverse_files(char **filelist, int count) {
  while (count > 0) {
    traverse_file(*filelist);
    ++filelist, --count;
  }
}


x86 assembly (clang, -O0):
<traverse_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114f <traverse_files+0x3f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <traverse_file@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <traverse_files+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traverse_files>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    1134 <traverse_files+0x24>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nop
mov    (%rbx),%rdi
call   1030 <traverse_file@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1120 <traverse_files+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @traverse_files(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ %1, %2 ]
%6 = phi i8** [ %9, %4 ], [ %0, %2 ]
%7 = load i8*, i8** %6
%8 = tail call i32 @traverse_file(i8* %7)
%9 = getelementptr inbounds i8*, i8** %6, i64 1
%10 = add nsw i32 %5, -1
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int test4u(unsigned char x) { return x / 100 <= 3; }


x86 assembly (clang, -O0):
<test4u>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x3,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test4u(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sdiv i32 %4, 100
%6 = icmp sle i32 %5, 3
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test4u(i8 zeroext %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void on_destroy() {
  fprintf(stderr, "Error: on_destroy called on proxy object\n");
  exit(ENOTSUP);
}


x86 assembly (clang, -O0):
<on_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<on_destroy>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Error: on_destroy called on proxy object\0A\00"
@ENOTSUP = global i32 0
define void @on_destroy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @ENOTSUP
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Error: on_destroy called on proxy object\0A\00"
@ENOTSUP = global i32 0
define void @on_destroy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @ENOTSUP
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int ArgNum();
scalar_t__ GetFlag(int);
int /*<<< orphan*/ SetFlag(int, scalar_t__);
void Act_SubF(void) {
  int a = ArgNum();
  SetFlag(a, GetFlag(a) - GetFlag(ArgNum()));
}


x86 assembly (clang, -O0):
<Act_SubF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <GetFlag@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edi
sub    %rax,%rsi
call   1030 <SetFlag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_SubF>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <GetFlag@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
sub    %rax,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SetFlag@plt>

LLVM IR (-O0):
define void @Act_SubF() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i64 @GetFlag(i32 %4)
%6 = call i32 (...) @ArgNum()
%7 = call i64 @GetFlag(i32 %6)
%8 = sub nsw i64 %5, %7
%9 = call i32 @SetFlag(i32 %3, i64 %8)
ret void
}

LLVM IR (-O2):
define void @Act_SubF() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i64 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = tail call i64 @GetFlag(i32 %3)
%5 = sub nsw i64 %2, %4
%6 = tail call i32 @SetFlag(i32 %1, i64 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
void BusLogic_Delay(int Seconds) { mdelay(1000 * Seconds); }


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

x86 assembly (clang, -O2):
<BusLogic_Delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <mdelay@plt>

LLVM IR (-O0):
define void @BusLogic_Delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @mdelay(i32 %4)
ret void
}

LLVM IR (-O2):
define void @BusLogic_Delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @mdelay(i32 %2)
ret void
}