xunge/DecIR huggingface dataset:
int kiss_platform_serial_check_handle(int handle) { return !(handle < 0); }


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

x86 assembly (clang, -O2):
<kiss_platform_serial_check_handle>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @kiss_platform_serial_check_handle(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
int find_next(int *next, int k) {
  int retval;
  retval = k;
  if (next[k] != k) {
    retval = find_next(next, next[k]);
    next[k] = retval;
  }
  return retval;
}


x86 assembly (clang, -O0):
<find_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
je     115e <find_next+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <find_next@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_next>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
movslq %esi,%rbx
mov    (%rdi,%rbx,4),%esi
cmp    %ebx,%esi
je     112c <find_next+0x1c>
mov    %rdi,%r14
call   1030 <find_next@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @find_next(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* %4
store i32 %6, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = load i32, i32* %4
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %2
%15 = load i32*, i32** %3
%16 = load i32*, i32** %3
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @find_next(i32* %15, i32 %20)
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = load i32*, i32** %3
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
br label %27
27: ; preds = %14, %2
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @find_next(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %1
br i1 %6, label %7, label %9
7: ; preds = %2, %9
%8 = phi i32 [ %10, %9 ], [ %1, %2 ]
ret i32 %8
9: ; preds = %2
%10 = tail call i32 @find_next(i32* %0, i32 %5)
store i32 %10, i32* %4
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ UI_PopMenu();
void UI_RemoveBotsMenu_BackEvent(void *ptr, int event) {
  if (event != 3) {
    return;
  }
  UI_PopMenu();
}


x86 assembly (clang, -O0):
<UI_RemoveBotsMenu_BackEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     112e <UI_RemoveBotsMenu_BackEvent+0x1e>
jmp    1135 <UI_RemoveBotsMenu_BackEvent+0x25>
mov    $0x0,%al
call   1030 <UI_PopMenu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_RemoveBotsMenu_BackEvent>:
cmp    $0x3,%esi
jne    111c <UI_RemoveBotsMenu_BackEvent+0xc>
xor    %eax,%eax
jmp    1030 <UI_PopMenu@plt>
ret

LLVM IR (-O0):
define void @UI_RemoveBotsMenu_BackEvent(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 3
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = call i32 (...) @UI_PopMenu()
br label %10
10: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
define void @UI_RemoveBotsMenu_BackEvent(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @UI_PopMenu()
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printfTitle(char *title) { printf("\n%s\n====================\n", title); }


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

x86 assembly (clang, -O2):
<printfTitle>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [26 x i8] c"\0A%s\0A====================\0A\00"
define void @printfTitle(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void banner_dash(void) {
  printf("               ==========================================\n");
}


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

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

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

LLVM IR (-O2):
@str = [58 x i8] c" ==========================================\00"
define void @banner_dash() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float fabsf(float);
float loglaplace(float x, float loc, float sc, float logsc) {
  return -fabsf(x - loc) / sc - logsc - 0.69314718055994530942;
}


x86 assembly (clang, -O0):
<loglaplace>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movaps 0xee7(%rip),%xmm1
pand   %xmm1,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb0(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<loglaplace>:
subss  %xmm1,%xmm0
orps   0xef5(%rip),%xmm0
divss  %xmm2,%xmm0
subss  %xmm3,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @loglaplace(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* %5
%10 = load float, float* %6
%11 = fsub float %9, %10
%12 = call float @llvm.fabs.f32(float %11)
%13 = fneg float %12
%14 = load float, float* %7
%15 = fdiv float %13, %14
%16 = load float, float* %8
%17 = fsub float %15, %16
%18 = fpext float %17 to double
%19 = fsub double %18, 0x3FE62E42FEFA39EF
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @loglaplace(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %1
%6 = tail call float @llvm.fabs.f32(float %5)
%7 = fneg float %6
%8 = fdiv float %7, %2
%9 = fsub float %8, %3
%10 = fpext float %9 to double
%11 = fadd double %10, 0xBFE62E42FEFA39EF
%12 = fptrunc double %11 to float
ret float %12
}
void fc269(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  goto a;
  0;
}


x86 assembly (clang, -O0):
<fc269>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc269+0x7>

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

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

LLVM IR (-O2):
define void @fc269(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int EINVAL;
int strlen(char *);
int sysfs_modify_freq_policy_governor(unsigned int, char *);
int cpufreq_modify_policy_governor(unsigned int cpu, char *governor) {
  if ((!governor) || (strlen(governor) > 19))
    return -EINVAL;
  return sysfs_modify_freq_policy_governor(cpu, governor);
}


x86 assembly (clang, -O0):
<cpufreq_modify_policy_governor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <cpufreq_modify_policy_governor+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x13,%eax
jle    115f <cpufreq_modify_policy_governor+0x3f>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <cpufreq_modify_policy_governor+0x4e>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <sysfs_modify_freq_policy_governor@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_modify_policy_governor>:
push   %rbp
push   %rbx
push   %rax
test   %rsi,%rsi
je     113a <cpufreq_modify_policy_governor+0x1a>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0x14,%eax
jl     114c <cpufreq_modify_policy_governor+0x2c>
mov    0x2e9f(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sysfs_modify_freq_policy_governor@plt>

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @cpufreq_modify_policy_governor(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %1)
%6 = icmp sgt i32 %5, 19
br i1 %6, label %7, label %10
7: ; preds = %4, %2
%8 = load i32, i32* @EINVAL
%9 = sub nsw i32 0, %8
br label %12
10: ; preds = %4
%11 = tail call i32 @sysfs_modify_freq_policy_governor(i32 %0, i8* %1)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}
void sysinit(void) {}


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

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

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

LLVM IR (-O2):
define void @sysinit() {
ret void
}
int intel_mid_pmic_readb(int reg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @intel_mid_pmic_readb(i32 %0) {
ret i32 0
}
/* Variables and functions */
int errno;
int isatty(int);
int istty() {
  int rno = errno;
  int r = isatty(1);
  errno = rno;
  return r;
}


x86 assembly (clang, -O0):
<istty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <isatty@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<istty>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
mov    $0x1,%edi
call   1030 <isatty@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @istty() {
%1 = load i32, i32* @errno
%2 = tail call i32 @isatty(i32 1)
store i32 %1, i32* @errno
ret i32 %2
}
void *m_memset(void *dst, int val, unsigned int bytes) {
  unsigned char *dst_ptr = (unsigned char *)dst;
  unsigned int i = 0;
  while (i < bytes) {
    dst_ptr[i] = val;
    ++i;
  }
  return dst;
}


x86 assembly (clang, -O0):
<m_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1146 <m_memset+0x46>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111d <m_memset+0x1d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_memset>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
je     1122 <m_memset+0x12>
mov    %edx,%edx
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @m_memset(i8* returned writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
int f261(int *);
int f262(int *p) { return f261(p); }


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

x86 assembly (clang, -O2):
<f262>:
jmp    1030 <f261@plt>

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

LLVM IR (-O2):
define i32 @f262(i32* %0) {
%2 = tail call i32 @f261(i32* %0)
ret i32 %2
}
double dvecnorm(double *x, int n) {
  extern double dnrm2_(int *n, double *dx, int *incx);
  int one = 1;
  return dnrm2_(&n, x, &one);
}


x86 assembly (clang, -O0):
<dvecnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rdx
call   1030 <dnrm2_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvecnorm>:
push   %rax
mov    %rdi,%rax
mov    %esi,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
mov    %rax,%rsi
call   1030 <dnrm2_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @dvecnorm(double* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %1, i32* %3
%5 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%6 = call double @dnrm2_(i32* %3, double* %0, i32* %4)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ bf_write(char *, int, int /*<<< orphan*/);
void bf_clear(char *b, int nr) { bf_write(b, nr, 0); }


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

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

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

LLVM IR (-O2):
define void @bf_clear(i8* %0, i32 %1) {
%3 = tail call i32 @bf_write(i8* %0, i32 %1, i32 0)
ret void
}
int test_imm_6Fint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x6F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Fint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 476741369856
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int from_hex(char a) {
  if (a >= 'A' && a <= 'F')
    return a - 'A' + 10;
  else if (a >= 'a' && a <= 'f')
    return a - 'a' + 10;
  else
    return a - '0';
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <from_hex+0x36>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1136 <from_hex+0x36>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <from_hex+0x6c>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1162 <from_hex+0x62>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1162 <from_hex+0x62>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <from_hex+0x6c>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
lea    -0x41(%rdi),%eax
lea    -0x61(%rdi),%ecx
cmp    $0x6,%cl
mov    $0xffffffa9,%ecx
mov    $0xffffffd0,%edx
cmovb  %ecx,%edx
cmp    $0x6,%al
mov    $0xffffffc9,%eax
cmovae %edx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @from_hex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 70
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
%15 = add nsw i32 %14, 10
store i32 %15, i32* %2
br label %33
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 97
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 102
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 97
%28 = add nsw i32 %27, 10
store i32 %28, i32* %2
br label %33
29: ; preds = %20, %16
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 48
store i32 %32, i32* %2
br label %33
33: ; preds = %29, %24, %11
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @from_hex(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 6
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 6
%7 = select i1 %6, i32 -87, i32 -48
%8 = select i1 %4, i32 -55, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mkstemp(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *getTmpName(char *fname) {
  char name[259 + 1];
  int n;
  strcpy(fname, "swmmXXXXXX");
  mkstemp(fname);
  return fname;
}


x86 assembly (clang, -O0):
<getTmpName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mkstemp@plt>
mov    -0x8(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTmpName>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <mkstemp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"swmmXXXXXX\00"
define i8* @getTmpName(i8* %0) {
%2 = alloca i8*
%3 = alloca [260 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @mkstemp(i8* %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"swmmXXXXXX\00"
define i8* @getTmpName(i8* returned %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @mkstemp(i8* %0)
ret i8* %0
}
void EchoP$Leds$led1Toggle(void) { LedsP$Leds$led1Toggle(); }


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

x86 assembly (clang, -O2):
<EchoP$Leds$led1Toggle>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led1Toggle@plt>

LLVM IR (-O0):
define void @"EchoP$Leds$led1Toggle"() {
%1 = call i32 (...) @"LedsP$Leds$led1Toggle"()
ret void
}

LLVM IR (-O2):
define void @"EchoP$Leds$led1Toggle"() {
%1 = tail call i32 (...) @"LedsP$Leds$led1Toggle"()
ret void
}
int countnumflds(s)
char const *s;
{
  register char const *sp;
  register int count;
  if (!(sp = s) || !*sp)
    return 0;
  count = 1;
  do {
    if (*sp++ == '.')
      count++;
  } while (*sp);
  return (count);
}


x86 assembly (clang, -O0):
<countnumflds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1127 <countnumflds+0x27>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1133 <countnumflds+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1176 <countnumflds+0x76>
movl   $0x1,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    115e <countnumflds+0x5e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1163 <countnumflds+0x63>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113a <countnumflds+0x3a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countnumflds>:
xor    %eax,%eax
test   %rdi,%rdi
je     1135 <countnumflds+0x35>
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <countnumflds+0x35>
add    $0x1,%rdi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xor    %edx,%edx
cmp    $0x2e,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <countnumflds+0x20>
ret

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

LLVM IR (-O2):
define i32 @countnumflds(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = phi i32 [ %13, %6 ], [ 1, %3 ]
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = icmp eq i8 %7, 46
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %9, %12
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %1, %3
%17 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %13, %6 ]
ret i32 %17
}
/* Type definitions */
struct _Locale_codecvt {
  int dummy;
};

/* Variables and functions */
int _WLocale_mb_cur_max(struct _Locale_codecvt *lcodecvt) { return 1; }


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

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

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

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define i32 @_WLocale_mb_cur_max(%struct._Locale_codecvt* nocapture readnone %0) {
ret i32 1
}
double total(double mass, int count) {
  if (count > 0) {
    return mass * count;
  }
  return mass;
}


x86 assembly (clang, -O0):
<total>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    112e <total+0x2e>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <total+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<total>:
test   %edi,%edi
jg     110e <total+0xe>
movsd  0xef4(%rip),%xmm1
jmp    1112 <total+0x12>
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @total(double %0, i32 %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %4
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
store double %12, double* %3
br label %15
13: ; preds = %2
%14 = load double, double* %4
store double %14, double* %3
br label %15
15: ; preds = %13, %8
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @total(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = sitofp i32 %1 to double
%5 = select i1 %3, double %4, double 1.000000e+00
%6 = fmul double %5, %0
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long long);
int /*<<< orphan*/ stdout;
void print_fixed_float_64(void *fixed, unsigned frac) {
  fprintf(stdout, "double fixed point[64:%2u]:      ", frac);
  fprintf(stdout, "%#016llX\n", *(unsigned long long *)fixed);
}


x86 assembly (clang, -O0):
<print_fixed_float_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%eax
mov    %eax,%edx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fixed_float_64>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
mov    %esi,%edx
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xee6(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [34 x i8] c"double fixed point[64:%2u]: \00"
@.str.1 = [10 x i8] c"%llX\0A\00"
define void @print_fixed_float_64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %12)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"double fixed point[64:%2u]: \00"
@.str.1 = [10 x i8] c"%llX\0A\00"
define void @print_fixed_float_64(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = zext i32 %1 to i64
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i32, i32* @stdout
%7 = bitcast i8* %0 to i64*
%8 = load i64, i64* %7
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret void
}
int my_compare_less(int a, int b, int c, int d) {
  if (a < c)
    return 1;
  if (a == c && b < d)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<my_compare_less>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1128 <my_compare_less+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1153 <my_compare_less+0x53>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    114c <my_compare_less+0x4c>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114c <my_compare_less+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <my_compare_less+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_compare_less>:
cmp    %edx,%edi
setl   %al
sete   %dl
cmp    %ecx,%esi
setl   %cl
and    %dl,%cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @my_compare_less(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, %2
%6 = icmp eq i32 %0, %2
%7 = icmp slt i32 %1, %3
%8 = and i1 %6, %7
%9 = or i1 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void destroy(char ***strings, int size) {
  int i = 0;
  for (; i < size; ++i) {
    free((*strings)[i]);
  }
  free(*strings);
}


x86 assembly (clang, -O0):
<destroy>:
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    1154 <destroy+0x44>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <destroy+0x16>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @destroy(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 i8**, i8*** %11
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %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
%21 = load i8***, i8**** %3
%22 = load i8**, i8*** %21
%23 = bitcast i8** %22 to i8*
ret void
}

LLVM IR (-O2):
define void @destroy(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 = load i8**, i8*** %0
%9 = getelementptr inbounds i8*, i8** %8, i64 %7
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i8*** %0 to i8**
%15 = load i8*, i8** %14
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIA1_SetInterruptFlag(int /*<<< orphan*/);
void VIA1_iCA2_RTC_OneSecond_PulseNtfy(void) { VIA1_SetInterruptFlag(0); }


x86 assembly (clang, -O0):
<VIA1_iCA2_RTC_OneSecond_PulseNtfy>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <VIA1_SetInterruptFlag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIA1_iCA2_RTC_OneSecond_PulseNtfy>:
xor    %edi,%edi
jmp    1030 <VIA1_SetInterruptFlag@plt>

LLVM IR (-O0):
define void @VIA1_iCA2_RTC_OneSecond_PulseNtfy() {
%1 = call i32 @VIA1_SetInterruptFlag(i32 0)
ret void
}

LLVM IR (-O2):
define void @VIA1_iCA2_RTC_OneSecond_PulseNtfy() {
%1 = tail call i32 @VIA1_SetInterruptFlag(i32 0)
ret void
}
unsigned int hash(const char *str) {
  unsigned int hash = 0;
  while (*str) {
    hash = (hash << 5) - hash + (*str++);
  }
  return (hash & 0x7fffffff);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 2147483647
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Rocket() {
  printf("This module is on development process.Please try again later.");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"This module is on development process.Please try again later.\00"
define void @Rocket() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [62 x i8] c"This module is on development process.Please try again later.\00"
define void @Rocket() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XFocusOutEvent;

/* Variables and functions */
void set_XFocusOutEvent_type(void *_p, int _v) {
  ((XFocusOutEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XFocusOutEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XFocusOutEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XFocusOutEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int Convert4ByteToInt(char *byteArray) { return *((int *)byteArray); }


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

x86 assembly (clang, -O2):
<Convert4ByteToInt>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @Convert4ByteToInt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @Convert4ByteToInt(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ read_test(char const *);
void just_read(void) {
  const char *filename = "/cluster2/test/testfile";
  int i = 0;
  read_test(filename);
  return;
}


x86 assembly (clang, -O0):
<just_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"/cluster2/test/testfile\00"
define void @just_read() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 0, i32* %2
%3 = load i8*, i8** %1
%4 = call i32 @read_test(i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"/cluster2/test/testfile\00"
define void @just_read() {
%1 = tail call i32 @read_test(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
void test_assert_fails() {
  do {
    seatest_assert_true(1 == 2, __FUNCTION__, 12);
  } while (0);
}


x86 assembly (clang, -O0):
<test_assert_fails>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <test_assert_fails+0x9>
xor    %edi,%edi
lea    0xede(%rip),%rsi
mov    $0xc,%edx
mov    $0x0,%al
call   1030 <seatest_assert_true@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_fails>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
mov    $0xc,%edx
xor    %eax,%eax
jmp    1030 <seatest_assert_true@plt>

LLVM IR (-O0):
@__FUNCTION__.test_assert_fails = [18 x i8] c"test_assert_fails\00"
define void @test_assert_fails() {
br label %1
1: ; preds = %0
%2 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_assert_fails, i64 0, i64 0), i32 12)
br label %3
3: ; preds = %1
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_assert_fails = [18 x i8] c"test_assert_fails\00"
define void @test_assert_fails() {
%1 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__FUNCTION__.test_assert_fails, i64 0, i64 0), i32 12)
ret void
}
/* Variables and functions */
int EF1(int *, char *, int *);
int ArrayParam(int Values[100]) {
  return EF1((int *)Values[50], (char *)1, &Values[50]);
}


x86 assembly (clang, -O0):
<ArrayParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq 0xc8(%rax),%rdi
mov    -0x8(%rbp),%rdx
add    $0xc8,%rdx
mov    $0x1,%esi
call   1030 <EF1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArrayParam>:
movslq 0xc8(%rdi),%rax
lea    0xc8(%rdi),%rdx
mov    $0x1,%esi
mov    %rax,%rdi
jmp    1030 <EF1@plt>

LLVM IR (-O0):
define i32 @ArrayParam(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 50
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 50
%10 = call i32 @EF1(i32* %7, i8* inttoptr (i64 1 to i8*), i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @ArrayParam(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 50
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @EF1(i32* %5, i8* inttoptr (i64 1 to i8*), i32* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cleanString(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void convertInToString(int vowel_numb, char *string) {
  cleanString(string);
  snprintf(string, 500, "%d", vowel_numb);
  return;
}


x86 assembly (clang, -O0):
<convertInToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cleanString@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x1f4,%esi
lea    0xeb5(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertInToString>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <cleanString@plt>
lea    0xec9(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1f4,%esi
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @convertInToString(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @cleanString(i8* %5)
%7 = load i8*, i8** %4
%8 = load i32, i32* %3
%9 = call i32 @snprintf(i8* %7, i32 500, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @convertInToString(i32 %0, i8* %1) {
%3 = tail call i32 @cleanString(i8* %1)
%4 = tail call i32 @snprintf(i8* %1, i32 500, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int _cups_isupper(int ch) { return (ch >= 'A' && ch <= 'Z'); }


x86 assembly (clang, -O0):
<_cups_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <_cups_isupper+0x20>
cmpl   $0x5a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cups_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_cups_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void print_uint8(uint8_t n) { printf("%hhu", n); }


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

x86 assembly (clang, -O2):
<print_uint8>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%hhu\00"
define void @print_uint8(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}