xunge/DecIR huggingface dataset:
/* Variables and functions */
int __tzcnt_u64(int /*<<< orphan*/);
int /*<<< orphan*/ link_error();
int main() {
  if (__tzcnt_u64(0) != 64)
    link_error();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <__tzcnt_u64@plt>
cmp    $0x40,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1040 <link_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <__tzcnt_u64@plt>
cmp    $0x40,%eax
je     1134 <main+0x14>
xor    %eax,%eax
call   1040 <link_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @__tzcnt_u64(i32 0)
%3 = icmp ne i32 %2, 64
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @link_error()
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__tzcnt_u64(i32 0)
%2 = icmp eq i32 %1, 64
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @link_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
float acoshf(float);
float __ocl_acosh_float(float src) { return acoshf(src); }


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

x86 assembly (clang, -O2):
<__ocl_acosh_float>:
jmp    1030 <acoshf@plt>

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

LLVM IR (-O2):
define float @__ocl_acosh_float(float %0) {
%2 = tail call float @acoshf(float %0)
ret float %2
}
int lirc_client_cmp(const void *client1, const void *client2) {
  return (client1 == client2) ? 0 : -1;
}


x86 assembly (clang, -O0):
<lirc_client_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lirc_client_cmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @lirc_client_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @lirc_client_cmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_nop(char *str) { sprintf(str, "NOP                             "); }


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

x86 assembly (clang, -O2):
<sprint_nop>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"NOP \00"
define void @sprint_nop(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
int core_atomic_compare_and_swap_int_mock(int *pointer, int old_value,
                                          int new_value) {
  if (*pointer != old_value) {
    return *pointer;
  }
  *pointer = new_value;
  return old_value;
}


x86 assembly (clang, -O0):
<core_atomic_compare_and_swap_int_mock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
je     112b <core_atomic_compare_and_swap_int_mock+0x2b>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <core_atomic_compare_and_swap_int_mock+0x3a>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_atomic_compare_and_swap_int_mock>:
mov    (%rdi),%eax
cmp    %esi,%eax
jne    110a <core_atomic_compare_and_swap_int_mock+0xa>
mov    %edx,(%rdi)
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @core_atomic_compare_and_swap_int_mock(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 %2, i32* %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ %1, %6 ], [ %4, %3 ]
ret i32 %8
}
void plugin_exit_w1retap(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_w1retap() {
ret void
}
void usage(char *exec) {
  int length = 0;
  length = (int)strlen(exec) + 7;
  printf("Usage: %s -d [\"<date>\"]\n", exec);
  printf("%*s -h\n", length, " ");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
lea    0xebc(%rip),%rdx
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x7(%rax),%ebp
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0xed4(%rip),%rdx
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: %s -d [\22<date>\22]\0A\00"
@.str.1 = [8 x i8] c"%*s -h\0A\00"
@.str.2 = [2 x i8] c" \00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, 7
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s -d [\22<date>\22]\0A\00"
@.str.1 = [8 x i8] c"%*s -h\0A\00"
@.str.2 = [2 x i8] c" \00"
define void @usage(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add nsw i32 %3, 7
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
free_2d_array(array, N) char **array;
int N;
{
  register int i;
  for (i = 0; i < N; i++)
    free(array[i]);
  free((char *)array);
}


x86 assembly (clang, -O0):
<free_2d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1151 <free_2d_array+0x41>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <free_2d_array+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2d_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2d_array+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2d_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define i32 @free_2d_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret i32 undef
}
int test_imm_BFuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xBF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BFuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 191
%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_BFuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 191
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strncmp(char const *, char const *, size_t);
int jw_strncmp(const char *a, const char *b, size_t n) {
  if (a == b) {
    return 0;
  }
  if (a == NULL) {
    return -1;
  }
  if (b == NULL) {
    return 1;
  }
  return strncmp(a, b, n);
}


x86 assembly (clang, -O0):
<jw_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113e <jw_strncmp+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1180 <jw_strncmp+0x70>
cmpq   $0x0,-0x10(%rbp)
jne    1155 <jw_strncmp+0x45>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <jw_strncmp+0x70>
cmpq   $0x0,-0x18(%rbp)
jne    116c <jw_strncmp+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1180 <jw_strncmp+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jw_strncmp>:
cmp    %rsi,%rdi
je     1124 <jw_strncmp+0x14>
test   %rdi,%rdi
je     1127 <jw_strncmp+0x17>
test   %rsi,%rsi
je     112d <jw_strncmp+0x1d>
jmp    1030 <strncmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @jw_strncmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp eq i8* %0, null
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i8* %1, null
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @strncmp(i8* %0, i8* %1, i64 %2)
br label %11
11: ; preds = %7, %5, %3, %9
%12 = phi i32 [ %10, %9 ], [ 0, %3 ], [ -1, %5 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "grep"
        " [-Einqsv][file...]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: grep [-Einqsv][file...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: grep [-Einqsv][file...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
double spechum2mixr(double spechum) {
  double mixr;
  mixr = spechum / (1.0 - spechum);
  return (mixr);
}


x86 assembly (clang, -O0):
<spechum2mixr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<spechum2mixr>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @spechum2mixr(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fdiv double %4, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @spechum2mixr(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fdiv double %0, %2
ret double %3
}
void socket_exit() {}


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

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

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

LLVM IR (-O2):
define void @socket_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char ch[81], string[81];
  gets(ch);
  fun(ch, string);
  printf("%s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x60(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1030 <fun@plt>
lea    -0xc0(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xb8,%rsp
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fun@plt>
lea    0xea4(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = alloca [81 x i8]
%3 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %3)
%6 = call i32 @fun(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int pos_(const char *str, char c) {
  size_t i;
  i = 0;
  while (str[i] != 0) {
    if (str[i] == c) {
      return i;
    }
    i++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<pos_>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <pos_+0x60>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114f <pos_+0x4f>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1167 <pos_+0x67>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1116 <pos_+0x16>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <pos_+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <pos_+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <pos_+0x10>
ret
mov    %ecx,%eax
ret

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

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

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_event_source_set_time(void *s, uint64_t usec) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_source_set_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_source_set_time>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_source_set_time(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_source_set_time(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int MaskForNum(int num) {
  if (num == 128)
    return 127;
  if (num == 64)
    return 63;
  if (num == 32)
    return 31;
  if (num == 16)
    return 15;
  return 255;
}


x86 assembly (clang, -O0):
<MaskForNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jne    1120 <MaskForNum+0x20>
movl   $0x7f,-0x4(%rbp)
jmp    1169 <MaskForNum+0x69>
cmpl   $0x40,-0x8(%rbp)
jne    1136 <MaskForNum+0x36>
movl   $0x3f,-0x4(%rbp)
jmp    1169 <MaskForNum+0x69>
cmpl   $0x20,-0x8(%rbp)
jne    114c <MaskForNum+0x4c>
movl   $0x1f,-0x4(%rbp)
jmp    1169 <MaskForNum+0x69>
cmpl   $0x10,-0x8(%rbp)
jne    1162 <MaskForNum+0x62>
movl   $0xf,-0x4(%rbp)
jmp    1169 <MaskForNum+0x69>
movl   $0xff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MaskForNum>:
add    $0xfffffff0,%edi
rol    $0x1c,%edi
mov    $0xff,%eax
cmp    $0x7,%edi
ja     111d <MaskForNum+0x1d>
movslq %edi,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @MaskForNum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 127, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 64
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 63, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 32
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 31, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 16
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 15, i32* %2
br label %20
19: ; preds = %15
store i32 255, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@switch.table.MaskForNum = [8 x i32] [i32 15, i32 31, i32 255, i32 63, i32 255, i32 255, i32 255, i32 127]
define i32 @MaskForNum(i32 %0) {
%2 = add i32 %0, -16
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 28)
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.MaskForNum, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 255, %1 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int setegid(__gid_t gid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<setegid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setegid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @setegid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @setegid(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
time_t time(time_t *t) {
  if (t)
    *t = -1;
  return -1;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111d <time+0x1d>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
test   %rdi,%rdi
je     110b <time+0xb>
movl   $0xffffffff,(%rdi)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @time(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32*, i32** %2
store i32 -1, i32* %6
br label %7
7: ; preds = %5, %1
ret i32 -1
}

LLVM IR (-O2):
define i32 @time(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i32 -1, i32* %0
br label %4
4: ; preds = %3, %1
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strstr(char *, char *);
int response_remove(char *buffer, char *spec) {
  char *pch;
  if (buffer[0] != 2)
    return -1;
  buffer += 8;
  pch = strstr(buffer, "\r\n");
  *pch = '\0';
  strcpy(spec, buffer);
  return 0;
}


x86 assembly (clang, -O0):
<response_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2,%eax
je     114c <response_remove+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <response_remove+0x67>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<response_remove>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%eax
cmpb   $0x2,(%rdi)
jne    1157 <response_remove+0x37>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strstr@plt>
movb   $0x0,(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define i32 @response_remove(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = tail call i8* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8 0, i8* %7
%8 = tail call i32 @strcpy(i8* %1, i8* %6)
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %10
}
int cmpFunc(const void *v1, const void *v2) {
  double i1 = **(const double **)v1;
  double i2 = **(const double **)v2;
  if (i1 > i2)
    return 1;
  else if (i1 == i2)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<cmpFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1148 <cmpFunc+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1171 <cmpFunc+0x71>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    116a <cmpFunc+0x6a>
jp     116a <cmpFunc+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <cmpFunc+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpFunc>:
mov    (%rdi),%rax
movsd  (%rax),%xmm0
mov    (%rsi),%rax
movsd  (%rax),%xmm1
ucomisd %xmm1,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rcx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpFunc(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double**
%10 = load double*, double** %9
%11 = load double, double* %10
store double %11, double* %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to double**
%14 = load double*, double** %13
%15 = load double, double* %14
store double %15, double* %7
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fcmp ogt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 1, i32* %3
br label %26
20: ; preds = %2
%21 = load double, double* %6
%22 = load double, double* %7
%23 = fcmp oeq double %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 0, i32* %3
br label %26
25: ; preds = %20
store i32 -1, i32* %3
br label %26
26: ; preds = %25, %24, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmpFunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double**
%4 = load double*, double** %3
%5 = load double, double* %4
%6 = bitcast i8* %1 to double**
%7 = load double*, double** %6
%8 = load double, double* %7
%9 = fcmp ogt double %5, %8
%10 = fcmp une double %5, %8
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xb0() {
  Assert_real((isascii(176) == 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",
              885, ("isascii should be 0 for 0xb0"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xb0>:
push   %rax
mov    $0xb0,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x375,%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 0xb0\00"
define void @t_isascii_0xb0() {
%1 = call i64 @isascii(i32 176)
%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 885, 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 0xb0\00"
define void @t_isascii_0xb0() {
%1 = tail call i64 @isascii(i32 176)
%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 885, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
long lround(long double value) {
  long intpart = value;
  value -= intpart;
  if (value >= 0.5)
    intpart++;
  return intpart;
}


x86 assembly (clang, -O0):
<lround>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x2a(%rbp)
movzwl -0x2a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x2c(%rbp)
fldcw  -0x2c(%rbp)
fistpll -0x28(%rbp)
fldcw  -0x2a(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
fildll -0x20(%rbp)
fldt   -0x10(%rbp)
fsubp  %st,%st(1)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeb6(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     1167 <lround+0x67>
jmp    115b <lround+0x5b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lround>:
fldt   0x8(%rsp)
fnstcw -0x14(%rsp)
movzwl -0x14(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x12(%rsp)
fldcw  -0x12(%rsp)
fld    %st(0)
fistpll -0x10(%rsp)
fldcw  -0x14(%rsp)
mov    -0x10(%rsp),%rax
mov    %rax,-0x8(%rsp)
fildll -0x8(%rsp)
fsubrp %st,%st(1)
flds   0xec5(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @lround(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = fptosi x86_fp80 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to x86_fp80
%8 = load x86_fp80, x86_fp80* %2
%9 = fsub x86_fp80 %8, %7
store x86_fp80 %9, x86_fp80* %2
%10 = load x86_fp80, x86_fp80* %2
%11 = fcmp oge x86_fp80 %10, 0xK3FFE8000000000000000
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
br label %15
15: ; preds = %12, %1
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @lround(x86_fp80 %0) {
%2 = fptosi x86_fp80 %0 to i64
%3 = sitofp i64 %2 to x86_fp80
%4 = fsub x86_fp80 %0, %3
%5 = fcmp oge x86_fp80 %4, 0xK3FFE8000000000000000
%6 = zext i1 %5 to i64
%7 = add nsw i64 %6, %2
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
time_t mymktime(struct tm t) { return mktime(&t); }


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

x86 assembly (clang, -O2):
<mymktime>:
push   %rax
mov    %edi,(%rsp)
mov    %rsp,%rdi
call   1030 <mktime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @mymktime(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = call i32 @mktime(%struct.tm* %2)
ret i32 %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @mymktime(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i64 0, i32 0
store i32 %0, i32* %3
%4 = call i32 @mktime(%struct.tm* %2)
ret i32 %4
}
int Binary(unsigned char c) {
  if (c == 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<Binary>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1123 <Binary+0x23>
movl   $0x0,-0x4(%rbp)
jmp    112a <Binary+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Binary>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @Binary(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @Binary(i8 zeroext %0) {
%2 = icmp ne i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void gtk_tool_button_set_icon_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_button_set_icon_widget() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void loop() { exit(system("id")); }


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<loop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"id\00"
define void @loop() {
%1 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"id\00"
define void @loop() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 %1)
unreachable
}
void GE2D_Done() {}


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

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

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

LLVM IR (-O2):
define void @GE2D_Done() {
ret void
}
unsigned char inb(unsigned short port) {
  unsigned char ret;
  asm volatile("inb $1, %0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     $0x1,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $$1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $$1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vector_2_x();
int main() {
  vector_2_x();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vector_2_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
#pragma omp parallel
  {
    int id = omp_get_thread_num();
    int nthreads = omp_get_num_threads();
    printf("Hello world from thread %d of %d\n", id, nthreads);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Hello world from thread %d of %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %2
%5 = call i32 (...) @omp_get_num_threads()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Hello world from thread %d of %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 (...) @omp_get_num_threads()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
int ret3(int a0, int a1, int a2, int a3, int a4, int a5) { return a3; }


x86 assembly (clang, -O0):
<ret3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ret3>:
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ret3(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i32, i32* %10
ret i32 %13
}

LLVM IR (-O2):
define i32 @ret3(i32 %0, i32 %1, i32 %2, i32 returned %3, i32 %4, i32 %5) {
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main() {
  int i = 10;
  printf("%p\n", &i);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
int test_any_one(unsigned x) { return (x != 0); }


x86 assembly (clang, -O0):
<test_any_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_any_one>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test_any_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_any_one(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_21int64_highword_reg(long long val) {
  return ((val >> 32) & (0x21 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_21int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 33
%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_21int64_highword_reg(i64 %0) {
%2 = and i64 %0, 141733920768
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void f_conv(char *arg) {
  fprintf(stderr, "conv option disabled\n");
  exit(1);
}


x86 assembly (clang, -O0):
<f_conv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"conv option disabled\0A\00"
define void @f_conv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"conv option disabled\0A\00"
define void @f_conv(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_8Duint16_reg(unsigned short val) {
  return ((val) & (-0x8D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Duint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Duint16_reg>:
test   $0xff73,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Duint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -141
%6 = icmp ne i32 %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_8Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -141
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}