xunge/DecIR huggingface dataset:
char *strcat(char *dest, const char *src) {
  char *out = dest;
  while (*dest)
    dest++;
  while ((*dest++ = *src++)) {
  }
  return out;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
char *create_clone_filename_get_clone_folder_filename(char *, char **, char *,
                                                      char *, char *, char *);
char *create_clone_filename_get_shell_script_filename(
    char *destination, char **directory_name, char *application_name,
    char *appaserver_data_directory, char *folder_name) {
  return create_clone_filename_get_clone_folder_filename(
      destination, directory_name, application_name, appaserver_data_directory,
      folder_name, "shell_script");
}


x86 assembly (clang, -O0):
<create_clone_filename_get_shell_script_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xeb9(%rip),%r9
call   1030 <create_clone_filename_get_clone_folder_filename@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_clone_filename_get_shell_script_filename>:
lea    0xee9(%rip),%r9
jmp    1030 <create_clone_filename_get_clone_folder_filename@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"shell_script\00"
define i8* @create_clone_filename_get_shell_script_filename(i8* %0, i8** %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8**, i8*** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i8* @create_clone_filename_get_clone_folder_filename(i8* %11, i8** %12, i8* %13, i8* %14, i8* %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %16
}

LLVM IR (-O2):
@.str = [13 x i8] c"shell_script\00"
define i8* @create_clone_filename_get_shell_script_filename(i8* %0, i8** %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i8* @create_clone_filename_get_clone_folder_filename(i8* %0, i8** %1, i8* %2, i8* %3, i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %6
}
char test_68_0(char *mem) { return __atomic_xor_fetch(mem + 4, -1, 4); }


x86 assembly (clang, -O0):
<test_68_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    0x4(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    1152 <test_68_0+0x52>
jmp    1127 <test_68_0+0x27>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
xor    %cl,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_68_0>:
mov    0x4(%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
not    %cl
lock cmpxchg %cl,0x4(%rdi)
jne    1110 <test_68_0+0x10>
not    %al
ret

LLVM IR (-O0):
define signext i8 @test_68_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 4
store i8 -1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw xor i8* %6, i8 %7 acq_rel
%9 = xor i8 %8, %7
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @test_68_0(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = atomicrmw xor i8* %2, i8 -1 acq_rel
%4 = xor i8 %3, -1
ret i8 %4
}
long rb_overflowed_fix_to_int(long x) {
  return (long)((unsigned long)(x >> 1) ^ (1LU << (8 * 8 - 1)));
}


x86 assembly (clang, -O0):
<rb_overflowed_fix_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_overflowed_fix_to_int>:
sar    %rdi
movabs $0x8000000000000000,%rax
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @rb_overflowed_fix_to_int(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 1
%5 = xor i64 %4, -9223372036854775808
ret i64 %5
}

LLVM IR (-O2):
define i64 @rb_overflowed_fix_to_int(i64 %0) {
%2 = ashr i64 %0, 1
%3 = xor i64 %2, -9223372036854775808
ret i64 %3
}
main() { return 5; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ emit_addimm(int, int, int);
int /*<<< orphan*/ emit_cmovne_reg(int, int);
int /*<<< orphan*/ emit_orimm(int, int, int);
int /*<<< orphan*/ emit_test(int, int);
void emit_sh2tst(int s1, int s2, int sr, int temp) {
  assert(temp >= 0);
  emit_orimm(sr, 1, sr);
  emit_addimm(sr, -1, temp);
  emit_test(s1, s2);
  emit_cmovne_reg(temp, sr);
}


x86 assembly (clang, -O0):
<emit_sh2tst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1070 <emit_orimm@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%esi
call   1040 <emit_addimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <emit_test@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <emit_cmovne_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_sh2tst>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%r15d
mov    %ecx,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1070 <emit_orimm@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    %ebp,%edx
call   1040 <emit_addimm@plt>
mov    %r15d,%edi
mov    %r14d,%esi
call   1050 <emit_test@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <emit_cmovne_reg@plt>

LLVM IR (-O0):
define void @emit_sh2tst(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @emit_orimm(i32 %13, i32 1, i32 %14)
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = call i32 @emit_addimm(i32 %16, i32 -1, i32 %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = call i32 @emit_test(i32 %19, i32 %20)
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = call i32 @emit_cmovne_reg(i32 %22, i32 %23)
ret void
}

LLVM IR (-O2):
define void @emit_sh2tst(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = xor i32 %3, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @emit_orimm(i32 %2, i32 1, i32 %2)
%9 = tail call i32 @emit_addimm(i32 %2, i32 -1, i32 %3)
%10 = tail call i32 @emit_test(i32 %0, i32 %1)
%11 = tail call i32 @emit_cmovne_reg(i32 %3, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void time9(int value) {
  if (value != 9) {
    printf("FAIL: time9 expected 9\n");
    exit(1);
  }
  printf("PASS: test7\n");
  exit(0);
}


x86 assembly (clang, -O0):
<time9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
je     114b <time9+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<time9>:
push   %rax
cmp    $0x9,%edi
jne    1139 <time9+0x19>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"FAIL: time9 expected 9\0A\00"
@.str.1 = [13 x i8] c"PASS: test7\0A\00"
define void @time9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 9
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"PASS: test7\00"
@str.2 = [23 x i8] c"FAIL: time9 expected 9\00"
define void @time9(i32 %0) {
%2 = icmp eq i32 %0, 9
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ utempter_add_record(int, char const *);
void addToUtmp(__attribute__((unused)) const char *pty, const char *hostname,
               int master_fd) {
  (void)utempter_add_record(master_fd, hostname);
}


x86 assembly (clang, -O0):
<addToUtmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <utempter_add_record@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addToUtmp>:
mov    %edx,%edi
jmp    1030 <utempter_add_record@plt>

LLVM IR (-O0):
define void @addToUtmp(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %5
%9 = call i32 @utempter_add_record(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @addToUtmp(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 @utempter_add_record(i32 %2, i8* %1)
ret void
}
int main(int argc, char **argv) {
  int x;
  float r = argc;
  if (0 == r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x18(%rbp),%xmm0
jne    113b <main+0x3b>
jp     113b <main+0x3b>
movl   $0x7,-0x14(%rbp)
jmp    1142 <main+0x42>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x7,%ecx
mov    $0x2a,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
store float %9, float* %7
%10 = load float, float* %7
%11 = fcmp oeq float 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 7, i32 42
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _rdpkru(int);
int /*<<< orphan*/ expected_pk_fault(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ pkey_access_deny(int /*<<< orphan*/);
int read_ptr(int *);
int /*<<< orphan*/ sigsafe_printf(char *, int, ...);
void test_read_of_access_disabled_region(int *ptr, uint16_t pkey) {
  int ptr_contents;
  do {
    if (1 <= 0)
      sigsafe_printf("disabling access to PKEY[%02d], doing read @ %p\n", pkey,
                     ptr);
    fflush(NULL);
  } while (0);
  _rdpkru(1002);
  pkey_access_deny(pkey);
  ptr_contents = read_ptr(ptr);
  do {
    if (1 <= 0)
      sigsafe_printf("*ptr: %d\n", ptr_contents);
    fflush(NULL);
  } while (0);
  expected_pk_fault(pkey);
}


x86 assembly (clang, -O0):
<test_read_of_access_disabled_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    $0x3ea,%edi
call   1070 <_rdpkru@plt>
mov    -0xc(%rbp),%edi
call   1050 <pkey_access_deny@plt>
mov    -0x8(%rbp),%rdi
call   1030 <read_ptr@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0xc(%rbp),%edi
call   1060 <expected_pk_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_read_of_access_disabled_region>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <fflush@plt>
mov    $0x3ea,%edi
call   1070 <_rdpkru@plt>
mov    %ebx,%edi
call   1050 <pkey_access_deny@plt>
mov    %r14,%rdi
call   1030 <read_ptr@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <expected_pk_fault@plt>

LLVM IR (-O0):
define void @test_read_of_access_disabled_region(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %2
%7 = call i32 @fflush(i32* null)
br label %8
8: ; preds = %6
%9 = call i32 @_rdpkru(i32 1002)
%10 = load i32, i32* %4
%11 = call i32 @pkey_access_deny(i32 %10)
%12 = load i32*, i32** %3
%13 = call i32 @read_ptr(i32* %12)
store i32 %13, i32* %5
br label %14
14: ; preds = %8
%15 = call i32 @fflush(i32* null)
br label %16
16: ; preds = %14
%17 = load i32, i32* %4
%18 = call i32 @expected_pk_fault(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test_read_of_access_disabled_region(i32* %0, i32 %1) {
%3 = tail call i32 @fflush(i32* null)
%4 = tail call i32 @_rdpkru(i32 1002)
%5 = tail call i32 @pkey_access_deny(i32 %1)
%6 = tail call i32 @read_ptr(i32* %0)
%7 = tail call i32 @fflush(i32* null)
%8 = tail call i32 @expected_pk_fault(i32 %1)
ret void
}
void catch (int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @catch(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
int /*<<< orphan*/ gpio_a_set(int, int);
int /*<<< orphan*/ led_on();
void relay_closed(void) {
  gpio_a_set(2, 1);
  led_on();
  delay_ms(500);
}


x86 assembly (clang, -O0):
<relay_closed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <gpio_a_set@plt>
mov    $0x0,%al
call   1040 <led_on@plt>
mov    $0x1f4,%edi
call   1050 <delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<relay_closed>:
push   %rax
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <gpio_a_set@plt>
xor    %eax,%eax
call   1040 <led_on@plt>
mov    $0x1f4,%edi
pop    %rax
jmp    1050 <delay_ms@plt>

LLVM IR (-O0):
define void @relay_closed() {
%1 = call i32 @gpio_a_set(i32 2, i32 1)
%2 = call i32 (...) @led_on()
%3 = call i32 @delay_ms(i32 500)
ret void
}

LLVM IR (-O2):
define void @relay_closed() {
%1 = tail call i32 @gpio_a_set(i32 2, i32 1)
%2 = tail call i32 (...) @led_on()
%3 = tail call i32 @delay_ms(i32 500)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vfdlib_unregisterFont(int);
void vfdlib_unregisterAllFonts() {
  int i;
  for (i = 0; i < 5; i++)
    vfdlib_unregisterFont(i);
}


x86 assembly (clang, -O0):
<vfdlib_unregisterAllFonts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    113f <vfdlib_unregisterAllFonts+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <vfdlib_unregisterFont@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <vfdlib_unregisterAllFonts+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfdlib_unregisterAllFonts>:
push   %rax
xor    %edi,%edi
call   1030 <vfdlib_unregisterFont@plt>
mov    $0x1,%edi
call   1030 <vfdlib_unregisterFont@plt>
mov    $0x2,%edi
call   1030 <vfdlib_unregisterFont@plt>
mov    $0x3,%edi
call   1030 <vfdlib_unregisterFont@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <vfdlib_unregisterFont@plt>

LLVM IR (-O0):
define void @vfdlib_unregisterAllFonts() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @vfdlib_unregisterFont(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @vfdlib_unregisterAllFonts() {
%1 = tail call i32 @vfdlib_unregisterFont(i32 0)
%2 = tail call i32 @vfdlib_unregisterFont(i32 1)
%3 = tail call i32 @vfdlib_unregisterFont(i32 2)
%4 = tail call i32 @vfdlib_unregisterFont(i32 3)
%5 = tail call i32 @vfdlib_unregisterFont(i32 4)
ret void
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
char *startswith(const char *s, const char *prefix) {
  size_t l;
  l = strlen(prefix);
  if (strncmp(s, prefix, l) == 0)
    return (char *)s + l;
  return NULL;
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1169 <startswith+0x49>
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <startswith+0x51>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
add    %r15,%rbx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @startswith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds i8, i8* %0, i64 %3
%7 = select i1 %5, i8* %6, i8* null
ret i8* %7
}
unsigned int bit_reverse(register unsigned int n) {
  n = (((n & 0xaaaaaaaa) >> 1) | ((n & 0x55555555) << 1));
  n = (((n & 0xcccccccc) >> 2) | ((n & 0x33333333) << 2));
  n = (((n & 0xf0f0f0f0) >> 4) | ((n & 0x0f0f0f0f) << 4));
  n = (((n & 0xff00ff00) >> 8) | ((n & 0x00ff00ff) << 8));
  return ((n >> 16) | (n << 16));
}


x86 assembly (clang, -O0):
<bit_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x55555555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcccccccc,%eax
shr    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f0,%eax
shr    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f0f0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_reverse>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @bit_reverse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -1431655766
%5 = lshr i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 1431655765
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, -858993460
%12 = lshr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 858993459
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, -252645136
%19 = lshr i32 %18, 4
%20 = load i32, i32* %2
%21 = and i32 %20, 252645135
%22 = shl i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = and i32 %24, -16711936
%26 = lshr i32 %25, 8
%27 = load i32, i32* %2
%28 = and i32 %27, 16711935
%29 = shl i32 %28, 8
%30 = or i32 %26, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = lshr i32 %31, 16
%33 = load i32, i32* %2
%34 = shl i32 %33, 16
%35 = or i32 %32, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @bit_reverse(i32 %0) {
%2 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeSomeArgs(char **args, int n) {
  char **a;
  a = args;
  while (n--)
    free(*a++);
  free((char *)args);
}


x86 assembly (clang, -O0):
<freeSomeArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1157 <freeSomeArgs+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    1127 <freeSomeArgs+0x17>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeSomeArgs>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <freeSomeArgs+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    %ebx,%r15d
jne    1130 <freeSomeArgs+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeSomeArgs(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %5
%10 = tail call i32 @free(i8* %9)
%11 = icmp eq i32 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = bitcast i8** %0 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
int compareREAL(const void *current, const void *candidate) {
  return ((*(double *)current < *(double *)candidate
               ? -1
               : (*(double *)current > *(double *)candidate ? 1 : 0)));
}


x86 assembly (clang, -O0):
<compareREAL>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1133 <compareREAL+0x33>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <compareREAL+0x54>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareREAL>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareREAL(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp olt double %7, %10
br i1 %11, label %12, label %13
12: ; preds = %2
br label %23
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to double*
%16 = load double, double* %15
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to double*
%19 = load double, double* %18
%20 = fcmp ogt double %16, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %13, %12
%24 = phi i32 [ -1, %12 ], [ %22, %13 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @compareREAL(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_SLAVE3(unsigned int i) {
  return (REG_SPI_BASE(i) + 0x3c);
}


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

x86 assembly (clang, -O2):
<SPI_SLAVE3>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0x3c,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_SLAVE3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @REG_SPI_BASE(i32 %3)
%5 = add i32 %4, 60
ret i32 %5
}

LLVM IR (-O2):
define i32 @SPI_SLAVE3(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 60
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int exists(const char *fname) {
  FILE *file;
  if (file = fopen(fname, "r")) {
    fclose(file);
    return (0);
  }
  return 1;
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <exists+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    1166 <exists+0x46>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     113e <exists+0x1e>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %4
%10 = call i32 @fclose(i32* %9)
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef unsigned int uint16_t;

/* Variables and functions */
uint16_t pcg_output_rxs_m_xs_16_16(uint16_t state) {
  uint16_t word = ((state >> ((state >> 13u) + 3u)) ^ state) * 62169u;
  return (word >> 11u) ^ word;
}


x86 assembly (clang, -O0):
<pcg_output_rxs_m_xs_16_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0xd,%ecx
add    $0x3,%ecx
shr    %cl,%eax
xor    -0x4(%rbp),%eax
imul   $0xf2d9,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0xb,%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_output_rxs_m_xs_16_16>:
mov    %edi,%ecx
shr    $0xd,%ecx
add    $0x3,%cl
mov    %edi,%eax
shr    %cl,%eax
xor    %edi,%eax
imul   $0xf2d9,%eax,%ecx
mov    %ecx,%eax
shr    $0xb,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pcg_output_rxs_m_xs_16_16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 13
%7 = add i32 %6, 3
%8 = lshr i32 %4, %7
%9 = load i32, i32* %2
%10 = xor i32 %8, %9
%11 = mul i32 %10, 62169
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = lshr i32 %12, 11
%14 = load i32, i32* %3
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @pcg_output_rxs_m_xs_16_16(i32 %0) {
%2 = lshr i32 %0, 13
%3 = add nuw nsw i32 %2, 3
%4 = lshr i32 %0, %3
%5 = xor i32 %4, %0
%6 = mul i32 %5, 62169
%7 = lshr i32 %6, 11
%8 = xor i32 %7, %6
ret i32 %8
}
char *fulltext(void) { return fulltext; }


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

x86 assembly (clang, -O2):
<fulltext>:
mov    0x2ef1(%rip),%rax
ret

LLVM IR (-O0):
define i8* @fulltext() {
ret i8* bitcast (i8* ()* @fulltext to i8*)
}

LLVM IR (-O2):
define i8* @fulltext() {
ret i8* bitcast (i8* ()* @fulltext to i8*)
}
void foo306() {}


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

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

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

LLVM IR (-O2):
define void @foo306() {
ret void
}
int byte_row_cns11643(int byte) {
  return (byte >> 8) * 94 + (byte & 0xff) - 0x21;
}


x86 assembly (clang, -O0):
<byte_row_cns11643>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
imul   $0x5e,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
sub    $0x21,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_row_cns11643>:
movzbl %dil,%eax
sar    $0x8,%edi
imul   $0x5e,%edi,%ecx
add    %ecx,%eax
add    $0xffffffdf,%eax
ret

LLVM IR (-O0):
define i32 @byte_row_cns11643(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = mul nsw i32 %4, 94
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = add nsw i32 %5, %7
%9 = sub nsw i32 %8, 33
ret i32 %9
}

LLVM IR (-O2):
define i32 @byte_row_cns11643(i32 %0) {
%2 = ashr i32 %0, 8
%3 = mul nsw i32 %2, 94
%4 = and i32 %0, 255
%5 = add nsw i32 %4, -33
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
float expf(float);
float __glsl_exp(float x) { return expf(x); }


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

x86 assembly (clang, -O2):
<__glsl_exp>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define float @__glsl_exp(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
const char *str_quote(const char *s) {
  static char buf[1024];
  int r = snprintf(buf, sizeof(buf), "\"%.*s\"", (int)sizeof(buf) - 4, s);
  if (r >= (int)sizeof(buf)) {
    buf[sizeof(buf) - 1] = 0;
  }
  return buf;
}


x86 assembly (clang, -O0):
<str_quote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
lea    0x2f19(%rip),%rdi
mov    $0x400,%esi
lea    0xecd(%rip),%rdx
mov    $0x3fc,%ecx
mov    $0x0,%al
call   1030 <snprintf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jl     1156 <str_quote+0x46>
movb   $0x0,0x32e9(%rip)
lea    0x2ee3(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_quote>:
push   %rax
mov    %rdi,%r8
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rdx
mov    $0x400,%esi
mov    $0x3fc,%ecx
xor    %eax,%eax
call   1030 <snprintf@plt>
cmp    $0x400,%eax
jl     1141 <str_quote+0x31>
movb   $0x0,0x32fe(%rip)
lea    0x2ef8(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@str_quote.buf = internal global [1024 x i8] zeroinitializer
@.str = [7 x i8] c"\22%.*s\22\00"
define i8* @str_quote(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @str_quote.buf, i64 0, i64 0), i64 1024, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1020, i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 1024
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @str_quote.buf, i64 0, i64 1023)
br label %9
9: ; preds = %8, %1
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @str_quote.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@str_quote.buf = internal global [1024 x i8] zeroinitializer
@.str = [7 x i8] c"\22%.*s\22\00"
define i8* @str_quote(i8* %0) {
%2 = tail call i32 (i8*, i64, i8*, ...) @snprintf(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @str_quote.buf, i64 0, i64 0), i64 1024, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1020, i8* %0)
%3 = icmp sgt i32 %2, 1023
br i1 %3, label %4, label %5
4: ; preds = %1
store i8 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @str_quote.buf, i64 0, i64 1023)
br label %5
5: ; preds = %4, %1
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @str_quote.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ cel(float);
int /*<<< orphan*/ fah(float);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main(void) {
  float degreeC;
  float degreeF;
  printf("\nHello, this program converts Celsius to Fahrenheit and "
         "vice-versa.\nPlease input a degree in Celsius, then a degree in "
         "Fahrenheit.\n");
  scanf("%f %f\n\n", &degreeC, &degreeF);
  fah(degreeC);
  cel(degreeF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1060 <fah@plt>
movss  -0xc(%rbp),%xmm0
call   1040 <cel@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1060 <fah@plt>
movss  (%rsp),%xmm0
call   1040 <cel@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [132 x i8] c"\0AHello, this program converts Celsius to Fahrenheit and vice-versa.\0APlease input a degree in Celsius, then a degree in Fahrenheit.\0A\00"
@.str.1 = [8 x i8] c"%f %f\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%6 = load float, float* %2
%7 = call i32 @fah(float %6)
%8 = load float, float* %3
%9 = call i32 @cel(float %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%f %f\0A\0A\00"
@str = [131 x i8] c"\0AHello, this program converts Celsius to Fahrenheit and vice-versa.\0APlease input a degree in Celsius, then a degree in Fahrenheit.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([131 x i8], [131 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %1
%8 = call i32 @fah(float %7)
%9 = load float, float* %2
%10 = call i32 @cel(float %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_write(char *, int);
int log_warning(char *msg) { log_write(msg, 1); }


x86 assembly (clang, -O0):
<log_warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <log_write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_warning>:
mov    $0x1,%esi
jmp    1030 <log_write@plt>

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

LLVM IR (-O2):
define i32 @log_warning(i8* %0) {
%2 = tail call i32 @log_write(i8* %0, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x98() {
  Assert_real((ispunct(152) == 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_ispunct.c",
              765, ("ispunct should be 0 for 0x98"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x98>:
push   %rax
mov    $0x98,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2fd,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x98\00"
define void @t_ispunct_0x98() {
%1 = call i64 @ispunct(i32 152)
%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 765, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x98\00"
define void @t_ispunct_0x98() {
%1 = tail call i64 @ispunct(i32 152)
%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 765, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void *ctx_unwind(void *ctx) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @ctx_unwind(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *prg) {
  printf("Process to exec ELF in linux and BSD for i386, x86_64 and MIPSEL\n"
         "Usage: %s {-p pid | -f file} [-o output_file] [-v]\n",
         prg);
  fflush(stdout);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [117 x i8] c"Process to exec ELF in linux and BSD for i386, x86_64 and MIPSEL\0AUsage: %s {-p pid | -f file} [-o output_file] [-v]\0A\00"
@stdout = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [117 x i8] c"Process to exec ELF in linux and BSD for i386, x86_64 and MIPSEL\0AUsage: %s {-p pid | -f file} [-o output_file] [-v]\0A\00"
@stdout = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
A0AR1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*((char *)10000000)) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<A0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x43d11(%rax),%cl
mov    $0x989680,%eax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AR1>:
mov    0x43d11(%r9),%al
mov    %al,0x989680
ret

LLVM IR (-O0):
define i32 @A0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %13
%17 = getelementptr inbounds i8, i8* %16, i64 277777
%18 = load i8, i8* %17
store i8 %18, i8* inttoptr (i64 10000000 to i8*)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @A0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture %5) {
%7 = getelementptr inbounds i8, i8* %5, i64 277777
%8 = load i8, i8* %7
store i8 %8, i8* inttoptr (i64 10000000 to i8*)
ret i32 undef
}
void glLineWidth(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLineWidth() {
ret void
}
void fme_emif_uinit(struct ifpga_feature *feature) { (void)(feature); }


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

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

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

LLVM IR (-O2):
%struct.ifpga_feature = type opaque
define void @fme_emif_uinit(%struct.ifpga_feature* nocapture %0) {
ret void
}