xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xfd() {
  Assert_real((isascii(253) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1270, ("isascii should be 0 for 0xfd"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xfd\00"
define void @t_isascii_0xfd() {
%1 = call i64 @isascii(i32 253)
%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 1270, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xfd\00"
define void @t_isascii_0xfd() {
%1 = tail call i64 @isascii(i32 253)
%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 1270, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
short TMRnewTimer() {
  static short _tmrIdx = -1;
  if (_tmrIdx < (10 - 2))
    return ++_tmrIdx;
  else
    return -1;
}


x86 assembly (clang, -O0):
<TMRnewTimer>:
push   %rbp
mov    %rsp,%rbp
movswl 0x2f15(%rip),%eax
cmp    $0x8,%eax
jge    112f <TMRnewTimer+0x2f>
mov    0x2f05(%rip),%ax
add    $0x1,%ax
mov    %ax,0x2efa(%rip)
mov    %ax,-0x2(%rbp)
jmp    1135 <TMRnewTimer+0x35>
movw   $0xffff,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMRnewTimer>:
movzwl 0x2f19(%rip),%ecx
mov    $0xffff,%ax
cmp    $0x7,%cx
jg     111d <TMRnewTimer+0x1d>
add    $0x1,%ecx
mov    %cx,0x2f05(%rip)
mov    %ecx,%eax
ret

LLVM IR (-O0):
@TMRnewTimer._tmrIdx = internal global i16 -1
define signext i16 @TMRnewTimer() {
%1 = alloca i16
%2 = load i16, i16* @TMRnewTimer._tmrIdx
%3 = sext i16 %2 to i32
%4 = icmp slt i32 %3, 8
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i16, i16* @TMRnewTimer._tmrIdx
%7 = add i16 %6, 1
store i16 %7, i16* @TMRnewTimer._tmrIdx
store i16 %7, i16* %1
br label %9
8: ; preds = %0
store i16 -1, i16* %1
br label %9
9: ; preds = %8, %5
%10 = load i16, i16* %1
ret i16 %10
}

LLVM IR (-O2):
@TMRnewTimer._tmrIdx = internal unnamed_addr global i16 -1
define signext i16 @TMRnewTimer() {
%1 = load i16, i16* @TMRnewTimer._tmrIdx
%2 = icmp slt i16 %1, 8
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = add nsw i16 %1, 1
store i16 %4, i16* @TMRnewTimer._tmrIdx
br label %5
5: ; preds = %0, %3
%6 = phi i16 [ %4, %3 ], [ -1, %0 ]
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/);
char *read_input_line();
int /*<<< orphan*/ stdin;
void read_all_input_lines(void (*callback)(char *, void *), void *payload) {
  while (!feof(stdin)) {
    callback(read_input_line(), payload);
  }
}


x86 assembly (clang, -O0):
<read_all_input_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1153 <read_all_input_lines+0x33>
jmp    1174 <read_all_input_lines+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <read_input_line@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rsi
call   *%rax
jmp    1130 <read_all_input_lines+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_all_input_lines>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb6(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    115d <read_all_input_lines+0x3d>
xor    %eax,%eax
call   1030 <read_input_line@plt>
mov    %rax,%rdi
mov    %r14,%rsi
call   *%rbx
jmp    1140 <read_all_input_lines+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @read_all_input_lines(void (i8*, i8*)* %0, i8* %1) {
%3 = alloca void (i8*, i8*)*
%4 = alloca i8*
store void (i8*, i8*)* %0, void (i8*, i8*)** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %10, %2
%6 = load i32, i32* @stdin
%7 = call i32 @feof(i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load void (i8*, i8*)*, void (i8*, i8*)** %3
%12 = call i8* (...) @read_input_line()
%13 = load i8*, i8** %4
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @read_all_input_lines(void (i8*, i8*)* nocapture %0, i8* %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @feof(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = tail call i8* (...) @read_input_line()
tail call void %0(i8* %7, i8* %1)
%8 = load i32, i32* @stdin
%9 = tail call i32 @feof(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void sort(int *array, int from_idx, int to_idx) {
  int mid = 0;
  if (from_idx < to_idx) {
    mid = (from_idx + to_idx) / 2;
    sort(array, from_idx, mid);
    sort(array, mid + 1, to_idx);
    merge(array, from_idx, mid, to_idx);
  }
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1189 <sort+0x69>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    %edx,%esi
jge    1172 <sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @sort(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
store i32 0, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
void cygwin_premain2(int argc, char **argv) {}


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

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

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

LLVM IR (-O2):
define void @cygwin_premain2(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void list_free_dfl(void *data) { free(data); }


x86 assembly (clang, -O0):
<list_free_dfl>:
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):
<list_free_dfl>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @list_free_dfl(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 @list_free_dfl(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
__attribute__((fastcall)) void strreverse(char *begin, char *end) {
  char aux;
  while (end > begin)
    aux = *end, *end-- = *begin, *begin++ = aux;
}


x86 assembly (clang, -O0):
<strreverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1153 <strreverse+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strreverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreverse>:
cmp    %rdi,%rsi
jbe    112c <strreverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl 0x1(%rsi),%eax
movzbl (%rdi),%ecx
mov    %cl,0x1(%rsi)
mov    %al,(%rdi)
add    $0x1,%rdi
lea    -0x1(%rsi),%rax
cmp    %rdi,%rsi
mov    %rax,%rsi
ja     1110 <strreverse+0x10>
ret

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

LLVM IR (-O2):
define void @strreverse(i8* %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i8* [ %9, %4 ], [ %1, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %8, i8* %6
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%11 = icmp ugt i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
float __nv_fast_tanf(float);
float __tanf(float __a) { return __nv_fast_tanf(__a); }


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

x86 assembly (clang, -O2):
<__tanf>:
jmp    1030 <__nv_fast_tanf@plt>

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

LLVM IR (-O2):
define float @__tanf(float %0) {
%2 = tail call float @__nv_fast_tanf(float %0)
ret float %2
}
/* Type definitions */
typedef scalar_t__ register_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_write;
int /*<<< orphan*/ assert(int);
scalar_t__ inject_syscall(int /*<<< orphan*/, int, int /*<<< orphan*/, int,
                          void const *, size_t);
void write_i(pid_t pid, int fd, const void *buf, size_t nbyte) {
  register_t ret = inject_syscall(pid, 3, SYS_write, fd, buf, nbyte);
  assert((int)ret >= 0);
}


x86 assembly (clang, -O0):
<write_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x3,%esi
call   1040 <inject_syscall@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_i>:
push   %rax
mov    %rcx,%r9
mov    %rdx,%r8
mov    %esi,%ecx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1040 <inject_syscall@plt>
not    %eax
shr    $0x1f,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@SYS_write = global i32 0
define void @write_i(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i32, i32* %5
%11 = load i32, i32* @SYS_write
%12 = load i32, i32* %6
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = call i64 @inject_syscall(i32 %10, i32 3, i32 %11, i32 %12, i8* %13, i64 %14)
store i64 %15, i64* %9
%16 = load i64, i64* %9
%17 = trunc i64 %16 to i32
%18 = icmp sge i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@SYS_write = global i32 0
define void @write_i(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = load i32, i32* @SYS_write
%6 = tail call i64 @inject_syscall(i32 %0, i32 3, i32 %5, i32 %1, i8* %2, i64 %3)
%7 = trunc i64 %6 to i32
%8 = xor i32 %7, -1
%9 = lshr i32 %8, 31
%10 = tail call i32 @assert(i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t _write(int a, const void *b, size_t c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() { printf("%d%d%d\n", 1, 2, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d%d%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
double atan2(int /*<<< orphan*/, double);
int /*<<< orphan*/ sqrt(double);
double acos(double __x) { return atan2(sqrt(1.0 - __x * __x), __x); }


x86 assembly (clang, -O0):
<acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acos>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @acos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = call i32 @sqrt(double %6)
%8 = load double, double* %2
%9 = call double @atan2(i32 %7, double %8)
ret double %9
}

LLVM IR (-O2):
define double @acos(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = tail call i32 @sqrt(double %3)
%5 = tail call double @atan2(i32 %4, double %0)
ret double %5
}
/* Variables and functions */
int __ffs(unsigned long const);
__attribute__((always_)) int sched_find_first_bit(const unsigned long *b) {
  if (b[0])
    return __ffs(b[0]);
  return __ffs(b[1]) + 64;
}


x86 assembly (clang, -O0):
<sched_find_first_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <sched_find_first_bit+0x2e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <__ffs@plt>
mov    %eax,-0x4(%rbp)
jmp    1151 <sched_find_first_bit+0x41>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <__ffs@plt>
add    $0x40,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_find_first_bit>:
push   %rax
mov    (%rdi),%rax
test   %rax,%rax
je     1122 <sched_find_first_bit+0x12>
mov    %rax,%rdi
pop    %rax
jmp    1030 <__ffs@plt>
mov    0x8(%rdi),%rdi
call   1030 <__ffs@plt>
add    $0x40,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sched_find_first_bit(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @__ffs(i64 %2)
br label %11
6: ; preds = %1
%7 = getelementptr inbounds i64, i64* %0, i64 1
%8 = load i64, i64* %7
%9 = tail call i32 @__ffs(i64 %8)
%10 = add nsw i32 %9, 64
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ %5, %4 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xeb() {
  Assert_real((isprint(235) == 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_isprint.c",
              1180, ("isprint should be 0 for 0xeb"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xeb\00"
define void @t_isprint_0xeb() {
%1 = call i64 @isprint(i32 235)
%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 1180, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xeb\00"
define void @t_isprint_0xeb() {
%1 = tail call i64 @isprint(i32 235)
%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 1180, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memset(void *, int, size_t);
void xfree(void *p, size_t size) {
  if (p) {
    memset(p, 0xfd, size);
    free(p);
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1156 <xfree+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xfd,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     113f <xfree+0x1f>
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    $0xfd,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @memset(i8* %8, i32 253, i64 %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @memset(i8* %0, i32 253, i64 %1)
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %4, %2
ret void
}
int test_imm_38uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x38 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_38uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x38,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_38uint64_highword_reg>:
movabs $0x3800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_38uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 240518168576
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void RTAvlrUIntPtrRangeRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrUIntPtrRangeRemove() {
ret void
}
double exponential(double k, int n) {
  if (n == 0) {
    return 1;
  } else if (n > 0) {
    return k * exponential(k, --n);
  } else {
    return 1 / exponential(k, -n);
  }
}


x86 assembly (clang, -O0):
<exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113c <exponential+0x2c>
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <exponential+0x8c>
cmpl   $0x0,-0x14(%rbp)
jle    1179 <exponential+0x69>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x14(%rbp)
call   1030 <exponential@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <exponential+0x8c>
movsd  -0x10(%rbp),%xmm0
xor    %edi,%edi
sub    -0x14(%rbp),%edi
call   1030 <exponential@plt>
movaps %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential>:
push   %rax
test   %edi,%edi
je     112b <exponential+0x1b>
jle    1135 <exponential+0x25>
add    $0xffffffff,%edi
movsd  %xmm0,(%rsp)
call   1030 <exponential@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xecd(%rip),%xmm0
pop    %rax
ret
neg    %edi
call   1030 <exponential@plt>
movapd %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @exponential(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store double 1.000000e+00, double* %3
br label %25
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load double, double* %4
%14 = load double, double* %4
%15 = load i32, i32* %5
%16 = add nsw i32 %15, -1
store i32 %16, i32* %5
%17 = call double @exponential(double %14, i32 %16)
%18 = fmul double %13, %17
store double %18, double* %3
br label %25
19: ; preds = %9
%20 = load double, double* %4
%21 = load i32, i32* %5
%22 = sub nsw i32 0, %21
%23 = call double @exponential(double %20, i32 %22)
%24 = fdiv double 1.000000e+00, %23
store double %24, double* %3
br label %25
25: ; preds = %19, %12, %8
%26 = load double, double* %3
ret double %26
}

LLVM IR (-O2):
define double @exponential(double %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %8, label %12
6: ; preds = %2, %12, %8
%7 = phi double [ %11, %8 ], [ %15, %12 ], [ 1.000000e+00, %2 ]
ret double %7
8: ; preds = %4
%9 = add nsw i32 %1, -1
%10 = tail call double @exponential(double %0, i32 %9)
%11 = fmul double %10, %0
br label %6
12: ; preds = %4
%13 = sub nsw i32 0, %1
%14 = tail call double @exponential(double %0, i32 %13)
%15 = fdiv double 1.000000e+00, %14
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b, c;
  a = 0;
  b = 1;
  c = 3;
  a = b + c;
  b = 3;
  c = 5;
  test_assert(a == 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 3, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 4
%10 = zext i1 %9 to i32
%11 = call i32 @test_assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
int abs(int i) {
  if (i >= 0)
    return i;
  return -i;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <abs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int get_value_of_continuation_parameter(int k, double *val) {
  int *b, fail;
  fail = _ada_use_c2phc(189, &k, b, val);
  return fail;
}


x86 assembly (clang, -O0):
<get_value_of_continuation_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0xbd,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value_of_continuation_parameter>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xbd,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%7 = load i32*, i32** %5
%8 = load double*, double** %4
%9 = call i32 @_ada_use_c2phc(i32 189, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 189, i32* %3, i32* undef, double* %1)
ret i32 %4
}
int not(int s[]) {
  if (s[0] >= 0) {
    s[0] = -1;
  } else
    s[0] = 0;
  return (s[0]);
}


x86 assembly (clang, -O0):
<not>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jl     1124 <not+0x24>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    112e <not+0x2e>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not>:
mov    (%rdi),%eax
sar    $0x1f,%eax
not    %eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @not(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 31
%4 = xor i32 %3, -1
store i32 %4, i32* %0
ret i32 %4
}
/* Variables and functions */
double rt_powd_snf(double, double);
double mpower(double a, double b) { return rt_powd_snf(a, b); }


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

x86 assembly (clang, -O2):
<mpower>:
jmp    1030 <rt_powd_snf@plt>

LLVM IR (-O0):
define double @mpower(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @rt_powd_snf(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @mpower(double %0, double %1) {
%3 = tail call double @rt_powd_snf(double %0, double %1)
ret double %3
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_50(int Salt, int Parameter) {
  unsigned b = Salt * 0x1EDC0BA3 + 0x7531;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x1edc0ba3,-0x4(%rbp),%eax
add    $0x7531,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_50>:
imul   $0x1edc0ba3,%edi,%edi
add    $0x7531,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_50(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* %3
%7 = mul nsw i32 %6, 517737379
%8 = add nsw i32 %7, 30001
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_50(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 517737379
%4 = add nsw i32 %3, 30001
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *memalign(int, size_t);
__attribute__((unused)) void *memalign32(size_t szB) {
  void *x;
  x = memalign(32, szB);
  assert(x);
  assert(0 == ((32 - 1) & (unsigned long)x));
  return x;
}


x86 assembly (clang, -O0):
<memalign32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1040 <memalign@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalign32>:
push   %rbx
mov    %rdi,%rsi
mov    $0x20,%edi
call   1040 <memalign@plt>
mov    %rax,%rbx
mov    %ebx,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @memalign32(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @memalign(i32 32, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %3
%10 = ptrtoint i8* %9 to i64
%11 = and i64 31, %10
%12 = icmp eq i64 0, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @memalign32(i64 %0) {
%2 = tail call align 32 i8* @memalign(i32 32, i64 %0)
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @assert(i32 1)
ret i8* %2
}
unsigned int swapword(unsigned int w) {
  unsigned int r;
  int i = 0x12345678;
  if (*((char *)(&i)) == 0x78) {
    r = (w & 0xff) << 24;
    r += (w & 0xff00) << 8;
    r += (w & 0xff0000) >> 8;
    r += (w & 0xff000000) >> 24;
    return r;
  } else
    return w;
}


x86 assembly (clang, -O0):
<swapword>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x12345678,-0x10(%rbp)
movsbl -0x10(%rbp),%eax
cmp    $0x78,%eax
jne    1167 <swapword+0x67>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff00,%eax
shl    $0x8,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff0000,%eax
shr    $0x8,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <swapword+0x6d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapword>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swapword(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 305419896, i32* %5
%6 = bitcast i32* %5 to i8*
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 120
br i1 %9, label %10, label %30
10: ; preds = %1
%11 = load i32, i32* %3
%12 = and i32 %11, 255
%13 = shl i32 %12, 24
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = and i32 %14, 65280
%16 = shl i32 %15, 8
%17 = load i32, i32* %4
%18 = add i32 %17, %16
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = and i32 %19, 16711680
%21 = lshr i32 %20, 8
%22 = load i32, i32* %4
%23 = add i32 %22, %21
store i32 %23, i32* %4
%24 = load i32, i32* %3
%25 = and i32 %24, -16777216
%26 = lshr i32 %25, 24
%27 = load i32, i32* %4
%28 = add i32 %27, %26
store i32 %28, i32* %4
%29 = load i32, i32* %4
store i32 %29, i32* %2
br label %32
30: ; preds = %1
%31 = load i32, i32* %3
store i32 %31, i32* %2
br label %32
32: ; preds = %30, %10
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @swapword(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int pthread_rwlock_timedwrlock(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) {
  return pthread_rwlock_timedwrlock(rwlock, NULL);
}


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

x86 assembly (clang, -O2):
<pthread_rwlock_wrlock>:
xor    %esi,%esi
jmp    1030 <pthread_rwlock_timedwrlock@plt>

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

LLVM IR (-O2):
define i32 @pthread_rwlock_wrlock(i32* %0) {
%2 = tail call i32 @pthread_rwlock_timedwrlock(i32* %0, i32* null)
ret i32 %2
}
void si_keyboard_handler(char keycode) {}


x86 assembly (clang, -O0):
<si_keyboard_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @si_keyboard_handler(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
ret void
}

LLVM IR (-O2):
define void @si_keyboard_handler(i8 signext %0) {
ret void
}
unsigned char fn4(unsigned char a) { return a >> 0xff03; }


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xff03,%ecx
sar    %cl,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @fn4(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 65283
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @fn4(i8 zeroext %0) {
ret i8 poison
}
extern unsigned long readw(unsigned long addr) {
  long result =
      *(volatile int *)((addr << 5) + ((0xfffffc0000000000UL) + 0x200000000UL) +
                        0x08);
  result >>= (addr & 3) * 8;
  return 0xffffUL & result;
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
movabs $0xfffffc0200000000,%rcx
fc ff ff
add    %rcx,%rax
mov    0x8(%rax),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
and    $0x3,%rcx
shl    $0x3,%rcx
mov    -0x10(%rbp),%rax
sar    %cl,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
lea    0x0(,%rdi,8),%ecx
shl    $0x5,%rdi
movabs $0xfffffc0200000008,%rax
fc ff ff
movslq (%rdi,%rax,1),%rax
and    $0x18,%cl
sar    %cl,%rax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i64 @readw(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = shl i64 %4, 5
%6 = add i64 %5, -4389456576512
%7 = add i64 %6, 8
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %2
%12 = and i64 %11, 3
%13 = mul i64 %12, 8
%14 = load i64, i64* %3
%15 = ashr i64 %14, %13
store i64 %15, i64* %3
%16 = load i64, i64* %3
%17 = and i64 65535, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @readw(i64 %0) {
%2 = shl i64 %0, 5
%3 = add i64 %2, -4389456576504
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = sext i32 %5 to i64
%7 = shl i64 %0, 3
%8 = and i64 %7, 24
%9 = ashr i64 %6, %8
%10 = and i64 %9, 65535
ret i64 %10
}
void gtk_widget_child_notify() {}


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

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

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

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

/* Variables and functions */
char board_merge_up(struct board *);
char board_shift_up(struct board *);
int board_move_up(struct board *board) {
  char a = board_merge_up(board);
  return a | board_shift_up(board);
}


x86 assembly (clang, -O0):
<board_move_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <board_merge_up@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <board_shift_up@plt>
mov    %al,%cl
mov    -0x10(%rbp),%eax
movsbl %cl,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_move_up>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <board_merge_up@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <board_shift_up@plt>
or     %bpl,%al
movsbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.board = type { i32 }
define i32 @board_move_up(%struct.board* %0) {
%2 = alloca %struct.board*
%3 = alloca i8
store %struct.board* %0, %struct.board** %2
%4 = load %struct.board*, %struct.board** %2
%5 = call signext i8 @board_merge_up(%struct.board* %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load %struct.board*, %struct.board** %2
%9 = call signext i8 @board_shift_up(%struct.board* %8)
%10 = sext i8 %9 to i32
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.board = type { i32 }
define i32 @board_move_up(%struct.board* %0) {
%2 = tail call signext i8 @board_merge_up(%struct.board* %0)
%3 = tail call signext i8 @board_shift_up(%struct.board* %0)
%4 = or i8 %3, %2
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int main(int argc, char **argv) {
  int i;
  i = argc;
  while (--i > 0) {
    ft_putstr(argv[i]);
    ft_putchar('\n');
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    116e <main+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
jmp    113c <main+0x1c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1160 <main+0x40>
mov    %rsi,%r14
mov    %edi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @ft_putstr(i8* %11)
%13 = tail call i32 @ft_putchar(i8 signext 10)
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret i32 0
}