xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int Aig_Base2Log(unsigned n) {
  int r;
  assert(n >= 0);
  if (n < 2)
    return n;
  for (r = 0, n--; n; n >>= 1, r++)
    ;
  return r;
}


x86 assembly (clang, -O0):
<Aig_Base2Log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x2,-0x8(%rbp)
jae    1141 <Aig_Base2Log+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <Aig_Base2Log+0x6d>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1177 <Aig_Base2Log+0x67>
jmp    1160 <Aig_Base2Log+0x50>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <Aig_Base2Log+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Aig_Base2Log>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <assert@plt>
cmp    $0x2,%ebx
jb     113c <Aig_Base2Log+0x2c>
mov    %ebx,%eax
add    $0xffffffff,%eax
xor    %ebx,%ebx
mov    %eax,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%ebx
cmp    $0x1,%eax
mov    %ecx,%eax
ja     1130 <Aig_Base2Log+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Aig_Base2Log(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp uge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = icmp ult i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %27
13: ; preds = %1
store i32 0, i32* %4
%14 = load i32, i32* %3
%15 = add i32 %14, -1
store i32 %15, i32* %3
br label %16
16: ; preds = %20, %13
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %16
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = lshr i32 %21, 1
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %16
25: ; preds = %16
%26 = load i32, i32* %4
store i32 %26, i32* %2
br label %27
27: ; preds = %25, %11
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @Aig_Base2Log(i32 %0) {
%2 = tail call i32 @assert(i32 1)
%3 = icmp ult i32 %0, 2
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = add i32 %0, -1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %10, %6 ], [ 0, %4 ]
%8 = phi i32 [ %9, %6 ], [ %5, %4 ]
%9 = lshr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = icmp ult i32 %8, 2
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = phi i32 [ %0, %1 ], [ %10, %6 ]
ret i32 %13
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void sleep_ms(long milliseconds) {
  struct timespec ts;
  ts.tv_sec = milliseconds / 1000;
  ts.tv_nsec = (milliseconds % 1000) * 1000000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0xf4240,%rdx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ms>:
sub    $0x18,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0xf4240,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @sleep_ms(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %9, i64* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @sleep_ms(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i64 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = srem i64 %0, 1000
%7 = mul nsw i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
float sla_rvlsrk_(float *, float *);
float slaRvlsrk(float ra, float dec) {
  float RA;
  float DEC;
  float result;
  RA = ra;
  DEC = dec;
  result = sla_rvlsrk_(&RA, &DEC);
  return result;
}


x86 assembly (clang, -O0):
<slaRvlsrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <sla_rvlsrk_@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaRvlsrk>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <sla_rvlsrk_@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @slaRvlsrk(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store float %1, float* %4
%8 = load float, float* %3
store float %8, float* %5
%9 = load float, float* %4
store float %9, float* %6
%10 = call float @sla_rvlsrk_(float* %5, float* %6)
store float %10, float* %7
%11 = load float, float* %7
ret float %11
}

LLVM IR (-O2):
define float @slaRvlsrk(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %3 to i8*
%6 = bitcast float* %4 to i8*
store float %0, float* %3
store float %1, float* %4
%7 = call float @sla_rvlsrk_(float* %3, float* %4)
ret float %7
}
/* Variables and functions */
char getchar();
char read_char() {
  char ch;
  do {
    ch = getchar();
  } while (
      !((((ch) >= 'a') && ((ch) <= 'z')) || (((ch) >= 'A') && ((ch) <= 'Z'))));
  return ch;
}


x86 assembly (clang, -O0):
<read_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1141 <read_char+0x31>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1166 <read_char+0x56>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1160 <read_char+0x50>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1118 <read_char+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_char>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x19,%cl
ja     1120 <read_char+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @read_char() {
%1 = alloca i8
br label %2
2: ; preds = %22, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br i1 %11, label %22, label %12
12: ; preds = %8, %4
%13 = load i8, i8* %1
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8, i8* %1
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br label %20
20: ; preds = %16, %12
%21 = phi i1 [ false, %12 ], [ %19, %16 ]
br label %22
22: ; preds = %20, %8
%23 = phi i1 [ true, %8 ], [ %21, %20 ]
%24 = xor i1 %23, true
br i1 %24, label %2, label %25
25: ; preds = %22
%26 = load i8, i8* %1
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @read_char() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = and i8 %2, -33
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
br i1 %5, label %6, label %1
6: ; preds = %1
ret i8 %2
}
/* Variables and functions */
double *smalloc(int);
double *mkvec(int nl, int nh) {
  double *v;
  v = smalloc((nh - nl + 1) * sizeof(double));
  return (v - nl);
}


x86 assembly (clang, -O0):
<mkvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <smalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkvec>:
push   %rbx
mov    %edi,%ebx
sub    %edi,%esi
lea    0x8(,%rsi,8),%edi
call   1030 <smalloc@plt>
movslq %ebx,%rcx
shl    $0x3,%rcx
sub    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @mkvec(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = trunc i64 %11 to i32
%13 = call double* @smalloc(i32 %12)
store double* %13, double** %5
%14 = load double*, double** %5
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = sub i64 0, %16
%18 = getelementptr inbounds double, double* %14, i64 %17
ret double* %18
}

LLVM IR (-O2):
define double* @mkvec(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 3
%5 = add i32 %4, 8
%6 = tail call double* @smalloc(i32 %5)
%7 = sext i32 %0 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds double, double* %6, i64 %8
ret double* %9
}
void ima_shm_check(struct file *file) { return; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @ima_shm_check(%struct.file* nocapture %0) {
ret void
}
int fun379() { return 379; }


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

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

LLVM IR (-O0):
define i32 @fun379() {
ret i32 379
}

LLVM IR (-O2):
define i32 @fun379() {
ret i32 379
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *name) {
  fprintf(stderr,
          "Usage: %s cork|nodelay|default <remote_ip> <remote_port> "
          "<delay_msec> [num_packets]\n",
          basename(name));
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%ebx
call   1040 <basename@plt>
lea    0xeca(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [85 x i8] c"Usage: %s cork|nodelay|default <remote_ip> <remote_port> <delay_msec> [num_packets]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [85 x i8] c"Usage: %s cork|nodelay|default <remote_ip> <remote_port> <delay_msec> [num_packets]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @basename(i8* %0)
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sortedArrayPositionsChange(int *, int);
int main() {
  int Arr[5] = {50, 20, 30, 40, 10};
  sortedArrayPositionsChange(Arr, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <sortedArrayPositionsChange@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <sortedArrayPositionsChange@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.Arr = [5 x i32] [i32 50, i32 20, i32 30, i32 40, i32 10]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @sortedArrayPositionsChange(i32* %4, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.Arr = [5 x i32] [i32 50, i32 20, i32 30, i32 40, i32 10]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @sortedArrayPositionsChange(i32* %3, i32 5)
ret i32 0
}
adr0regx1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = (p1[x1]); }


x86 assembly (clang, -O0):
<adr0regx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0regx1_set>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
mov    %eax,0x989680
ret

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

LLVM IR (-O2):
define i32 @adr0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
float nvg__maxf(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<nvg__maxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <nvg__maxf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <nvg__maxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvg__maxf>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @nvg__maxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @nvg__maxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_symbolic_src_length(char *src) {
  char dst[8] = "1234";
  strncat(dst, src, 3);
  if (strlen(dst) < 4)
    (void)*(char *)0;
  char dst2[8] = "1234";
  strncat(dst2, src, 4);
}


x86 assembly (clang, -O0):
<strncat_symbolic_src_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1040 <strncat@plt>
lea    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jge    115b <strncat_symbolic_src_length+0x3b>
mov    0xe9e(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_symbolic_src_length>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movq   $0x34333231,0x10(%rsp)
33 34
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <strncat@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
movq   $0x34333231,0x8(%rsp)
33 34
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <strncat@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.strncat_symbolic_src_length.dst = [8 x i8] c"1234\00\00\00\00"
@__const.strncat_symbolic_src_length.dst2 = [8 x i8] c"1234\00\00\00\00"
define void @strncat_symbolic_src_length(i8* %0) {
%2 = alloca i8*
%3 = alloca [8 x i8]
%4 = alloca [8 x i8]
store i8* %0, i8** %2
%5 = bitcast [8 x i8]* %3 to i8*
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strncat(i8* %6, i8* %7, i32 3)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i8, i8* null
br label %14
14: ; preds = %12, %1
%15 = bitcast [8 x i8]* %4 to i8*
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%17 = load i8*, i8** %2
%18 = call i32 @strncat(i8* %16, i8* %17, i32 4)
ret void
}

LLVM IR (-O2):
define void @strncat_symbolic_src_length(i8* %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
store i64 875770417, i64* %2
%5 = call i32 @strncat(i8* %4, i8* %0, i32 3)
%6 = call i32 @strlen(i8* %4)
%7 = bitcast i64* %3 to i8*
store i64 875770417, i64* %3
%8 = call i32 @strncat(i8* %7, i8* %0, i32 4)
ret void
}
int io_mode(int fd, int n) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @io_mode(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
char toupper(char);
void strupr(char *s) {
  int i;
  for (i = 0; s[i] != '\0'; s[i] = toupper(s[i]), i++)
    ;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1169 <strupr+0x59>
jmp    113d <strupr+0x2d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strupr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strupr+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strupr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strupr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @toupper(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t intlen(int32_t *table) {
  int32_t len = 0;
  while (table[len++] != -1)
    ;
  return len;
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     1130 <intlen+0x30>
jmp    110f <intlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpl   $0xffffffff,(%rdi,%rax,4)
lea    0x1(%rax),%rax
jne    1110 <intlen+0x10>
ret

LLVM IR (-O0):
define i32 @intlen(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %4
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @intlen(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i32, i32* %0, i64 %3
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ COLOR_PRIMARIES_STRINGS;

/* Variables and functions */
int /*<<< orphan*/ print_enum(char *, char const **, int);
void print_color_primaries() {
  static const char *COLOR_PRIMARIES_STRINGS[] = {
      "HDTV",
      "SDTV 525",
      "SDTV 625",
      "D-Cinema",
  };
  print_enum(
      "color_primaries", COLOR_PRIMARIES_STRINGS,
      (sizeof(COLOR_PRIMARIES_STRINGS) / sizeof((COLOR_PRIMARIES_STRINGS)[0])));
}


x86 assembly (clang, -O0):
<print_color_primaries>:
push   %rbp
mov    %rsp,%rbp
lea    0xf05(%rip),%rdi
lea    0x2f0e(%rip),%rsi
mov    $0x4,%edx
call   1030 <print_enum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_color_primaries>:
lea    0xf09(%rip),%rdi
lea    0x2f12(%rip),%rsi
mov    $0x4,%edx
jmp    1030 <print_enum@plt>

LLVM IR (-O0):
@print_color_primaries.COLOR_PRIMARIES_STRINGS = internal global [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0)]
@.str = [5 x i8] c"HDTV\00"
@.str.1 = [9 x i8] c"SDTV 525\00"
@.str.2 = [9 x i8] c"SDTV 625\00"
@.str.3 = [9 x i8] c"D-Cinema\00"
@.str.4 = [16 x i8] c"color_primaries\00"
define void @print_color_primaries() {
%1 = call i32 @print_enum(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @print_color_primaries.COLOR_PRIMARIES_STRINGS, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@print_color_primaries.COLOR_PRIMARIES_STRINGS = internal global [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0)]
@.str = [5 x i8] c"HDTV\00"
@.str.1 = [9 x i8] c"SDTV 525\00"
@.str.2 = [9 x i8] c"SDTV 625\00"
@.str.3 = [9 x i8] c"D-Cinema\00"
@.str.4 = [16 x i8] c"color_primaries\00"
define void @print_color_primaries() {
%1 = tail call i32 @print_enum(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @print_color_primaries.COLOR_PRIMARIES_STRINGS, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display_aux_message(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int atp(int testpoint) {
  char message[80];
  sprintf(message, "Aux Testpoint %d", testpoint);
  display_aux_message(message);
  return 0;
}


x86 assembly (clang, -O0):
<atp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <display_aux_message@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atp>:
push   %rbx
sub    $0x50,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <display_aux_message@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Aux Testpoint %d\00"
define i32 @atp(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = call i32 @display_aux_message(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Aux Testpoint %d\00"
define i32 @atp(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @display_aux_message(i8* %3)
ret i32 0
}
void a2i_ipadd(void) {}


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

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

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

LLVM IR (-O2):
define void @a2i_ipadd() {
ret void
}
/* Variables and functions */
int errno;
int errnoCallback(int value, void (*callback)()) {
  errno = value;
  callback();
  return errno;
}


x86 assembly (clang, -O0):
<errnoCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ec7(%rip),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   *-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errnoCallback>:
push   %rbx
mov    0x2ed8(%rip),%rbx
mov    %edi,(%rbx)
xor    %eax,%eax
call   *%rsi
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @errnoCallback(i32 %0, void (...)* nocapture %1) {
store i32 %0, i32* @errno
tail call void (...) %1()
%3 = load i32, i32* @errno
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *);
void print(char *text, int x, int y) { mvprintw(y, x, text); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rax
mov    %edx,%edi
mov    %rax,%rdx
jmp    1030 <mvprintw@plt>

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

LLVM IR (-O2):
define void @print(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @mvprintw(i32 %2, i32 %1, i8* %0)
ret void
}
void gui_ksys_debug_out(int c) {
  __asm__ __volatile__("int $0x40" : : "a"(63), "b"(1), "c"(c));
}


x86 assembly (clang, -O0):
<gui_ksys_debug_out>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x3f,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_debug_out>:
push   %rbx
mov    %edi,%ecx
mov    $0x3f,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @gui_ksys_debug_out(i32 %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 63, i32 1, i32 %0)
ret void
}
unsigned pascals_triangle_row_offset(unsigned row) {
  unsigned cells_in_row = (row + 1);
  if (row == 0) {
    return cells_in_row;
  } else {
    return cells_in_row + pascals_triangle_row_offset(row - 1);
  }
}


x86 assembly (clang, -O0):
<pascals_triangle_row_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1139 <pascals_triangle_row_offset+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <pascals_triangle_row_offset+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <pascals_triangle_row_offset@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pascals_triangle_row_offset>:
test   %edi,%edi
je     111c <pascals_triangle_row_offset+0x1c>
mov    %edi,%eax
imul   %edi,%eax
lea    -0x1(%rdi),%ecx
add    $0xfffffffe,%edi
imul   %rcx,%rdi
shr    %rdi
sub    %edi,%eax
add    $0x2,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pascals_triangle_row_offset(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add i32 %5, 1
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub i32 %13, 1
%15 = call i32 @pascals_triangle_row_offset(i32 %14)
%16 = add i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @pascals_triangle_row_offset(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = mul i32 %0, %0
%5 = add i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, 1
%13 = sub i32 %12, %11
%14 = add i32 %13, 1
br label %15
15: ; preds = %3, %1
%16 = phi i32 [ 1, %1 ], [ %14, %3 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ *def_handler();
int has_def_handler(void) { return (def_handler() != NULL); }


x86 assembly (clang, -O0):
<has_def_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <def_handler@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_def_handler>:
push   %rax
xor    %eax,%eax
call   1030 <def_handler@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @has_def_handler() {
%1 = call i32* (...) @def_handler()
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @has_def_handler() {
%1 = tail call i32* (...) @def_handler()
%2 = icmp ne i32* %1, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ poly2;
typedef int /*<<< orphan*/ poly1;

/* Variables and functions */
int /*<<< orphan*/ derivative(double *, int, int);
int main() {
  double poly1[3] = {4.0, 4.0, 1.0};
  double poly2[2] = {6.0, 4.0};
  derivative(poly1, (sizeof(poly1) / sizeof((poly1)[0])), 2);
  derivative(poly2, (sizeof(poly2) / sizeof((poly2)[0])), 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <derivative@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <derivative@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <derivative@plt>
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <derivative@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.poly1 = [3 x double] [double 4.000000e+00, double 4.000000e+00, double 1.000000e+00]
@__const.main.poly2 = [2 x double] [double 6.000000e+00, double 4.000000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x double]
%3 = alloca [2 x double]
store i32 0, i32* %1
%4 = bitcast [3 x double]* %2 to i8*
%5 = bitcast [2 x double]* %3 to i8*
%6 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%7 = call i32 @derivative(double* %6, i32 3, i32 2)
%8 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%9 = call i32 @derivative(double* %8, i32 2, i32 1)
ret i32 0
}

LLVM IR (-O2):
@__const.main.poly1 = [3 x double] [double 4.000000e+00, double 4.000000e+00, double 1.000000e+00]
@__const.main.poly2 = [2 x double] [double 6.000000e+00, double 4.000000e+00]
define i32 @main() {
%1 = alloca [3 x double]
%2 = alloca [2 x double]
%3 = bitcast [3 x double]* %1 to i8*
%4 = bitcast [2 x double]* %2 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%6 = call i32 @derivative(double* %5, i32 3, i32 2)
%7 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%8 = call i32 @derivative(double* %7, i32 2, i32 1)
ret i32 0
}
const char *raptorial_def_changelog(void) { return "debian/changelog"; }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"debian/changelog\00"
define i8* @raptorial_def_changelog() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"debian/changelog\00"
define i8* @raptorial_def_changelog() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
void repaint_splash_wnd(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @caller_2_1_2_2_2_2_1() {
ret void
}
void sanb_mem_write_ptr(void **v, void *value) {
  volatile void **p = (volatile void **)v;
  *p = value;
}


x86 assembly (clang, -O0):
<sanb_mem_write_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanb_mem_write_ptr>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @sanb_mem_write_ptr(i8** nocapture writeonly %0, i8* %1) {
store i8* %1, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_tracks();
void data_read(void) { read_tracks(); }


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

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

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

LLVM IR (-O2):
define void @data_read() {
%1 = tail call i32 (...) @read_tracks()
ret void
}
/* Variables and functions */
size_t SIZE_MAX;
void *rzalloc_size(void const *, size_t);
void *rzalloc_array_size(const void *ctx, size_t size, unsigned count) {
  if (count > SIZE_MAX / size)
    return NULL;
  return rzalloc_size(ctx, size * count);
}


x86 assembly (clang, -O0):
<rzalloc_array_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    1159 <rzalloc_array_size+0x49>
movq   $0x0,-0x8(%rbp)
jmp    1171 <rzalloc_array_size+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%eax
imul   %rax,%rsi
call   1030 <rzalloc_size@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rzalloc_array_size>:
mov    %edx,%ecx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1135 <rzalloc_array_size+0x25>
xor    %edx,%edx
div    %rsi
cmp    %rcx,%rax
jae    113e <rzalloc_array_size+0x2e>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %esi
cmp    %rcx,%rax
jb     1132 <rzalloc_array_size+0x22>
imul   %rsi,%rcx
mov    %rcx,%rsi
jmp    1030 <rzalloc_size@plt>

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i8* @rzalloc_array_size(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = load i64, i64* @SIZE_MAX
%11 = load i64, i64* %6
%12 = udiv i64 %10, %11
%13 = icmp ugt i64 %9, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i8* null, i8** %4
br label %22
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = load i32, i32* %7
%19 = zext i32 %18 to i64
%20 = mul i64 %17, %19
%21 = call i8* @rzalloc_size(i8* %16, i64 %20)
store i8* %21, i8** %4
br label %22
22: ; preds = %15, %14
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i8* @rzalloc_array_size(i8* %0, i64 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = load i64, i64* @SIZE_MAX
%6 = udiv i64 %5, %1
%7 = icmp ult i64 %6, %4
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = mul i64 %4, %1
%10 = tail call i8* @rzalloc_size(i8* %0, i64 %9)
br label %11
11: ; preds = %3, %8
%12 = phi i8* [ %10, %8 ], [ null, %3 ]
ret i8* %12
}
void am_default_isr(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @am_default_isr() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void ts_set_scrambling(uint8_t *p_ts, uint8_t i_scrambling) {
  p_ts[3] &= ~0xc0;
  p_ts[3] |= i_scrambling << 6;
}


x86 assembly (clang, -O0):
<ts_set_scrambling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xffffff3f,%ecx
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_set_scrambling>:
mov    $0xffffff3f,%eax
and    0xc(%rdi),%eax
shl    $0x6,%esi
or     %eax,%esi
mov    %esi,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @ts_set_scrambling(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
%4 = load i32, i32* %3
%5 = and i32 %4, -193
%6 = shl i32 %1, 6
%7 = or i32 %5, %6
store i32 %7, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void pusharg(int sz) {
  output(" atx A2;");
  if (sz > 1)
    output(" xtr A1,A3;");
}


x86 assembly (clang, -O0):
<pusharg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <output@plt>
cmpl   $0x1,-0x4(%rbp)
jle    113d <pusharg+0x2d>
lea    0xed1(%rip),%rdi
call   1030 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pusharg>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <output@plt>
cmp    $0x2,%ebx
jl     1131 <pusharg+0x21>
lea    0xede(%rip),%rdi
pop    %rbx
jmp    1030 <output@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c" atx A2;\00"
@.str.1 = [12 x i8] c" xtr A1,A3;\00"
define void @pusharg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @output(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" atx A2;\00"
@.str.1 = [12 x i8] c" xtr A1,A3;\00"
define void @pusharg(i32 %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @output(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextXY120(char const *, long, long, unsigned long,
                                 unsigned long);
void drawtextxy(const char *s, long x, long y, unsigned long cfg,
                unsigned long cbg) {
  DrawTextXY120(s, x, y, cfg, cbg);
}


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

x86 assembly (clang, -O2):
<drawtextxy>:
jmp    1030 <DrawTextXY120@plt>

LLVM IR (-O0):
define void @drawtextxy(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i64, i64* %10
%16 = call i32 @DrawTextXY120(i8* %11, i64 %12, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @drawtextxy(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @DrawTextXY120(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
__attribute__((visibility("default"))) int addFunction(int a, int b) {
  return a + b;
}


x86 assembly (clang, -O0):
<addFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addFunction>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @addFunction(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addFunction(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
__attribute__((always_)) unsigned int cpuid_ecx(unsigned int op) {
  unsigned int eax, ecx;
  __asm__("cpuid" : "=a"(eax), "=c"(ecx) : "0"(op) : "bx", "dx");
  return ecx;
}


x86 assembly (clang, -O0):
<cpuid_ecx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ecx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call { i32, i32 } asm "cpuid", "={ax},={cx},0,~{bx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %5)
%7 = extractvalue { i32, i32 } %6, 0
%8 = extractvalue { i32, i32 } %6, 1
store i32 %7, i32* %3
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @cpuid_ecx(i32 %0) {
%2 = tail call { i32, i32 } asm "cpuid", "={ax},={cx},0,~{bx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32 } %2, 1
ret i32 %3
}
int do_913() { return 913; }


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

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

LLVM IR (-O0):
define i32 @do_913() {
ret i32 913
}

LLVM IR (-O2):
define i32 @do_913() {
ret i32 913
}