xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *Fgetstr_R(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
char *Fgetstr(FILE *ifp, const char *ends) {
  register char *s = (char *)0;
  ;
  s = Fgetstr_R(ifp, ends, 0);
  ;
  return s;
}


x86 assembly (clang, -O0):
<Fgetstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <Fgetstr_R@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fgetstr>:
xor    %edx,%edx
jmp    1030 <Fgetstr_R@plt>

LLVM IR (-O0):
define i8* @Fgetstr(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
store i8* null, i8** %5
%6 = load i32*, i32** %3
%7 = load i8*, i8** %4
%8 = call i8* @Fgetstr_R(i32* %6, i8* %7, i32 0)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @Fgetstr(i32* %0, i8* %1) {
%3 = tail call i8* @Fgetstr_R(i32* %0, i8* %1, i32 0)
ret i8* %3
}
int jac_chain_nm3_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @jac_chain_nm3_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @jac_chain_nm3_n_in() {
ret i32 2
}
extern int gui_ksys_get_code_pressed_button(void) {
  int value;
  __asm__ __volatile__("int $0x40" : "=a"(value) : "a"(17));
  return (value);
}


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

x86 assembly (clang, -O2):
<gui_ksys_get_code_pressed_button>:
mov    $0x11,%eax
int    $0x40
ret

LLVM IR (-O0):
define i32 @gui_ksys_get_code_pressed_button() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 17)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gui_ksys_get_code_pressed_button() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 17)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ConvertFromFloat(float, unsigned char *);
int write(int, unsigned char *, int);
int ConvertWriteFloat(int fp, float val) {
  unsigned char tmp[4];
  ConvertFromFloat(val, tmp);
  if (write(fp, tmp, 4) != 4)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<ConvertWriteFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1040 <ConvertFromFloat@plt>
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x4,%eax
je     1164 <ConvertWriteFloat+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <ConvertWriteFloat+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertWriteFloat>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <ConvertFromFloat@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @ConvertWriteFloat(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca [4 x i8]
store i32 %0, i32* %4
store float %1, float* %5
%7 = load float, float* %5
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%9 = call i32 @ConvertFromFloat(float %7, i8* %8)
%10 = load i32, i32* %4
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%12 = call i32 @write(i32 %10, i8* %11, i32 4)
%13 = icmp ne i32 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @ConvertWriteFloat(i32 %0, float %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @ConvertFromFloat(float %1, i8* %4)
%6 = call i32 @write(i32 %0, i8* %4, i32 4)
%7 = icmp ne i32 %6, 4
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
void cpu_set(uint64_t *cpu_mask, int cpu) {
  uint64_t *mask;
  mask = cpu_mask + (cpu >> 6);
  *mask |= (1ULL << (cpu & ((1ULL << 6) - 1)));
}


x86 assembly (clang, -O0):
<cpu_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x6,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_set>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x6,%eax
mov    $0x1,%edx
shl    %cl,%rdx
cltq
or     %rdx,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @cpu_set(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64*
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i64*, i64** %3
%7 = load i32, i32* %4
%8 = ashr i32 %7, 6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %6, i64 %9
store i64* %10, i64** %5
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = and i64 %12, 63
%14 = shl i64 1, %13
%15 = load i64*, i64** %5
%16 = load i64, i64* %15
%17 = or i64 %16, %14
store i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
define void @cpu_set(i64* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 6
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = and i32 %1, 63
%7 = zext i32 %6 to i64
%8 = shl nuw i64 1, %7
%9 = load i64, i64* %5
%10 = or i64 %9, %8
store i64 %10, i64* %5
ret void
}
int do_921() { return 921; }


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

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

LLVM IR (-O0):
define i32 @do_921() {
ret i32 921
}

LLVM IR (-O2):
define i32 @do_921() {
ret i32 921
}
long kmin(long a, long b) {
  if ((signed long)a < (signed long)b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<kmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <kmin+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <kmin+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @kmin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int for1BLimP(int x) {
  if (x > 7)
    return x - 8;
  else
    return x;
}


x86 assembly (clang, -O0):
<for1BLimP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jle    111f <for1BLimP+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <for1BLimP+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<for1BLimP>:
lea    -0x8(%rdi),%eax
cmp    $0x8,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @for1BLimP(i32 %0) {
%2 = icmp sgt i32 %0, 7
%3 = add nsw i32 %0, -8
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFD;
int fcntl(int, int /*<<< orphan*/);
bool proc_need_to_close_fd(int fd) {
  int flags = fcntl(fd, F_GETFD);
  return (flags >= 0);
}


x86 assembly (clang, -O0):
<proc_need_to_close_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_need_to_close_fd>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
define i32 @proc_need_to_close_fd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFD
%6 = call i32 @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@F_GETFD = global i32 0
define i32 @proc_need_to_close_fd(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar_unlocked(char);
void printString(char *str, int size) {
  int i;
  for (i = 0; i < size; i++)
    putchar_unlocked(str[i]);
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <printString+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar_unlocked@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printString+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <printString+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar_unlocked@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <printString+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @printString(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @putchar_unlocked(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int displayArray(int *a, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("element[%d] = %d\n", i, a[i]);
  }
  return i;
}


x86 assembly (clang, -O0):
<displayArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <displayArray+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <displayArray+0x16>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayArray>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1149 <displayArray+0x39>
mov    %esi,%r14d
mov    %rdi,%r12
mov    %esi,%ebx
xor    %ebp,%ebp
lea    0xed3(%rip),%r15
nopl   (%rax)
mov    (%r12,%rbp,4),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <displayArray+0x20>
jmp    114c <displayArray+0x3c>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"element[%d] = %d\0A\00"
define i32 @displayArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = phi i32 [ 0, %2 ], [ %1, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ emptyBuffer();
int /*<<< orphan*/ printLinestart();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setCommands();
void initShell(void) {
  printf("WELCOME TO ARQUIOS.\n");
  emptyBuffer();
  setCommands();
  printLinestart();
}


x86 assembly (clang, -O0):
<initShell>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <emptyBuffer@plt>
mov    $0x0,%al
call   1050 <setCommands@plt>
mov    $0x0,%al
call   1060 <printLinestart@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initShell>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <emptyBuffer@plt>
xor    %eax,%eax
call   1050 <setCommands@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <printLinestart@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"WELCOME TO ARQUIOS.\0A\00"
define void @initShell() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @emptyBuffer()
%3 = call i32 (...) @setCommands()
%4 = call i32 (...) @printLinestart()
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"WELCOME TO ARQUIOS.\00"
define void @initShell() {
%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 (...) @emptyBuffer()
%3 = tail call i32 (...) @setCommands()
%4 = tail call i32 (...) @printLinestart()
ret void
}
/* Variables and functions */
double UCHAR_MAX;
extern double cmax_uchar() { return UCHAR_MAX; }


x86 assembly (clang, -O0):
<cmax_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmax_uchar>:
mov    0x2ee9(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@UCHAR_MAX = global double 0.000000e+00
define double @cmax_uchar() {
%1 = load double, double* @UCHAR_MAX
ret double %1
}

LLVM IR (-O2):
@UCHAR_MAX = global double 0.000000e+00
define double @cmax_uchar() {
%1 = load double, double* @UCHAR_MAX
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void serror(int s) {
  switch (s) {
  case 1:
    printf("syntax error\n");
    break;
  case 2:
    printf("mismatched parentheses\n");
    break;
  case 3:
    printf("expression absent\n");
    break;
  }
}


x86 assembly (clang, -O0):
<serror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1151 <serror+0x41>
jmp    112f <serror+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1162 <serror+0x52>
jmp    1140 <serror+0x30>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1173 <serror+0x63>
jmp    117f <serror+0x6f>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <serror+0x6f>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <serror+0x6f>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serror>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     112e <serror+0x1e>
movslq %edi,%rax
lea    0xf16(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [14 x i8] c"syntax error\0A\00"
@.str.1 = [24 x i8] c"mismatched parentheses\0A\00"
@.str.2 = [19 x i8] c"expression absent\0A\00"
define void @serror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %1, %8, %6, %4
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"expression absent\00"
@str.3 = [23 x i8] c"mismatched parentheses\00"
@str.4 = [13 x i8] c"syntax error\00"
@reltable.serror = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.serror to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.serror to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @str to i64), i64 ptrtoint ([3 x i32]* @reltable.serror to i64)) to i32)]
define void @serror(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.serror to i8*), i64 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int hex2integer(char *hex) {
  int i;
  sscanf(hex, "%0x", &i);
  return i;
}


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

x86 assembly (clang, -O2):
<hex2integer>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%0x\00"
define i32 @hex2integer(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ error(char *);
void *Alloc(int size) {
  void *vp = calloc(1, size);
  if (!vp)
    error("Out of memory");
  return vp;
}


x86 assembly (clang, -O0):
<Alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <Alloc+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Alloc>:
push   %rbx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <Alloc+0x21>
lea    0xec4(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @Alloc(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void ff_hevc_put_hevc_epel_hv64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv64_12_sse4() {
ret void
}
int isMersenne(long long m) {
  long long var = 0, exp = 1;
  while (var <= (m + 1)) {
    var = 2 << exp;
    if (var == (m + 1))
      return 1;
    exp++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isMersenne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jg     1172 <isMersenne+0x72>
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    $0x2,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1161 <isMersenne+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1179 <isMersenne+0x79>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <isMersenne+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isMersenne>:
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rdi
jl     1137 <isMersenne+0x37>
add    $0x1,%rdi
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edx
shl    %cl,%edx
movslq %edx,%rdx
cmp    %rdx,%rdi
je     1138 <isMersenne+0x38>
add    $0x1,%ecx
cmp    %rdx,%rdi
jge    1120 <isMersenne+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isMersenne(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = icmp slt i64 %0, -1
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = add nuw nsw i64 %8, 1
%6 = icmp slt i64 %2, %11
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i64 [ %5, %4 ], [ 1, %1 ]
%9 = trunc i64 %8 to i32
%10 = shl i32 2, %9
%11 = sext i32 %10 to i64
%12 = icmp eq i64 %2, %11
br i1 %12, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %7 ]
ret i32 %14
}
int _mpy(int src1, int src2) { return (short)src1 * (short)src2; }


x86 assembly (clang, -O0):
<_mpy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cwtl
mov    -0x8(%rbp),%ecx
movswl %cx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mpy>:
movswl %di,%ecx
movswl %si,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_mpy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i16
%7 = sext i16 %6 to i32
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
%10 = sext i16 %9 to i32
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_mpy(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = shl i32 %1, 16
%6 = ashr exact i32 %5, 16
%7 = mul nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_container_to_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(286, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_container_to_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_container_to_target_solutions>:
mov    $0x11e,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_multprec_container_to_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 286, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
_Atomic(int) compound_or(_Atomic(int) in) { return (in |= 5); }


x86 assembly (clang, -O0):
<compound_or>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
or     $0x5,%ecx
lock cmpxchg %ecx,-0x4(%rbp)
sete   %cl
mov    %eax,-0xc(%rbp)
test   $0x1,%cl
mov    %eax,-0x8(%rbp)
jne    1131 <compound_or+0x31>
jmp    110d <compound_or+0xd>
mov    -0xc(%rbp),%eax
or     $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compound_or>:
mov    %edi,%eax
mov    %edi,-0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
or     $0x5,%ecx
lock cmpxchg %ecx,-0x4(%rsp)
jne    1110 <compound_or+0x10>
or     $0x5,%eax
ret

LLVM IR (-O0):
define i32 @compound_or(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw or i32* %2, i32 5 seq_cst
%4 = or i32 %3, 5
ret i32 %4
}

LLVM IR (-O2):
define i32 @compound_or(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw or i32* %2, i32 5 seq_cst
%4 = or i32 %3, 5
ret i32 %4
}
int ecm_nss_ipv4_init(struct dentry *dentry) { return 0; }


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

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

LLVM IR (-O0):
%struct.dentry = type opaque
define i32 @ecm_nss_ipv4_init(%struct.dentry* %0) {
%2 = alloca %struct.dentry*
store %struct.dentry* %0, %struct.dentry** %2
ret i32 0
}

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @ecm_nss_ipv4_init(%struct.dentry* nocapture readnone %0) {
ret i32 0
}
void wmb() { __asm__ volatile("sfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @wmb() {
tail call void asm sideeffect "sfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int main(void) {
  struct timespec mytime;
  return clock_gettime(CLOCK_REALTIME, &mytime);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %2)
ret i32 %4
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
ret i32 %4
}
/* Variables and functions */
long file_write_time(char const *);
long int fileutils___file_write_time(const char *filename) {
  return (file_write_time(filename));
}


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

x86 assembly (clang, -O2):
<fileutils___file_write_time>:
jmp    1030 <file_write_time@plt>

LLVM IR (-O0):
define i64 @fileutils___file_write_time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @file_write_time(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @fileutils___file_write_time(i8* %0) {
%2 = tail call i64 @file_write_time(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void topdhead(int osvers, int osrel, int ossub) {
  printf("  pid command  dsk%% |   pid command  dsk%% | "
         "  pid command  dsk%%_top3_");
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c" pid command dsk%% | pid command dsk%% | pid command dsk%%_top3_\00"
define void @topdhead(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c" pid command dsk%% | pid command dsk%% | pid command dsk%%_top3_\00"
define void @topdhead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEFAULT();
void SWITCH_CASE_BREAK(int x) {
  switch (x) {
  case 0:
    break;
  default:
    DEFAULT();
  }
}


x86 assembly (clang, -O0):
<SWITCH_CASE_BREAK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1130 <SWITCH_CASE_BREAK+0x20>
jmp    112b <SWITCH_CASE_BREAK+0x1b>
jmp    1137 <SWITCH_CASE_BREAK+0x27>
mov    $0x0,%al
call   1030 <DEFAULT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWITCH_CASE_BREAK>:
test   %edi,%edi
je     111b <SWITCH_CASE_BREAK+0xb>
xor    %eax,%eax
jmp    1030 <DEFAULT@plt>
ret

LLVM IR (-O0):
define void @SWITCH_CASE_BREAK(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 0, label %4
]
4: ; preds = %1
br label %7
5: ; preds = %1
%6 = call i32 (...) @DEFAULT()
br label %7
7: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
define void @SWITCH_CASE_BREAK(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @DEFAULT()
br label %5
5: ; preds = %1, %3
ret void
}
int brcmf_debugfs_attach(struct brcmf_pub *drvr) { return 0; }


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

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

LLVM IR (-O0):
%struct.brcmf_pub = type opaque
define i32 @brcmf_debugfs_attach(%struct.brcmf_pub* %0) {
%2 = alloca %struct.brcmf_pub*
store %struct.brcmf_pub* %0, %struct.brcmf_pub** %2
ret i32 0
}

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define i32 @brcmf_debugfs_attach(%struct.brcmf_pub* nocapture readnone %0) {
ret i32 0
}
double __wasm_float_min_f64(double lhs, double rhs) {
  if (lhs != lhs)
    return lhs;
  if (rhs != rhs)
    return rhs;
  return lhs < rhs ? lhs : rhs;
}


x86 assembly (clang, -O0):
<__wasm_float_min_f64>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    1129 <__wasm_float_min_f64+0x29>
jp     1129 <__wasm_float_min_f64+0x29>
jmp    1138 <__wasm_float_min_f64+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1199 <__wasm_float_min_f64+0x99>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1153 <__wasm_float_min_f64+0x53>
jp     1153 <__wasm_float_min_f64+0x53>
jmp    1162 <__wasm_float_min_f64+0x62>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1199 <__wasm_float_min_f64+0x99>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1185 <__wasm_float_min_f64+0x85>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    118f <__wasm_float_min_f64+0x8f>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wasm_float_min_f64>:
ucomisd %xmm0,%xmm0
jp     1110 <__wasm_float_min_f64+0x10>
ucomisd %xmm1,%xmm1
jp     1111 <__wasm_float_min_f64+0x11>
minsd  %xmm1,%xmm0
ret
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__wasm_float_min_f64(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %4
%8 = fcmp une double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %27
11: ; preds = %2
%12 = load double, double* %5
%13 = load double, double* %5
%14 = fcmp une double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load double, double* %5
store double %16, double* %3
br label %27
17: ; preds = %11
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fcmp olt double %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load double, double* %4
br label %25
23: ; preds = %17
%24 = load double, double* %5
br label %25
25: ; preds = %23, %21
%26 = phi double [ %22, %21 ], [ %24, %23 ]
store double %26, double* %3
br label %27
27: ; preds = %25, %15, %9
%28 = load double, double* %3
ret double %28
}

LLVM IR (-O2):
define double @__wasm_float_min_f64(double %0, double %1) {
%3 = fcmp uno double %0, 0.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fcmp uno double %1, 0.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = fcmp olt double %0, %1
%8 = select i1 %7, double %0, double %1
br label %9
9: ; preds = %4, %2, %6
%10 = phi double [ %8, %6 ], [ %0, %2 ], [ %1, %4 ]
ret double %10
}
/* Variables and functions */
float __rnint(float);
float intr_wrap_403(float p1) { return __rnint(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_403>:
jmp    1030 <__rnint@plt>

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

LLVM IR (-O2):
define float @intr_wrap_403(float %0) {
%2 = tail call float @__rnint(float %0)
ret float %2
}
const char *get_vadname(void) {
  static const char name[] = "unknown";
  return name;
}


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

x86 assembly (clang, -O2):
<get_vadname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@get_vadname.name = internal constant [8 x i8] c"unknown\00"
define i8* @get_vadname() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @get_vadname.name, i64 0, i64 0)
}

LLVM IR (-O2):
@get_vadname.name = internal constant [8 x i8] c"unknown\00"
define i8* @get_vadname() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @get_vadname.name, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ vprintf(char const *, int /*<<< orphan*/);
void generic_io(const char *begin_with, const char *end_with,
                const char *format_string, va_list argp) {
  printf("%s", begin_with);
  vprintf(format_string, argp);
  printf("%s", end_with);
}


x86 assembly (clang, -O0):
<generic_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <vprintf@plt>
mov    -0x10(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_io>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
lea    0xec7(%rip),%r15
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <vprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @generic_io(i8* %0, i8* %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @vprintf(i8* %2, i32 %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef void AMCStaticRedBlackTree;

/* Variables and functions */
int /*<<< orphan*/ _lock_Read_RbTree(void *);
int /*<<< orphan*/ _rbTree_Dump(void *);
int /*<<< orphan*/ _unlock_Read_RbTree(void *);
void AMCStaticRbTree_DebugStdout(struct AMCStaticRedBlackTree *tree) {
  if (((void *)0) == tree) {
    return;
  }
  _lock_Read_RbTree(tree);
  _rbTree_Dump(tree);
  _unlock_Read_RbTree(tree);
  return;
}


x86 assembly (clang, -O0):
<AMCStaticRbTree_DebugStdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    114d <AMCStaticRbTree_DebugStdout+0x1d>
jmp    1168 <AMCStaticRbTree_DebugStdout+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <_lock_Read_RbTree@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_rbTree_Dump@plt>
mov    -0x8(%rbp),%rdi
call   1050 <_unlock_Read_RbTree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCStaticRbTree_DebugStdout>:
test   %rdi,%rdi
je     114f <AMCStaticRbTree_DebugStdout+0x1f>
push   %rbx
mov    %rdi,%rbx
call   1030 <_lock_Read_RbTree@plt>
mov    %rbx,%rdi
call   1040 <_rbTree_Dump@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <_unlock_Read_RbTree@plt>
ret

LLVM IR (-O0):
%struct.AMCStaticRedBlackTree = type opaque
define void @AMCStaticRbTree_DebugStdout(%struct.AMCStaticRedBlackTree* %0) {
%2 = alloca %struct.AMCStaticRedBlackTree*
store %struct.AMCStaticRedBlackTree* %0, %struct.AMCStaticRedBlackTree** %2
%3 = load %struct.AMCStaticRedBlackTree*, %struct.AMCStaticRedBlackTree** %2
%4 = icmp eq %struct.AMCStaticRedBlackTree* null, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %16
6: ; preds = %1
%7 = load %struct.AMCStaticRedBlackTree*, %struct.AMCStaticRedBlackTree** %2
%8 = bitcast %struct.AMCStaticRedBlackTree* %7 to i8*
%9 = call i32 @_lock_Read_RbTree(i8* %8)
%10 = load %struct.AMCStaticRedBlackTree*, %struct.AMCStaticRedBlackTree** %2
%11 = bitcast %struct.AMCStaticRedBlackTree* %10 to i8*
%12 = call i32 @_rbTree_Dump(i8* %11)
%13 = load %struct.AMCStaticRedBlackTree*, %struct.AMCStaticRedBlackTree** %2
%14 = bitcast %struct.AMCStaticRedBlackTree* %13 to i8*
%15 = call i32 @_unlock_Read_RbTree(i8* %14)
br label %16
16: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.AMCStaticRedBlackTree = type opaque
define void @AMCStaticRbTree_DebugStdout(%struct.AMCStaticRedBlackTree* %0) {
%2 = icmp eq %struct.AMCStaticRedBlackTree* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = bitcast %struct.AMCStaticRedBlackTree* %0 to i8*
%5 = tail call i32 @_lock_Read_RbTree(i8* %4)
%6 = tail call i32 @_rbTree_Dump(i8* %4)
%7 = tail call i32 @_unlock_Read_RbTree(i8* %4)
br label %8
8: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Q_strncpyz(char *, char const *, int);
int strlen(char *);
void Q_strcat(char *dest, int size, const char *src) {
  int l1;
  l1 = strlen(dest);
  if (l1 >= size) {
    ;
  }
  Q_strncpyz(dest + l1, src, size - l1);
}


x86 assembly (clang, -O0):
<Q_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1150 <Q_strcat+0x30>
jmp    1150 <Q_strcat+0x30>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
sub    -0x1c(%rbp),%edx
call   1040 <Q_strncpyz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strcat>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rax,%rbx
sub    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <Q_strncpyz@plt>

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

LLVM IR (-O2):
define void @Q_strcat(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = sub nsw i32 %1, %4
%8 = tail call i32 @Q_strncpyz(i8* %6, i8* %2, i32 %7)
ret void
}
int ix_max(int *ix, int *end) {
  int max = 0;
  while (ix < end) {
    int x = *ix++;
    if (max < x)
      max = x;
    x = *ix++;
    if (max < x)
      max = x;
  }
  return max;
}


x86 assembly (clang, -O0):
<ix_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1172 <ix_max+0x72>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1147 <ix_max+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    116d <ix_max+0x6d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <ix_max+0x13>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ix_max>:
xor    %eax,%eax
cmp    %rsi,%rdi
jae    1128 <ix_max+0x28>
xor    %eax,%eax
nopl   0x0(%rax)
mov    (%rdi),%ecx
mov    0x4(%rdi),%edx
cmp    %ecx,%eax
cmovl  %ecx,%eax
cmp    %edx,%eax
cmovl  %edx,%eax
add    $0x8,%rdi
cmp    %rsi,%rdi
jb     1110 <ix_max+0x10>
ret

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

LLVM IR (-O2):
define i32 @ix_max(i32* %0, i32* readnone %1) {
%3 = icmp ult i32* %0, %1
br i1 %3, label %4, label %16
4: ; preds = %2, %4
%5 = phi i32 [ %14, %4 ], [ 0, %2 ]
%6 = phi i32* [ %11, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %6
%9 = icmp slt i32 %5, %8
%10 = select i1 %9, i32 %8, i32 %5
%11 = getelementptr inbounds i32, i32* %6, i64 2
%12 = load i32, i32* %7
%13 = icmp slt i32 %10, %12
%14 = select i1 %13, i32 %12, i32 %10
%15 = icmp ult i32* %11, %1
br i1 %15, label %4, label %16
16: ; preds = %4, %2
%17 = phi i32 [ 0, %2 ], [ %14, %4 ]
ret i32 %17
}