xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ perror(char *);
void gt_xfstat(int fd, struct stat *sb) {
  if (fstat(fd, sb)) {
    perror("cannot fstat");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<gt_xfstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <fstat@plt>
cmp    $0x0,%rax
je     116f <gt_xfstat+0x3f>
lea    0xea4(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_xfstat>:
push   %rax
call   1050 <fstat@plt>
test   %rax,%rax
jne    113d <gt_xfstat+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [13 x i8] c"cannot fstat\00"
@EXIT_FAILURE = global i32 0
define void @gt_xfstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i64 @fstat(i32 %5, %struct.stat* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [13 x i8] c"cannot fstat\00"
@EXIT_FAILURE = global i32 0
define void @gt_xfstat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i64 @fstat(i32 %0, %struct.stat* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void ioprint(char *txt) {
  while (*txt) {
    putc(*txt);
    txt++;
  }
}


x86 assembly (clang, -O0):
<ioprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <ioprint+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ioprint+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ioprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call i32 @putc(i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ioprint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @putc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *thread_2(void *argv) {
  while (1) {
    sleep(2);
    printf("I am thread_2\n");
  }
}


x86 assembly (clang, -O0):
<thread_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <thread_2+0xc>

x86 assembly (clang, -O2):
<thread_2>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1130 <thread_2+0x10>

LLVM IR (-O0):
@.str = [15 x i8] c"I am thread_2\0A\00"
define i8* @thread_2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@str = [14 x i8] c"I am thread_2\00"
define noalias i8* @thread_2(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int pName(char *value) {
  printf("Name : %s\n", value);
  return 0;
}


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

x86 assembly (clang, -O2):
<pName>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Name : %s\0A\00"
define i32 @pName(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
signed long long int
signedlonglongint_ignoring_unsignedlong(signed long long int x,
                                        unsigned long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglongint_ignoring_unsignedlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_unsignedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateWakeSet(unsigned long ulWakeFlags) {
  DEBUG_ASSERT(!(ulWakeFlags & ~(0x00000010 | 0x00000008 | 0x00000200)));
  (*((volatile unsigned long *)(0x400FC010))) =
      (ulWakeFlags | ((*((volatile unsigned long *)(0x400FC010))) &
                      ~(0x00000010 | 0x00000008 | 0x00000200)));
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateWakeSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffffffffffde7,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xfffffffffffffde7,%rax
or     %rax,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateWakeSet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   $0xfffffffffffffde7,%rbx
sete   %dil
call   1040 <DEBUG_ASSERT@plt>
mov    $0xfffffffffffffde7,%rax
and    0x400fc010,%rax
40
or     %rbx,%rax
mov    %rax,0x400fc010
40
xor    %eax,%eax
pop    %rbx
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateWakeSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -537
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %2
%10 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%11 = and i64 %10, -537
%12 = or i64 %9, %11
store volatile i64 %12, i64* inttoptr (i64 1074774032 to i64*)
%13 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateWakeSet(i64 %0) {
%2 = and i64 %0, -537
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%7 = and i64 %6, -537
%8 = or i64 %7, %0
store volatile i64 %8, i64* inttoptr (i64 1074774032 to i64*)
%9 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char const);
int is_identifier_character(const char ch) {
  if (isalpha(ch) || (ch >= '0' && ch <= '9') || ch == '_') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_identifier_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
jne    1158 <is_identifier_character+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     114b <is_identifier_character+0x3b>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <is_identifier_character+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    1164 <is_identifier_character+0x54>
movl   $0x1,-0x4(%rbp)
jmp    116b <is_identifier_character+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_identifier_character>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <is_identifier_character+0x17>
pop    %rbx
ret
lea    -0x30(%rbx),%eax
cmp    $0xa,%al
setb   %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_identifier_character(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 48
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 57
br i1 %14, label %19, label %15
15: ; preds = %11, %7
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 95
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_identifier_character(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = icmp eq i8 %0, 95
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %9, %4 ]
ret i32 %11
}
int main() { return 1UL >= 0UL; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
long long osfreq();
long long cpucycles_ia64cpuinfo_persecond(void) { return osfreq(); }


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

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

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

LLVM IR (-O2):
define i64 @cpucycles_ia64cpuinfo_persecond() {
%1 = tail call i64 (...) @osfreq()
ret i64 %1
}
/* Variables and functions */
scalar_t__ pow(int, int);
double compound_interest(double capital, double rate, int time) {
  return capital * (double)pow((1 + rate), time);
}


x86 assembly (clang, -O0):
<compound_interest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec9(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
mov    -0x14(%rbp),%esi
call   1030 <pow@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compound_interest>:
push   %rax
mov    %edi,%esi
movsd  %xmm0,(%rsp)
addsd  0xee0(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @compound_interest(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double 1.000000e+00, %8
%10 = fptosi double %9 to i32
%11 = load i32, i32* %6
%12 = call i64 @pow(i32 %10, i32 %11)
%13 = sitofp i64 %12 to double
%14 = fmul double %7, %13
ret double %14
}

LLVM IR (-O2):
define double @compound_interest(double %0, double %1, i32 %2) {
%4 = fadd double %1, 1.000000e+00
%5 = fptosi double %4 to i32
%6 = tail call i64 @pow(i32 %5, i32 %2)
%7 = sitofp i64 %6 to double
%8 = fmul double %7, %0
ret double %8
}
/* Variables and functions */
int nonzero(void *mem, size_t size) {
  unsigned char *x = NULL;
  size_t i;
  x = mem;
  for (i = 0; i < size; i++) {
    if (x[i] != 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1169 <nonzero+0x69>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <nonzero+0x53>
movl   $0x1,-0x4(%rbp)
jmp    1170 <nonzero+0x70>
jmp    1158 <nonzero+0x58>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1124 <nonzero+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonzero>:
test   %rsi,%rsi
je     111f <nonzero+0x1f>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
jne    1122 <nonzero+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <nonzero+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @nonzero(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %6
4: ; preds = %6
%5 = icmp eq i64 %11, %1
br i1 %5, label %12, label %6
6: ; preds = %2, %4
%7 = phi i64 [ %11, %4 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = add nuw i64 %7, 1
br i1 %10, label %4, label %12
12: ; preds = %6, %4, %2
%13 = phi i32 [ 0, %2 ], [ 0, %4 ], [ 1, %6 ]
ret i32 %13
}
/* Variables and functions */
float getSqrt(float *, int);
void Quaternion_Normalize(float *q) {
  float norm = getSqrt(q, 4);
  q[0] /= norm;
  q[1] /= norm;
  q[2] /= norm;
  q[3] /= norm;
}


x86 assembly (clang, -O0):
<Quaternion_Normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <getSqrt@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
movss  -0xc(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Quaternion_Normalize>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%esi
call   1030 <getSqrt@plt>
movups (%rbx),%xmm1
shufps $0x0,%xmm0,%xmm0
divps  %xmm0,%xmm1
movups %xmm1,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Quaternion_Normalize(float* %0) {
%2 = tail call float @getSqrt(float* %0, i32 4)
%3 = bitcast float* %0 to <4 x float>*
%4 = load <4 x float>, <4 x float>* %3
%5 = insertelement <4 x float> poison, float %2, i64 0
%6 = shufflevector <4 x float> %5, <4 x float> poison, <4 x i32> zeroinitializer
%7 = fdiv <4 x float> %4, %6
%8 = bitcast float* %0 to <4 x float>*
store <4 x float> %7, <4 x float>* %8
ret void
}
/* Variables and functions */
int open(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int dev_open(char *name, int flag) {
  char tun_name[100] = "/dev/";
  strcat(tun_name, name);
  return open(tun_name, flag);
}


x86 assembly (clang, -O0):
<dev_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
movb   $0x2f,-0x70(%rbp)
movb   $0x64,-0x6f(%rbp)
movb   $0x65,-0x6e(%rbp)
movb   $0x76,-0x6d(%rbp)
movb   $0x2f,-0x6c(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_open>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
mov    %esi,%ebp
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x7665642f,(%rsp)
movb   $0x2f,0x4(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <open@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dev_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [100 x i8]* %5 to i8*
%7 = bitcast i8* %6 to [100 x i8]*
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 0
store i8 47, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 1
store i8 100, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 2
store i8 101, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 3
store i8 118, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 4
store i8 47, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%14 = load i8*, i8** %3
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%17 = load i32, i32* %4
%18 = call i32 @open(i8* %16, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @dev_open(i8* %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8 47, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 1
store i8 100, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 2
store i8 101, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 3
store i8 118, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 4
store i8 47, i8* %8
%9 = call i32 @strcat(i8* %4, i8* %0)
%10 = call i32 @open(i8* %4, i32 %1)
ret i32 %10
}
int test_imm_72uint16_reg(unsigned short val) {
  return ((val) & (0x72 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_72uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x72,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_72uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 114
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void create_pwm_low_side_drivers(int pwm2, int pwm1, int pwm0) {}


x86 assembly (clang, -O0):
<create_pwm_low_side_drivers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @create_pwm_low_side_drivers(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @create_pwm_low_side_drivers(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ISA_init(int);
void board_isa_init(void) { ISA_init(0x80000000); }


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

x86 assembly (clang, -O2):
<board_isa_init>:
mov    $0x80000000,%edi
jmp    1030 <ISA_init@plt>

LLVM IR (-O0):
define void @board_isa_init() {
%1 = call i32 @ISA_init(i32 -2147483648)
ret void
}

LLVM IR (-O2):
define void @board_isa_init() {
%1 = tail call i32 @ISA_init(i32 -2147483648)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, unsigned long);
void printf_number(char *buf, size_t buf_size, unsigned long number) {
  snprintf(buf, buf_size, number < 10 ? "%lu" : "0x%02lx", number);
}


x86 assembly (clang, -O0):
<printf_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xecd(%rip),%rdx
lea    0xec2(%rip),%rax
cmp    $0xa,%rcx
cmovb  %rax,%rdx
mov    -0x18(%rbp),%rcx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_number>:
mov    %rdx,%rcx
cmp    $0xa,%rdx
lea    0xee2(%rip),%rax
lea    0xedf(%rip),%rdx
cmovb  %rax,%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
@.str.1 = [8 x i8] c"0x%02lx\00"
define void @printf_number(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = icmp ult i64 %9, 10
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%13 = load i64, i64* %6
%14 = call i32 @snprintf(i8* %7, i64 %8, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
@.str.1 = [8 x i8] c"0x%02lx\00"
define void @printf_number(i8* %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %2, 10
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @snprintf(i8* %0, i64 %1, i8* %5, i64 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int /*<<< orphan*/ const *EVP_rc5_32_12_16_cfb64();
const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void) {
  return EVP_rc5_32_12_16_cfb64();
}


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

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

LLVM IR (-O0):
define i32* @EVP_rc5_32_12_16_cfb() {
%1 = call i32* (...) @EVP_rc5_32_12_16_cfb64()
ret i32* %1
}

LLVM IR (-O2):
define i32* @EVP_rc5_32_12_16_cfb() {
%1 = tail call i32* (...) @EVP_rc5_32_12_16_cfb64()
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ ECHILD;
int /*<<< orphan*/ errno;
int _wait(int *status) {
  if (status) {
  }
  errno = ECHILD;
  return -1;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <_wait+0x18>
jmp    1118 <_wait+0x18>
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* @ECHILD
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ECHILD = global i32 0
@errno = global i32 0
define i32 @_wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @ECHILD
store i32 %2, i32* @errno
ret i32 -1
}
int fun441() { return 441; }


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

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

LLVM IR (-O0):
define i32 @fun441() {
ret i32 441
}

LLVM IR (-O2):
define i32 @fun441() {
ret i32 441
}
/* Variables and functions */
int /*<<< orphan*/ bwputs(char *);
int /*<<< orphan*/ syscall();
void first(void) {
  bwputs("In user mode\n");
  syscall();
  bwputs("We back boyz\n");
  while (1)
    syscall();
}


x86 assembly (clang, -O0):
<first>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <bwputs@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
lea    0xed0(%rip),%rdi
call   1030 <bwputs@plt>
mov    $0x0,%al
call   1040 <syscall@plt>
jmp    1143 <first+0x23>

x86 assembly (clang, -O2):
<first>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <bwputs@plt>
xor    %eax,%eax
call   1040 <syscall@plt>
lea    0xed3(%rip),%rdi
call   1030 <bwputs@plt>
xor    %eax,%eax
call   1040 <syscall@plt>
jmp    1140 <first+0x20>

LLVM IR (-O0):
@.str = [14 x i8] c"In user mode\0A\00"
@.str.1 = [14 x i8] c"We back boyz\0A\00"
define void @first() {
%1 = call i32 @bwputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @syscall()
%3 = call i32 @bwputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = call i32 (...) @syscall()
br label %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"In user mode\0A\00"
@.str.1 = [14 x i8] c"We back boyz\0A\00"
define void @first() {
%1 = tail call i32 @bwputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @syscall()
%3 = tail call i32 @bwputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @syscall()
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ buf0;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
void fun0() {
  char buf0[100];
  printf("What is 1 divided by 0?\n");
  fgets(buf0, sizeof(buf0), stdin);
}


x86 assembly (clang, -O0):
<fun0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun0>:
sub    $0x68,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x64,%esi
call   1040 <fgets@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"What is 1 divided by 0?\0A\00"
@stdin = global i32 0
define void @fun0() {
%1 = alloca [100 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 100, i32 %4)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@str = [24 x i8] c"What is 1 divided by 0?\00"
define void @fun0() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 100, i32 %4)
ret void
}
int test_imm_8Euint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x8E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Euint64_highword_reg>:
movabs $0x8e00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Euint64_highword_reg(i64 %0) {
%2 = and i64 %0, 609885356032
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int dlna_get_audio_profile_lpcm(int channels, int bitrate, char *profile,
                                char *mimeType) {
  strcpy(mimeType, "audio/L16");
  strcpy(profile, "LPCM");
  return 0;
}


x86 assembly (clang, -O0):
<dlna_get_audio_profile_lpcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlna_get_audio_profile_lpcm>:
push   %rbx
mov    %rdx,%rbx
lea    0xee5(%rip),%rsi
mov    %rcx,%rdi
call   1030 <strcpy@plt>
lea    0xee0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"audio/L16\00"
@.str.1 = [5 x i8] c"LPCM\00"
define i32 @dlna_get_audio_profile_lpcm(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %7
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"audio/L16\00"
@.str.1 = [5 x i8] c"LPCM\00"
define i32 @dlna_get_audio_profile_lpcm(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ insert_sort(int *, int);
int /*<<< orphan*/ print_array(int *, int);
int main() {
  int data[] = {10, 4, 1, 32, 5, 6, 1};
  int size = sizeof(data) / sizeof(int);
  print_array(data, size);
  insert_sort(data, size);
  print_array(data, size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <print_array@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <insert_sort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xee0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <insert_sort@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.data = [7 x i32] [i32 10, i32 4, i32 1, i32 32, i32 5, i32 6, i32 1]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca i32
%3 = bitcast [7 x i32]* %1 to i8*
store i32 7, i32* %2
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @print_array(i32* %4, i32 %5)
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @insert_sort(i32* %7, i32 %8)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @print_array(i32* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data = [7 x i32] [i32 10, i32 4, i32 1, i32 32, i32 5, i32 6, i32 1]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 7)
%5 = call i32 @insert_sort(i32* %3, i32 7)
%6 = call i32 @print_array(i32* %3, i32 7)
ret i32 0
}
/* Type definitions */
typedef enum foobar { ____Placeholder_foobar } foobar;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  enum foobar { MEMA, MEMB, MEMC, MEMD, MEME = 1024, MEMF, MAX = MEMF };
  enum barbar {
    BARMEMA,
    BARMEMB,
    BARMEMC,
    BARMEMD,
  };
  enum foobar foob;
  foob = MAX;
  printf("%d %d %d %d\n", MEMA, MEMB, MEMC, MEMD);
  printf("%d %d %d\n", MEME, MEMF, MAX);
  printf("%d\n", foob);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x401,-0x8(%rbp)
lea    0xed3(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x400,%esi
mov    $0x401,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x400,%esi
mov    $0x401,%edx
mov    $0x401,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x401,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 2, i32 3)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 1024, i32 1025, i32 1025)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1025)
ret i32 0
}
void do_patch_change(char prognumber) {}


x86 assembly (clang, -O0):
<do_patch_change>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_patch_change(i8 signext %0) {
ret void
}
void ieee80211_proc_deinit_interface(struct ieee80211_local *local) {}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_local = type opaque
define void @ieee80211_proc_deinit_interface(%struct.ieee80211_local* nocapture %0) {
ret void
}
long lsmod(long a, long b) { return a % b; }


x86 assembly (clang, -O0):
<lsmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsmod>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <lsmod+0x18>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @lsmod(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = srem i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @lsmod(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
ret i64 %3
}
void answer_accepted(void) {}


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

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

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

LLVM IR (-O2):
define void @answer_accepted() {
ret void
}
/* Variables and functions */
int open_logfile(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, int);
int open_logfile_mpi(char *proc_name, int my_proc_num, int num_procs) {
  char fn[1024];
  sprintf(fn, "log-%s-%d_%d", proc_name, my_proc_num, num_procs);
  return open_logfile(fn);
}


x86 assembly (clang, -O0):
<open_logfile_mpi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeb2(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <open_logfile@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_logfile_mpi>:
push   %rbx
sub    $0x400,%rsp
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xec9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <open_logfile@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"log-%s-%d_%d\00"
define i32 @open_logfile_mpi(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i32 %11)
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i32 @open_logfile(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [13 x i8] c"log-%s-%d_%d\00"
define i32 @open_logfile_mpi(i8* %0, i32 %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
%7 = call i32 @open_logfile(i8* %5)
ret i32 %7
}
int d_bgt_rr1(double a1, double a2) { return (__builtin_isgreater(a1, a2)); }


x86 assembly (clang, -O0):
<d_bgt_rr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bgt_rr1>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @d_bgt_rr1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @d_bgt_rr1(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ list4(int, int, int, int);
int pair(int, int /*<<< orphan*/);
int list5(int a, int b, int c, int d, int e) {
  return pair(a, list4(b, c, d, e));
}


x86 assembly (clang, -O0):
<list5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <list4@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1030 <pair@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list5>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
call   1040 <list4@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <pair@plt>

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

LLVM IR (-O2):
define i32 @list5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @list4(i32 %1, i32 %2, i32 %3, i32 %4)
%7 = tail call i32 @pair(i32 %0, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void got_libend(char *cp, int len) {
  (void)cp;
  (void)len;
  printf("LIBEND\n");
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"LIBEND\00"
define void @got_libend(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char,
                           unsigned char, unsigned char, unsigned char);
int /*<<< orphan*/ stderr;
void cpu_dump_id_segment(unsigned char reg[4]) {
  (void)fprintf(stderr, "%c%c%c%c", reg[0], reg[1], reg[2], reg[3]);
}


x86 assembly (clang, -O0):
<cpu_dump_id_segment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x8(%rbp),%rax
lea    0xebb(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl 0x3(%rax),%r9d
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_dump_id_segment>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
movzbl (%rdi),%edx
movzbl 0x1(%rdi),%ecx
movzbl 0x2(%rdi),%r8d
movzbl 0x3(%rdi),%r9d
lea    0xecf(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"%c%c%c%c\00"
define void @cpu_dump_id_segment(i8* nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 3
%9 = load i8, i8* %8
%10 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 zeroext %3, i8 zeroext %5, i8 zeroext %7, i8 zeroext %9)
ret void
}