xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void isDevideByFiveAndSeven(int num) {
  if ((num % 5) == 0 && (num % 7) == 0 && num != 0) {
    printf("1");
  } else {
    printf("0");
  }
}


x86 assembly (clang, -O0):
<isDevideByFiveAndSeven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115e <isDevideByFiveAndSeven+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115e <isDevideByFiveAndSeven+0x4e>
cmpl   $0x0,-0x4(%rbp)
je     115e <isDevideByFiveAndSeven+0x4e>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <isDevideByFiveAndSeven+0x5a>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDevideByFiveAndSeven>:
imul   $0xcccccccd,%edi,%eax
add    $0x19999999,%eax
cmp    $0x33333332,%eax
jbe    112e <isDevideByFiveAndSeven+0x1e>
mov    $0x30,%eax
mov    %eax,%edi
jmp    1030 <putchar@plt>
test   %edi,%edi
je     1122 <isDevideByFiveAndSeven+0x12>
movslq %edi,%rax
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x2,%ecx
add    %eax,%ecx
lea    0x0(,%rcx,8),%eax
sub    %eax,%ecx
mov    $0x31,%eax
add    %edi,%ecx
je     1127 <isDevideByFiveAndSeven+0x17>
jmp    1122 <isDevideByFiveAndSeven+0x12>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define void @isDevideByFiveAndSeven(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 5
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %10, %6, %1
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
ret void
}

LLVM IR (-O2):
define void @isDevideByFiveAndSeven(i32 %0) {
%2 = srem i32 %0, 5
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = srem i32 %0, 7
%6 = icmp eq i32 %5, 0
%7 = icmp ne i32 %0, 0
%8 = and i1 %7, %6
br i1 %8, label %10, label %9
9: ; preds = %4, %1
br label %10
10: ; preds = %4, %9
%11 = phi i32 [ 48, %9 ], [ 49, %4 ]
%12 = tail call i32 @putchar(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double calcKE(int m, double v) {
  double ke;
  ke = 0.5 * m * v * v;
  printf("\nKinetic Energy (J): %.2lf\n", ke);
  return ke;
}


x86 assembly (clang, -O0):
<calcKE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcKE>:
push   %rax
cvtsi2sd %edi,%xmm1
mulsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0AKinetic Energy (J): %.2lf\0A\00"
define double @calcKE(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fmul double 5.000000e-01, %7
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = load double, double* %4
%12 = fmul double %10, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %13)
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0AKinetic Energy (J): %.2lf\0A\00"
define double @calcKE(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 5.000000e-01
%5 = fmul double %4, %1
%6 = fmul double %5, %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %6)
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, int);
int omp_get_thread_num();
void _gather(void *sendbuf, int sendcount1, void *recvbuf, size_t itemsize) {
  int ThisTask = omp_get_thread_num();
  ptrdiff_t i;
  memcpy((char *)recvbuf + ThisTask * sendcount1 * itemsize, sendbuf,
         sendcount1 * itemsize);
#pragma omp barrier
}


x86 assembly (clang, -O0):
<_gather>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
imul   -0x20(%rbp),%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gather>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%r15
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
imul   %ebp,%eax
movslq %eax,%rdi
imul   %rbx,%rdi
add    %r14,%rdi
imul   %ebp,%ebx
mov    %r15,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define void @_gather(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 (...) @omp_get_thread_num()
%6 = mul nsw i32 %5, %1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, %3
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = trunc i64 %3 to i32
%11 = mul i32 %10, %1
%12 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %11)
ret void
}
int convert_power(int pc) {
  int i = 1;
  while (pc >= i) {
    i = i * 2;
  }
  return (i * 2);
}


x86 assembly (clang, -O0):
<convert_power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1128 <convert_power+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <convert_power+0xe>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_power>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ecx
lea    (%rcx,%rcx,1),%eax
cmp    %edi,%ecx
jle    1110 <convert_power+0x10>
ret

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

LLVM IR (-O2):
define i32 @convert_power(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp sgt i32 %3, %0
%5 = shl nsw i32 %3, 1
br i1 %4, label %6, label %2
6: ; preds = %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ module_init();
__attribute__((constructor)) void __module_init__() { module_init(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__module_init__, i8* null }]
define void @__module_init__() {
%1 = call i32 (...) @module_init()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__module_init__, i8* null }]
define void @__module_init__() {
%1 = tail call i32 (...) @module_init()
ret void
}
double c1(__attribute__((unused)) double x) { return 3.14; }


x86 assembly (clang, -O0):
<c1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c1>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @c1(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 3.140000e+00
}

LLVM IR (-O2):
define double @c1(double %0) {
ret double 3.140000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void log_debug(char *str) { printf("[DEBUG] %s\n", str); }


x86 assembly (clang, -O0):
<log_debug>:
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):
<log_debug>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"[DEBUG] %s\0A\00"
define void @log_debug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ rand();
int /*<<< orphan*/ srand(int);
void init_buffer(char *bufp, size_t bufsz) {
  size_t i;
  srand(1);
  for (i = 0; i < bufsz; i++) {
    bufp[i] = (char)rand();
  }
}


x86 assembly (clang, -O0):
<init_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <srand@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1175 <init_buffer+0x55>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1142 <init_buffer+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_buffer>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x1,%edi
call   1030 <srand@plt>
test   %r15,%r15
je     1154 <init_buffer+0x34>
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <init_buffer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @init_buffer(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @srand(i32 1)
%4 = icmp eq i64 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = tail call i64 (...) @rand()
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %8, i8* %9
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
unsigned long uDMAErrorStatusGet(void) {
  return ((*((volatile unsigned long *)(0x400FF000 + 0x0000004C))));
}


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

x86 assembly (clang, -O2):
<uDMAErrorStatusGet>:
mov    0x400ff04c,%rax
40
ret

LLVM IR (-O0):
define i64 @uDMAErrorStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786380 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @uDMAErrorStatusGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786380 to i64*)
ret i64 %1
}
void ff_hevc_h_loop_filter_luma_10_ssse3() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_h_loop_filter_luma_10_ssse3() {
ret void
}
/* Variables and functions */
char *memchr(char const *, char, size_t);
size_t strnlen(const char *s, size_t maxlen) {
  const char *p;
  p = memchr(s, '\0', maxlen);
  if (p == NULL)
    return maxlen;
  return p - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    114b <strnlen+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i8* @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = select i1 %4, i64 %1, i64 %7
ret i64 %8
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_sk_free(int /*<<< orphan*/ *);
void sk_OPENSSL_CSTRING_free(struct stack_st_OPENSSL_CSTRING *sk) {
  OPENSSL_sk_free((OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_free>:
jmp    1030 <OPENSSL_sk_free@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define void @sk_OPENSSL_CSTRING_free(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_CSTRING*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %2
%3 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_CSTRING* %3 to i32*
%5 = call i32 @OPENSSL_sk_free(i32* %4)
ret void
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define void @sk_OPENSSL_CSTRING_free(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_free(i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void c2sM(const uint8_t *c, uint16_t *s) {
  memcpy(s, c, sizeof(uint16_t));
  return;
}


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

x86 assembly (clang, -O2):
<c2sM>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @c2sM(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %1, i32* %0, i32 4)
ret void
}
int cmp_int(const void *a, const void *b) {
  int ia = *(int *)a;
  int ib = *(int *)b;
  return (ia > ib) - (ia < ib);
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
void mdp4_mddi_rdptr_init(int cndx) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_mddi_rdptr_init(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printBytes(unsigned char *, int);
int /*<<< orphan*/ printf(char *, ...);
int wiringPiSPIDataRW(int channel, unsigned char *data, int len) {
  printf("wiringPiSPIDataRW: channel=%d, len=%d, data=", channel, len);
  printBytes(data, len);
  printf("\n");
  return len;
}


x86 assembly (clang, -O0):
<wiringPiSPIDataRW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <printBytes@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiSPIDataRW>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%esi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printBytes@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [45 x i8] c"wiringPiSPIDataRW: channel=%d, len=%d, data=\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @wiringPiSPIDataRW(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @printBytes(i8* %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
@.str = [45 x i8] c"wiringPiSPIDataRW: channel=%d, len=%d, data=\00"
define i32 @wiringPiSPIDataRW(i32 %0, i8* %1, i32 returned %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
%5 = tail call i32 @printBytes(i8* %1, i32 %2)
%6 = tail call i32 @putchar(i32 10)
ret i32 %2
}
int decode_frameno(int z) {
  int n;
  if (!z)
    z = 1;
  for (n = 0; !(z & 1); z >>= 1)
    n++;
  return (((1) < (n + 1) ? (n + 1) : (1)));
}


x86 assembly (clang, -O0):
<decode_frameno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1118 <decode_frameno+0x18>
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <decode_frameno+0x3a>
jmp    1151 <decode_frameno+0x51>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <decode_frameno+0x1f>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
jge    1172 <decode_frameno+0x72>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <decode_frameno+0x7f>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117f <decode_frameno+0x7f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_frameno>:
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
test   $0x1,%dil
jne    1137 <decode_frameno+0x37>
mov    $0x1,%ecx
mov    %edi,%eax
nopw   0x0(%rax,%rax,1)
sar    %eax
add    $0x1,%ecx
test   $0x2,%dil
mov    %eax,%edi
je     1120 <decode_frameno+0x20>
test   %ecx,%ecx
mov    $0x1,%eax
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @decode_frameno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %1
store i32 0, i32* %3
br label %8
8: ; preds = %16, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %13
%17 = load i32, i32* %2
%18 = ashr i32 %17, 1
store i32 %18, i32* %2
br label %8
19: ; preds = %8
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
%22 = icmp slt i32 1, %21
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
br label %27
26: ; preds = %19
br label %27
27: ; preds = %26, %23
%28 = phi i32 [ %25, %23 ], [ 1, %26 ]
ret i32 %28
}

LLVM IR (-O2):
define i32 @decode_frameno(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ 1, %1 ]
%8 = phi i32 [ %9, %6 ], [ %3, %1 ]
%9 = ashr i32 %8, 1
%10 = add i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6
%14 = icmp sgt i32 %10, 1
%15 = select i1 %14, i32 %10, i32 1
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %17
}
void outl(unsigned int v, unsigned short port) {
  asm volatile("outl %0,%1" : : "a"(v), "dN"(port));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outl(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,$1", "{ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ users();
int main() {
  users();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @users()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skipSpace(FILE *fp) {
  int c = fgetc(fp);
  while (c == ' ' || c == '\n' || c == '\t') {
    c = fgetc(fp);
  }
  ungetc(c, fp);
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1160 <skipSpace+0x40>
mov    $0x1,%al
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1160 <skipSpace+0x40>
cmpl   $0x9,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1170 <skipSpace+0x50>
jmp    1181 <skipSpace+0x61>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
jmp    1138 <skipSpace+0x18>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0x100000600,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0x20,%eax
ja     1155 <skipSpace+0x35>
mov    %eax,%ecx
bt     %rcx,%r14
jb     1140 <skipSpace+0x20>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ungetc@plt>

LLVM IR (-O0):
define void @skipSpace(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 32
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 10
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 9
br label %15
15: ; preds = %12, %9, %6
%16 = phi i1 [ true, %9 ], [ true, %6 ], [ %14, %12 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = load i32*, i32** %2
%19 = call i32 @fgetc(i32* %18)
store i32 %19, i32* %3
br label %6
20: ; preds = %15
%21 = load i32, i32* %3
%22 = load i32*, i32** %2
%23 = call i32 @ungetc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @skipSpace(i32* nocapture %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 @fgetc(i32* %0)
switch i32 %3, label %5 [
i32 32, label %4
i32 10, label %4
i32 9, label %4
]
4: ; preds = %2, %2, %2
br label %2
5: ; preds = %2
%6 = tail call i32 @ungetc(i32 %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ infohelper_output(int /*<<< orphan*/, char *);
int /*<<< orphan*/ serialport_drain();
int serialport_write(unsigned char *, int);
int serialport_send_C0(void) {
  unsigned char b;
  b = 0xC0;
  if (serialport_write(&b, 1) != 1) {
    infohelper_output(0, "failed sending 0xC0");
    return 0;
  }
  serialport_drain();
  return 1;
}


x86 assembly (clang, -O0):
<serialport_send_C0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xc0,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
mov    $0x1,%esi
call   1040 <serialport_write@plt>
cmp    $0x1,%eax
je     116d <serialport_send_C0+0x3d>
xor    %edi,%edi
lea    0xea4(%rip),%rsi
call   1050 <infohelper_output@plt>
movl   $0x0,-0x4(%rbp)
jmp    117b <serialport_send_C0+0x4b>
mov    $0x0,%al
call   1030 <serialport_drain@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialport_send_C0>:
push   %rbx
sub    $0x10,%rsp
movb   $0xc0,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%ebx
mov    $0x1,%esi
call   1040 <serialport_write@plt>
cmp    $0x1,%eax
jne    115c <serialport_send_C0+0x2c>
xor    %eax,%eax
call   1030 <serialport_drain@plt>
jmp    116c <serialport_send_C0+0x3c>
lea    0xe9d(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1050 <infohelper_output@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"failed sending 0xC0\00"
define i32 @serialport_send_C0() {
%1 = alloca i32
%2 = alloca i8
store i8 -64, i8* %2
%3 = call i32 @serialport_write(i8* %2, i32 1)
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @infohelper_output(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 (...) @serialport_drain()
store i32 1, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"failed sending 0xC0\00"
define i32 @serialport_send_C0() {
%1 = alloca i8
store i8 -64, i8* %1
%2 = call i32 @serialport_write(i8* %1, i32 1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @infohelper_output(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 (...) @serialport_drain()
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int volatile);
int main01() {
  volatile int i = 100;
  i = i + 5;
  i = i + 10;
  i = i + 30;
  printf("%d\n", i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main01>:
push   %rax
movl   $0x64,0x4(%rsp)
addl   $0x5,0x4(%rsp)
addl   $0xa,0x4(%rsp)
addl   $0x1e,0x4(%rsp)
mov    0x4(%rsp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main01() {
%1 = alloca i32
store volatile i32 100, i32* %1
%2 = load volatile i32, i32* %1
%3 = add nsw i32 %2, 5
store volatile i32 %3, i32* %1
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, 10
store volatile i32 %5, i32* %1
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 30
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main01() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 100, i32* %1
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, 5
store volatile i32 %4, i32* %1
%5 = load volatile i32, i32* %1
%6 = add nsw i32 %5, 10
store volatile i32 %6, i32* %1
%7 = load volatile i32, i32* %1
%8 = add nsw i32 %7, 30
store volatile i32 %8, i32* %1
%9 = load volatile i32, i32* %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
void *mythread(void *_arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @mythread(i8* nocapture readnone %0) {
ret i8* null
}
int ft_toupper(int c) { return (c -= (('a' <= c && c <= 'z') ? 32 : 0)); }


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x61,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <ft_toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %ecx,%ecx
mov    $0x20,%eax
test   $0x1,%dl
cmovne %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x1a,%eax
setae  %cl
shl    $0x5,%ecx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffe0,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 97, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 32, i32 0
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = select i1 %3, i32 -32, i32 0
%5 = add i32 %4, %0
ret i32 %5
}
__typeof__(isdigit("")) test_isdigit_26(void) { return isdigit(""); }


x86 assembly (clang, -O0):
<test_isdigit_26>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <isdigit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isdigit_26>:
lea    0xef9(%rip),%rcx
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
setb   %al
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_isdigit_26() {
%1 = call i32 @isdigit(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_isdigit_26() {
ret i32 zext (i1 icmp ult (i32 sub (i32 ptrtoint ([1 x i8]* @.str to i32), i32 48), i32 10) to i32)
}
/* Variables and functions */
int /*<<< orphan*/ kinetisbase_init();
void kinetis_init() { kinetisbase_init(); }


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

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

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

LLVM IR (-O2):
define void @kinetis_init() {
%1 = tail call i32 (...) @kinetisbase_init()
ret void
}
void b_smp_wait(void) { asm volatile("call *0x00100048"); }


x86 assembly (clang, -O0):
<b_smp_wait>:
push   %rbp
mov    %rsp,%rbp
call   *0x100048
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_smp_wait>:
call   *0x100048
ret

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

LLVM IR (-O2):
define void @b_smp_wait() {
tail call void asm sideeffect "call *0x00100048", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int errno;
int fstat(int, struct stat *);
int __sulong_posix_fstat(int fd, struct stat *statbuf) {
  {
    int native_errno = errno;
    int result = fstat(fd, statbuf);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  }
}


x86 assembly (clang, -O0):
<__sulong_posix_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fstat@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1154 <__sulong_posix_fstat+0x44>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    0x2e82(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_fstat>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <fstat@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%7 = load i32, i32* @errno
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load %struct.stat*, %struct.stat** %4
%10 = call i32 @fstat(i32 %8, %struct.stat* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @errno
%15 = sub nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %5
store i32 %19, i32* @errno
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_fstat(i32 %0, %struct.stat* nocapture %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @fstat(i32 %0, %struct.stat* %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
store i32 %3, i32* @errno
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t adts_get_profile(const uint8_t *p_adts) { return p_adts[2] >> 6; }


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

x86 assembly (clang, -O2):
<adts_get_profile>:
mov    0x8(%rdi),%eax
sar    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @adts_get_profile(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = ashr i32 %5, 6
ret i32 %6
}

LLVM IR (-O2):
define i32 @adts_get_profile(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
ret i32 %4
}
long long r15(void *x) { return *(long long *)(x + 32753); }


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

x86 assembly (clang, -O2):
<r15>:
mov    0x7ff1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r15(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32753
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r15(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32753
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int fun(int);
int test(void) { return fun(42); }


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

x86 assembly (clang, -O2):
<test>:
mov    $0x2a,%edi
jmp    1030 <fun@plt>

LLVM IR (-O0):
define i32 @test() {
%1 = call i32 @fun(i32 42)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 @fun(i32 42)
ret i32 %1
}
void clntunix_abort() {}


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

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

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

LLVM IR (-O2):
define void @clntunix_abort() {
ret void
}
void cgroup_kill(struct flist_head *list) {}


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

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

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

LLVM IR (-O2):
%struct.flist_head = type opaque
define void @cgroup_kill(%struct.flist_head* nocapture %0) {
ret void
}
/* Type definitions */
struct t_irc_server {
  int dummy;
};

/* Variables and functions */
char *strdup(char *);
char *irc_server_eval_fingerprint(struct t_irc_server *server) {
  return strdup("");
}


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

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

LLVM IR (-O0):
%struct.t_irc_server = type { i32 }
@.str = [1 x i8] zeroinitializer
define i8* @irc_server_eval_fingerprint(%struct.t_irc_server* %0) {
%2 = alloca %struct.t_irc_server*
store %struct.t_irc_server* %0, %struct.t_irc_server** %2
%3 = call i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
%struct.t_irc_server = type { i32 }
@.str = [1 x i8] zeroinitializer
define noalias i8* @irc_server_eval_fingerprint(%struct.t_irc_server* nocapture readnone %0) {
%2 = tail call dereferenceable_or_null(1) i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
char *null_array_FLOAT(float *arr) {
  if (arr == NULL) {
    return "null";
  } else {
    return "non_null";
  }
}


x86 assembly (clang, -O0):
<null_array_FLOAT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <null_array_FLOAT+0x23>
lea    0xeea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112e <null_array_FLOAT+0x2e>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_array_FLOAT>:
test   %rdi,%rdi
lea    0xefa(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_FLOAT(float* %0) {
%2 = alloca i8*
%3 = alloca float*
store float* %0, float** %3
%4 = load float*, float** %3
%5 = icmp eq float* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_FLOAT(float* readnone %0) {
%2 = icmp eq float* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
int HelpItem25(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem25() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem25() {
ret i32 0
}
/* Type definitions */
struct input_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fwrite(struct input_event const *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void write_event(const struct input_event *event) {
  if (fwrite(event, sizeof(struct input_event), 1, stdout) != 1)
    exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<write_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
je     115f <write_event+0x3f>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_event>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
jne    1140 <write_event+0x20>
pop    %rax
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.input_event = type { i32 }
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @write_event(%struct.input_event* %0) {
%2 = alloca %struct.input_event*
store %struct.input_event* %0, %struct.input_event** %2
%3 = load %struct.input_event*, %struct.input_event** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fwrite(%struct.input_event* %3, i32 4, i32 1, i32 %4)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
%struct.input_event = type { i32 }
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @write_event(%struct.input_event* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fwrite(%struct.input_event* %0, i32 4, i32 1, i32 %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
__attribute__((always_)) void numa_default_policy(void) {}


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

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

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

LLVM IR (-O2):
define void @numa_default_policy() {
ret void
}