xunge/DecIR huggingface dataset:
int isfmt(int f) {
  int i;
  static int fmt_list[11] = {0, 8, 16, 61, 80, 160, 212, 310, 311, 24, 32};
  for (i = 0; i < 11; i++)
    if (f == fmt_list[i])
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<isfmt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xb,-0xc(%rbp)
jge    114e <isfmt+0x4e>
mov    -0x8(%rbp),%eax
movslq -0xc(%rbp),%rdx
lea    0x2f0a(%rip),%rcx
cmp    (%rcx,%rdx,4),%eax
jne    113b <isfmt+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1155 <isfmt+0x55>
jmp    1140 <isfmt+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isfmt+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfmt>:
mov    $0x1,%eax
cmp    $0x9f,%edi
jg     1125 <isfmt+0x25>
cmp    $0x3d,%edi
ja     1142 <isfmt+0x42>
mov    %edi,%ecx
movabs $0x2000000101010101,%rdx
bt     %rcx,%rdx
jae    1142 <isfmt+0x42>
ret
lea    -0x136(%rdi),%ecx
cmp    $0x2,%ecx
jb     1124 <isfmt+0x24>
cmp    $0xa0,%edi
je     1124 <isfmt+0x24>
cmp    $0xd4,%edi
je     1124 <isfmt+0x24>
jmp    1147 <isfmt+0x47>
cmp    $0x50,%edi
je     1124 <isfmt+0x24>
xor    %eax,%eax
ret

LLVM IR (-O0):
@isfmt.fmt_list = internal global [11 x i32] [i32 0, i32 8, i32 16, i32 61, i32 80, i32 160, i32 212, i32 310, i32 311, i32 24, i32 32]
define i32 @isfmt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 11
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [11 x i32], [11 x i32]* @isfmt.fmt_list, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 1, i32* %2
br label %21
16: ; preds = %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
store i32 0, i32* %2
br label %21
21: ; preds = %20, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @isfmt(i32 %0) {
switch i32 %0, label %2 [
i32 0, label %3
i32 8, label %3
i32 16, label %3
i32 61, label %3
i32 80, label %3
i32 160, label %3
i32 212, label %3
i32 310, label %3
i32 311, label %3
i32 24, label %3
i32 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 1, %1 ], [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_verbatim_environment(int);
void cm_verbatim(void) { handle_verbatim_environment(1); }


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

x86 assembly (clang, -O2):
<cm_verbatim>:
mov    $0x1,%edi
jmp    1030 <handle_verbatim_environment@plt>

LLVM IR (-O0):
define void @cm_verbatim() {
%1 = call i32 @handle_verbatim_environment(i32 1)
ret void
}

LLVM IR (-O2):
define void @cm_verbatim() {
%1 = tail call i32 @handle_verbatim_environment(i32 1)
ret void
}
void vgLoadIdentity(void) {}


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

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

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

LLVM IR (-O2):
define void @vgLoadIdentity() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *);
double *fmalloc(size_t size) {
  double *a;
  if ((a = (double *)malloc(size * sizeof(double))) == NULL) {
    printf("can not allocate memory\n");
    exit(1);
  }
  return a;
}


x86 assembly (clang, -O0):
<fmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116d <fmalloc+0x3d>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmalloc>:
push   %rax
shl    $0x3,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1141 <fmalloc+0x11>
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"can not allocate memory\0A\00"
define double* @fmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca double*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 8
%6 = call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to double*
store double* %7, double** %3
%8 = icmp eq double* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load double*, double** %3
ret double* %13
}

LLVM IR (-O2):
@str = [24 x i8] c"can not allocate memory\00"
define double* @fmalloc(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i64 @malloc(i64 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %3 to double*
ret double* %9
}
__attribute__((always_, unused)) void ips_sync_writes() {
  asm volatile("sfence" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @ips_sync_writes() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t ctss_clamp16(const int32_t x) {
  return (int16_t)((x < -0x7fff) ? -0x8000 : (x > 0x7fff ? 0x7fff : x));
}


x86 assembly (clang, -O0):
<ctss_clamp16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xffff8001,-0x4(%rbp)
jge    1121 <ctss_clamp16+0x21>
mov    $0xffff8000,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <ctss_clamp16+0x47>
cmpl   $0x7fff,-0x4(%rbp)
jle    113b <ctss_clamp16+0x3b>
mov    $0x7fff,%eax
mov    %eax,-0xc(%rbp)
jmp    1141 <ctss_clamp16+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctss_clamp16>:
cmp    $0x7fff,%edi
mov    $0x7fff,%ecx
cmovl  %edi,%ecx
cmp    $0xffff8001,%ecx
mov    $0xffff8000,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ctss_clamp16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, -32767
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 32767
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 32767, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ -32768, %5 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @ctss_clamp16(i32 %0) {
%2 = icmp slt i32 %0, 32767
%3 = select i1 %2, i32 %0, i32 32767
%4 = icmp sgt i32 %3, -32768
%5 = select i1 %4, i32 %3, i32 -32768
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void usage(FILE *f) {
  fprintf(f, "Usage: loongson3-llsc-check /path/to/vmlinux\n");
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x2d,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: loongson3-llsc-check /path/to/vmlinux\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: loongson3-llsc-check /path/to/vmlinux\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 45, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atcommand_synonym_free();
void do_final_atcommand(void) {
  atcommand_synonym_free();
  return;
}


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

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

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

LLVM IR (-O2):
define void @do_final_atcommand() {
%1 = tail call i32 (...) @atcommand_synonym_free()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ subset_r(int const *, int, int, int *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
void subset(const int *S, int n, int k) {
  int *t;
  t = malloc(k * sizeof(int));
  subset_r(S, n, k, t, 0, 0);
  free(t);
}


x86 assembly (clang, -O0):
<subset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <subset_r@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subset>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r15
lea    0x0(,%rbx,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %rax,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <subset_r@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free@plt>

LLVM IR (-O0):
define void @subset(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
%12 = call i32* @malloc(i32 %11)
store i32* %12, i32** %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i32*, i32** %7
%17 = call i32 @subset_r(i32* %13, i32 %14, i32 %15, i32* %16, i32 0, i32 0)
%18 = load i32*, i32** %7
%19 = call i32 @free(i32* %18)
ret void
}

LLVM IR (-O2):
define void @subset(i32* %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32* @malloc(i32 %4)
%6 = tail call i32 @subset_r(i32* %0, i32 %1, i32 %2, i32* %5, i32 0, i32 0)
%7 = tail call i32 @free(i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bug();
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int /*<<< orphan*/ f3();
int /*<<< orphan*/ f4();
int /*<<< orphan*/ f5();
int /*<<< orphan*/ f6();
int /*<<< orphan*/ f7();
int /*<<< orphan*/ f8();
void main() {
  f1();
  f2();
  f3();
  bug();
  f4();
  f5();
  f6();
  f7();
  f8();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
mov    $0x0,%al
call   1070 <f3@plt>
mov    $0x0,%al
call   1060 <bug@plt>
mov    $0x0,%al
call   10b0 <f4@plt>
mov    $0x0,%al
call   10a0 <f5@plt>
mov    $0x0,%al
call   1050 <f6@plt>
mov    $0x0,%al
call   1090 <f7@plt>
mov    $0x0,%al
call   1040 <f8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1070 <f3@plt>
xor    %eax,%eax
call   1060 <bug@plt>
xor    %eax,%eax
call   10b0 <f4@plt>
xor    %eax,%eax
call   10a0 <f5@plt>
xor    %eax,%eax
call   1050 <f6@plt>
xor    %eax,%eax
call   1090 <f7@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <f8@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @f1()
%2 = call i32 (...) @f2()
%3 = call i32 (...) @f3()
%4 = call i32 (...) @bug()
%5 = call i32 (...) @f4()
%6 = call i32 (...) @f5()
%7 = call i32 (...) @f6()
%8 = call i32 (...) @f7()
%9 = call i32 (...) @f8()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 (...) @f3()
%4 = tail call i32 (...) @bug()
%5 = tail call i32 (...) @f4()
%6 = tail call i32 (...) @f5()
%7 = tail call i32 (...) @f6()
%8 = tail call i32 (...) @f7()
%9 = tail call i32 (...) @f8()
ret void
}
/* Variables and functions */
void swap(size_t *addrs, int n, int m) {
  size_t addr = addrs[n];
  addrs[n] = addrs[m];
  addrs[m] = addr;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @swap(i64* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
store i64 %9, i64* %5
store i64 %6, i64* %8
ret void
}
int stdio_text_lines(void) { return 25; }


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

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

LLVM IR (-O0):
define i32 @stdio_text_lines() {
ret i32 25
}

LLVM IR (-O2):
define i32 @stdio_text_lines() {
ret i32 25
}
int decode_oem_sensor(unsigned char *sdr, unsigned char *reading, char *pstring,
                      int slen) {
  int rv = -1;
  return (rv);
}


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

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

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

LLVM IR (-O2):
define i32 @decode_oem_sensor(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
__attribute__((section(".boot.text"))) void __boot_exception_common(void) {
  while (1)
    ;
}


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

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

LLVM IR (-O0):
define void @__boot_exception_common() section ".boot.text" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @__boot_exception_common() section ".boot.text" {
br label %1
1: ; preds = %0, %1
br label %1
}
int PDC_get_bios_key() {}


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

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

LLVM IR (-O0):
define i32 @PDC_get_bios_key() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @PDC_get_bios_key() {
ret i32 undef
}
unsigned char d_getub(register const unsigned char *ptr) { return ptr[0]; }


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

x86 assembly (clang, -O2):
<d_getub>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @d_getub(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @d_getub(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
SORU_0_PROTOTYPE() {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define i32 @SORU_0_PROTOTYPE() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("hello world\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_MD_CTX_md_data(int /*<<< orphan*/ *);
int SHA512_Update(int /*<<< orphan*/, void const *, size_t);
int update512(EVP_MD_CTX *ctx, const void *data, size_t count) {
  return SHA512_Update(EVP_MD_CTX_md_data(ctx), data, count);
}


x86 assembly (clang, -O0):
<update512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <EVP_MD_CTX_md_data@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <SHA512_Update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update512>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <EVP_MD_CTX_md_data@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <SHA512_Update@plt>

LLVM IR (-O0):
define i32 @update512(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = call i32 @EVP_MD_CTX_md_data(i32* %7)
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @SHA512_Update(i32 %8, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @update512(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @EVP_MD_CTX_md_data(i32* %0)
%5 = tail call i32 @SHA512_Update(i32 %4, i8* %1, i64 %2)
ret i32 %5
}
int do_recall(struct client *client, char **tokens) { return 0; }


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

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

LLVM IR (-O0):
%struct.client = type opaque
define i32 @do_recall(%struct.client* %0, i8** %1) {
%3 = alloca %struct.client*
%4 = alloca i8**
store %struct.client* %0, %struct.client** %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
%struct.client = type opaque
define i32 @do_recall(%struct.client* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
int main(void) {
  if (g(3, 1337) != 1337)
    abrt("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/0x7F800000/gcc/refs/heads/arm-hot-cold/"
         "ARMToolChain/source/gcc-5.2.0/gcc/testsuite/gcc.dg/pr33676.c",
         __FUNCTION__);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x539,%esi
mov    $0x0,%al
call   1040 <g@plt>
cmp    $0x539,%eax
je     1160 <main+0x40>
lea    0xeae(%rip),%rdi
lea    0xf65(%rip),%rsi
mov    $0x0,%al
call   1030 <abrt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x539,%esi
xor    %eax,%eax
call   1040 <g@plt>
cmp    $0x539,%eax
je     114e <main+0x2e>
lea    0xec0(%rip),%rdi
lea    0xf77(%rip),%rsi
xor    %eax,%eax
call   1030 <abrt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [190 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0x7F800000/gcc/refs/heads/arm-hot-cold/ARMToolChain/source/gcc-5.2.0/gcc/testsuite/gcc.dg/pr33676.c\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i32, i32, ...) bitcast (i32 (...)* @g to i32 (i32, i32, ...)*)(i32 3, i32 1337)
%3 = icmp ne i32 %2, 1337
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @abrt to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [190 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0x7F800000/gcc/refs/heads/arm-hot-cold/ARMToolChain/source/gcc-5.2.0/gcc/testsuite/gcc.dg/pr33676.c\00"
@__FUNCTION__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @g to i32 (i32, i32, ...)*)(i32 3, i32 1337)
%2 = icmp eq i32 %1, 1337
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @abrt to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.main, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
int isNum(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNum+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Programming is fun.\n");
  printf("And programming in C is even more fun.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Programming is fun.\0A\00"
@.str.1 = [40 x i8] c"And programming in C is even more fun.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Programming is fun.\00"
@str.2 = [39 x i8] c"And programming in C is even more fun.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_opi(int);
void gen_opf(int op) { gen_opi(op); }


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

x86 assembly (clang, -O2):
<gen_opf>:
jmp    1030 <gen_opi@plt>

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

LLVM IR (-O2):
define void @gen_opf(i32 %0) {
%2 = tail call i32 @gen_opi(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ system_log(char *, char *, int, char *);
void sig_bus(int signo) {
  system_log("<F>",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/"
             "init_afd/init_afd.c",
             3541, ("Uuurrrggh! Received SIGBUS."));
  abort();
}


x86 assembly (clang, -O0):
<sig_bus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0xdd5,%edx
lea    0xf50(%rip),%rcx
call   1040 <system_log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sig_bus>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
lea    0xf5f(%rip),%rcx
mov    $0xdd5,%edx
call   1040 <system_log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"<F>\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/init_afd/init_afd.c\00"
@.str.2 = [28 x i8] c"Uuurrrggh! Received SIGBUS.\00"
define void @sig_bus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3541, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"<F>\00"
@.str.1 = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/holger24/AFD/refs/heads/master/src/init_afd/init_afd.c\00"
@.str.2 = [28 x i8] c"Uuurrrggh! Received SIGBUS.\00"
define void @sig_bus(i32 %0) {
%2 = tail call i32 @system_log(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str.1, i64 0, i64 0), i32 3541, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
off_t file_size(const char *file_name) {
  struct stat st;
  if (stat(file_name, &st) == 0)
    return st.st_size;
  return -1;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113e <file_size+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <file_size+0x35>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, 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):
%struct.stat = type { i32 }
define i32 @file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_dobldobl_pole_radius(double *frp) {
  int fail;
  int precision = 1;
  int *b;
  fail = _ada_use_c2phc4c(865, &precision, b, frp, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_dobldobl_pole_radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x361,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_dobldobl_pole_radius>:
push   %rax
mov    %rdi,%rcx
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x361,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_get_dobldobl_pole_radius(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store double* %0, double** %2
store i32 1, i32* %4
%6 = load i32*, i32** %5
%7 = load double*, double** %2
%8 = call i32 @_ada_use_c2phc4c(i32 865, i32* %4, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @padcon_get_dobldobl_pole_radius(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 865, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ NetworkInitialize();
int /*<<< orphan*/ PrintWelcomeMessage();
int main(int argc, char **argv) {
  PrintWelcomeMessage();
  NetworkInitialize();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @PrintWelcomeMessage()
%7 = call i32 (...) @NetworkInitialize()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @PrintWelcomeMessage()
%4 = tail call i32 (...) @NetworkInitialize()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdec1pi(int v) { ngen("%s\t$%d,(%%rax)", "subq", v); }


x86 assembly (clang, -O0):
<cgdec1pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec1pi>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s\09$%d,(%%rax)\00"
@.str.1 = [5 x i8] c"subq\00"
define void @cgdec1pi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s\09$%d,(%%rax)\00"
@.str.1 = [5 x i8] c"subq\00"
define void @cgdec1pi(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void vectorSet(float v[3], float x, float y, float z) {
  v[0] = x;
  v[1] = y;
  v[2] = z;
}


x86 assembly (clang, -O0):
<vectorSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorSet>:
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vectorSet(float* %0, float %1, float %2, float %3) {
%5 = alloca float*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %6
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float, float* %7
%13 = load float*, float** %5
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float, float* %8
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 2
store float %15, float* %17
ret void
}

LLVM IR (-O2):
define void @vectorSet(float* nocapture writeonly %0, float %1, float %2, float %3) {
store float %1, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %5
%6 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %6
ret void
}
int test_imm_CFuint32_reg(unsigned int val) {
  return ((val) & (0xCF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CFuint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xcf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CFuint32_reg>:
test   $0xcf,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CFuint32_reg(i32 %0) {
%2 = and i32 %0, 207
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ add_built_in_hooks();
int /*<<< orphan*/ add_user_defined_hooks(char *);
void hooks_init(void) {
  static bool done;
  if (done)
    return;
  done = true;
  add_built_in_hooks();
  add_user_defined_hooks("~/.config/jgmenu/hooks");
}


x86 assembly (clang, -O0):
<hooks_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
je     1136 <hooks_init+0x16>
jmp    1153 <hooks_init+0x33>
movl   $0x1,0x2ef4(%rip)
mov    $0x0,%al
call   1030 <add_built_in_hooks@plt>
lea    0xeb2(%rip),%rdi
call   1040 <add_user_defined_hooks@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hooks_init>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
je     112c <hooks_init+0xc>
pop    %rax
ret
movb   $0x1,0x2f01(%rip)
xor    %eax,%eax
call   1030 <add_built_in_hooks@plt>
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1040 <add_user_defined_hooks@plt>

LLVM IR (-O0):
@hooks_init.done = internal global i32 0
@.str = [23 x i8] c"~/.config/jgmenu/hooks\00"
define void @hooks_init() {
%1 = load i32, i32* @hooks_init.done
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %7
4: ; preds = %0
store i32 1, i32* @hooks_init.done
%5 = call i32 (...) @add_built_in_hooks()
%6 = call i32 @add_user_defined_hooks(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@hooks_init.done = internal unnamed_addr global i1 false
@.str = [23 x i8] c"~/.config/jgmenu/hooks\00"
define void @hooks_init() {
%1 = load i1, i1* @hooks_init.done
br i1 %1, label %5, label %2
2: ; preds = %0
store i1 true, i1* @hooks_init.done
%3 = tail call i32 (...) @add_built_in_hooks()
%4 = tail call i32 @add_user_defined_hooks(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pow4(short, long long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, short *, long long *);
int main() {
  short x;
  long long n;
  scanf("%hd %lld", &x, &n);
  printf("%hd\n", pow4(x, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x6(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x6(%rbp),%ax
mov    -0x10(%rbp),%rsi
movswl %ax,%edi
call   1030 <pow4@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0xe(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1050 <scanf@plt>
movswl 0xe(%rsp),%edi
mov    0x10(%rsp),%rsi
call   1030 <pow4@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%hd %lld\00"
@.str.1 = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i16* %2, i64* %3)
%5 = load i16, i16* %2
%6 = load i64, i64* %3
%7 = call i32 @pow4(i16 signext %5, i64 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%hd %lld\00"
@.str.1 = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i64
%3 = bitcast i16* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i16* %1, i64* %2)
%6 = load i16, i16* %1
%7 = load i64, i64* %2
%8 = call i32 @pow4(i16 signext %6, i64 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
int joystickb_none_poll(void) {
  log_f("joystickb:none: joystickb_none_poll()\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<joystickb_none_poll>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <log_f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"joystickb:none: joystickb_none_poll()\0A\00"
define i32 @joystickb_none_poll() {
%1 = call i32 @log_f(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"joystickb:none: joystickb_none_poll()\0A\00"
define i32 @joystickb_none_poll() {
%1 = tail call i32 @log_f(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void fg_color(int foreground) {
  int type = 22;
  if (foreground > 7) {
    type = 1;
    foreground -= 8;
  }
  printf("%c[%d;%dm", 0x1B, type, foreground + 30);
}


x86 assembly (clang, -O0):
<fg_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x16,-0x8(%rbp)
cmpl   $0x7,-0x4(%rbp)
jle    113c <fg_color+0x2c>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
add    $0x1e,%ecx
lea    0xeb4(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fg_color>:
lea    -0x8(%rdi),%ecx
cmp    $0x8,%edi
cmovl  %edi,%ecx
mov    $0x1,%eax
mov    $0x16,%edx
cmovge %eax,%edx
add    $0x1e,%ecx
lea    0xed0(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%c[%d;%dm\00"
define void @fg_color(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 22, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 7
br i1 %5, label %6, label %9
6: ; preds = %1
store i32 1, i32* %3
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 8
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 30
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%c[%d;%dm\00"
define void @fg_color(i32 %0) {
%2 = icmp sgt i32 %0, 7
%3 = add nsw i32 %0, -8
%4 = select i1 %2, i32 %3, i32 %0
%5 = select i1 %2, i32 1, i32 22
%6 = add nsw i32 %4, 30
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 27, i32 %5, i32 %6)
ret void
}
void taskstats_exit(struct task_struct *tsk, int group_dead) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @taskstats_exit(%struct.task_struct* %0, i32 %1) {
%3 = alloca %struct.task_struct*
%4 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @taskstats_exit(%struct.task_struct* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void wrongSwap(int a, int b) {
  printf("a = %d, b = %d\n", a, b);
  int temp;
  temp = b;
  b = a;
  a = temp;
  printf("a = %d, b = %d\n", a, b);
}


x86 assembly (clang, -O0):
<wrongSwap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrongSwap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee1(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define void @wrongSwap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %4
store i32 %9, i32* %5
%10 = load i32, i32* %3
store i32 %10, i32* %4
%11 = load i32, i32* %5
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define void @wrongSwap(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cm_acronym_or_abbr(int, int);
void cm_abbr(int arg) { cm_acronym_or_abbr(arg, 1); }


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

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

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

LLVM IR (-O2):
define void @cm_abbr(i32 %0) {
%2 = tail call i32 @cm_acronym_or_abbr(i32 %0, i32 1)
ret void
}
/* Variables and functions */
unsigned long GetTime50();
unsigned long gettime() { return GetTime50(); }


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

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

LLVM IR (-O0):
define i64 @gettime() {
%1 = call i64 (...) @GetTime50()
ret i64 %1
}

LLVM IR (-O2):
define i64 @gettime() {
%1 = tail call i64 (...) @GetTime50()
ret i64 %1
}