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

/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void write_string(char *text, int length, FILE *fp) {
  for (; (length > 0); length--)
    putc(*text++, fp);
  putc('\0', fp);
}


x86 assembly (clang, -O0):
<write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1158 <write_string+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <write_string+0x13>
mov    -0x18(%rbp),%rsi
xor    %edi,%edi
call   1030 <putc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
test   %esi,%esi
jle    1147 <write_string+0x37>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rbx),%edi
add    $0x1,%rbx
mov    %r14,%rsi
call   1030 <putc@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <write_string+0x20>
xor    %edi,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @write_string(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
br label %7
7: ; preds = %16, %3
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8, i8* %11
%14 = load i32*, i32** %6
%15 = call i32 @putc(i8 signext %13, i32* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = load i32*, i32** %6
%21 = call i32 @putc(i8 signext 0, i32* %20)
ret void
}

LLVM IR (-O2):
define void @write_string(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %5
%6 = phi i8* [ %8, %5 ], [ %0, %3 ]
%7 = phi i32 [ %11, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = tail call i32 @putc(i8 signext %9, i32* %2)
%11 = add nsw i32 %7, -1
%12 = icmp ugt i32 %7, 1
br i1 %12, label %5, label %13
13: ; preds = %5, %3
%14 = tail call i32 @putc(i8 signext 0, i32* %2)
ret void
}
void markAsPermanent(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @markAsPermanent(i8* nocapture %0) {
ret void
}
int cnt_comp_noalpha(const void *ap, const void *bp) {
  int a = *(int *)ap, b = *(int *)bp;
  return (a & 0x00FFFFFF) - (b & 0x00FFFFFF);
}


x86 assembly (clang, -O0):
<cnt_comp_noalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0xffffff,%eax
mov    -0x18(%rbp),%ecx
and    $0xffffff,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnt_comp_noalpha>:
mov    $0xffffff,%ecx
mov    (%rdi),%eax
and    %ecx,%eax
and    (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cnt_comp_noalpha(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = and i32 %13, 16777215
%15 = load i32, i32* %6
%16 = and i32 %15, 16777215
%17 = sub nsw i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @cnt_comp_noalpha(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = and i32 %4, 16777215
%8 = and i32 %6, 16777215
%9 = sub nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void mergeSort(int *A, int f, int l) {
  int mid;
  mid = (f + l) / 2;
  if (f < l) {
    mergeSort(A, f, mid);
    mergeSort(A, mid + 1, l);
    merge(A, f, l, mid);
  }
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <mergeSort+0x62>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <mergeSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
cmp    %edx,%esi
jge    1172 <mergeSort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <mergeSort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <mergeSort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

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

LLVM IR (-O2):
define void @mergeSort(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = sdiv i32 %4, 2
%6 = icmp slt i32 %1, %2
br i1 %6, label %8, label %7
7: ; preds = %3, %8
ret void
8: ; preds = %3
tail call void @mergeSort(i32* %0, i32 %1, i32 %5)
%9 = add nsw i32 %5, 1
tail call void @mergeSort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %2, i32 %5)
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((weak)) weakBrace1(void) { printf("redefine"); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"redefine\00"
define weak void @weakBrace1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void dispatcher_process_init(int worker) {}


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

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

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

LLVM IR (-O2):
define void @dispatcher_process_init(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ output_sib(int /*<<< orphan*/, int, int);
void emit_fldcw_stack() {
  assem_debug("fldcw (%%esp)\n");
  output_byte(0xd9);
  output_modrm(0, 4, 5);
  output_sib(0, 4, 4);
}


x86 assembly (clang, -O0):
<emit_fldcw_stack>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x5,%edx
call   1050 <output_modrm@plt>
xor    %edi,%edi
mov    $0x4,%edx
mov    %edx,%esi
call   1060 <output_sib@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fldcw_stack>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xd9,%edi
call   1040 <output_byte@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x5,%edx
call   1050 <output_modrm@plt>
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x4,%edx
pop    %rax
jmp    1060 <output_sib@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fldcw (%%esp)\0A\00"
define void @emit_fldcw_stack() {
%1 = call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @output_byte(i32 217)
%3 = call i32 @output_modrm(i32 0, i32 4, i32 5)
%4 = call i32 @output_sib(i32 0, i32 4, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fldcw (%%esp)\0A\00"
define void @emit_fldcw_stack() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @output_byte(i32 217)
%3 = tail call i32 @output_modrm(i32 0, i32 4, i32 5)
%4 = tail call i32 @output_sib(i32 0, i32 4, i32 4)
ret void
}
unsigned short float_to_fract1_15(double val) {
  unsigned long long llval;
  if (val < 0.0)
    val = 0.0;
  else if (val >= 2.0)
    val = 1.999999;
  val *= 1000000;
  llval = (unsigned long long)val * 0x8000UL;
  return (llval / 1000000);
}


x86 assembly (clang, -O0):
<float_to_fract1_15>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1124 <float_to_fract1_15+0x24>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114d <float_to_fract1_15+0x4d>
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1148 <float_to_fract1_15+0x48>
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114d <float_to_fract1_15+0x4d>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea8(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
shl    $0xf,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %rcx
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_to_fract1_15>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     1120 <float_to_fract1_15+0x20>
ucomisd 0xeee(%rip),%xmm0
movapd %xmm0,%xmm1
jb     1120 <float_to_fract1_15+0x20>
movsd  0xee8(%rip),%xmm1
mulsd  0xee8(%rip),%xmm1
cvttsd2si %xmm1,%rcx
mov    %rcx,%rdx
subsd  0xee0(%rip),%xmm1
cvttsd2si %xmm1,%rax
sar    $0x3f,%rdx
and    %rdx,%rax
or     %rcx,%rax
shl    $0xf,%rax
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mul    %rcx
mov    %rdx,%rax
shr    $0x12,%rax
ret

LLVM IR (-O0):
define zeroext i16 @float_to_fract1_15(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %2
%9 = fcmp oge double %8, 2.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double 0x3FFFFFFEF39085F5, double* %2
br label %11
11: ; preds = %10, %7
br label %12
12: ; preds = %11, %6
%13 = load double, double* %2
%14 = fmul double %13, 1.000000e+06
store double %14, double* %2
%15 = load double, double* %2
%16 = fptoui double %15 to i64
%17 = mul i64 %16, 32768
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = udiv i64 %18, 1000000
%20 = trunc i64 %19 to i16
ret i16 %20
}

LLVM IR (-O2):
define zeroext i16 @float_to_fract1_15(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fcmp ult double %0, 2.000000e+00
br i1 %4, label %6, label %5
5: ; preds = %3
br label %6
6: ; preds = %1, %3, %5
%7 = phi double [ 0x3FFFFFFEF39085F5, %5 ], [ %0, %3 ], [ 0.000000e+00, %1 ]
%8 = fmul double %7, 1.000000e+06
%9 = fptoui double %8 to i64
%10 = shl i64 %9, 15
%11 = udiv i64 %10, 1000000
%12 = trunc i64 %11 to i16
ret i16 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtsi64_si128(long long);
__m128i test(long long b) { return _mm_cvtsi64_si128(b); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cvtsi64_si128@plt>

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

LLVM IR (-O2):
define i32 @test(i64 %0) {
%2 = tail call i32 @_mm_cvtsi64_si128(i64 %0)
ret i32 %2
}
/* Variables and functions */
void putc(int c) {
  while (!(*(volatile unsigned char *)(0x11005000 + 0x14) & 0x20))
    ;
  *(volatile unsigned char *)(0x11005000 + 0x0) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x11005014,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <putc+0x29>
jmp    112e <putc+0x2e>
jmp    1107 <putc+0x7>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x11005000,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
testb  $0x20,0x11005014
20
je     1100 <putc>
mov    %dil,0x11005000
11
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = load volatile i8, i8* inttoptr (i64 285233172 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* inttoptr (i64 285233152 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i8, i8* inttoptr (i64 285233172 to i8*)
%4 = and i8 %3, 32
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = trunc i32 %0 to i8
store volatile i8 %7, i8* inttoptr (i64 285233152 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage() {
  printf("\nrandtest (c) Rafael Alvarez, 2004-2013\n\n");
  printf("Usage: randtest [-p|-u|-t] sequencefile <reportfile>\n\n"
         "-p packed mode, -u unpacked mode, -t text mode\n"
         "sequencefile is mandatory, reportfile is optional\n"
         "if no reportfile is given, report is presented on std output.\n\n");
}


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

x86 assembly (clang, -O2):
<Usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"\0Arandtest (c) Rafael Alvarez, 2004-2013\0A\0A\00"
@.str.1 = [215 x i8] c"Usage: randtest [-p|-u|-t] sequencefile <reportfile>\0A\0A-p packed mode, -u unpacked mode, -t text mode\0Asequencefile is mandatory, reportfile is optional\0Aif no reportfile is given, report is presented on std output.\0A\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([215 x i8], [215 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"\0Arandtest (c) Rafael Alvarez, 2004-2013\0A\00"
@str.2 = [214 x i8] c"Usage: randtest [-p|-u|-t] sequencefile <reportfile>\0A\0A-p packed mode, -u unpacked mode, -t text mode\0Asequencefile is mandatory, reportfile is optional\0Aif no reportfile is given, report is presented on std output.\0A\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([214 x i8], [214 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
float _log_meter(float, double, double, double);
float alt_log_meter(float power) { return _log_meter(power, -192.0, 0.0, 8.0); }


x86 assembly (clang, -O0):
<alt_log_meter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
xorps  %xmm2,%xmm2
movsd  0xed3(%rip),%xmm3
call   1030 <_log_meter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alt_log_meter>:
movsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm3
xorps  %xmm2,%xmm2
jmp    1030 <_log_meter@plt>

LLVM IR (-O0):
define float @alt_log_meter(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @_log_meter(float %3, double -1.920000e+02, double 0.000000e+00, double 8.000000e+00)
ret float %4
}

LLVM IR (-O2):
define float @alt_log_meter(float %0) {
%2 = tail call float @_log_meter(float %0, double -1.920000e+02, double 0.000000e+00, double 8.000000e+00)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
main() {
  int num1, num2, num3;
  printf("Please insert three integers:\n");
  scanf("%d %d %d", &num1, &num2, &num3);
  printf("\nYour numbers were: %d, %d and %d.\n", num1, num2, num3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Please insert three integers:\0A\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [36 x i8] c"\0AYour numbers were: %d, %d and %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [36 x i8] c"\0AYour numbers were: %d, %d and %d.\0A\00"
@str = [30 x i8] c"Please insert three integers:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
char *cfg_get_str(char *, char *);
int cfg_get_signed_int(char *sec, char *ent) {
  char *val;
  val = cfg_get_str(sec, ent);
  if (NULL == val)
    return 0;
  return atoi(val);
}


x86 assembly (clang, -O0):
<cfg_get_signed_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cfg_get_str@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    1159 <cfg_get_signed_int+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1165 <cfg_get_signed_int+0x45>
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_get_signed_int>:
push   %rax
call   1030 <cfg_get_str@plt>
test   %rax,%rax
je     1134 <cfg_get_signed_int+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cfg_get_signed_int(i8* %0, i8* %1) {
%3 = tail call i8* @cfg_get_str(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @atoi(i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ issafeadd(int, int);
int safeadd(int x, int y) {
  if (!issafeadd(x, y)) {
    error("safeadd");
  }
  return x + y;
}


x86 assembly (clang, -O0):
<safeadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <issafeadd@plt>
cmp    $0x0,%eax
jne    114e <safeadd+0x2e>
lea    0xeb7(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeadd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <issafeadd@plt>
test   %eax,%eax
jne    113c <safeadd+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <error@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"safeadd\00"
define i32 @safeadd(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 = call i32 @issafeadd(i32 %5, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@.str = [8 x i8] c"safeadd\00"
define i32 @safeadd(i32 %0, i32 %1) {
%3 = tail call i32 @issafeadd(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = add nsw i32 %1, %0
ret i32 %8
}
void clean(char w[]) {
  unsigned int i = 0;
  while (i < 30)
    w[i++] = '_';
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jae    1133 <clean+0x33>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    %ecx,%ecx
movb   $0x5f,(%rax,%rcx,1)
jmp    110f <clean+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0xe(%rdi)
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @clean(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 30
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = add i32 %9, 1
store i32 %10, i32* %3
%11 = zext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
store i8 95, i8* %12
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clean(i8* nocapture writeonly %0) {
ret void
}
int get_rtc_second(void) {
  (*(volatile unsigned int *)(0x7E005040)) |= (1 << 3);
  (*(volatile unsigned int *)(0x7E005040)) = 1;
  char value = (*(volatile unsigned int *)(0x7E005070));
  int second = ((value >> 4) & 0x7) * 10 + (value & 0xF);
  (*(volatile unsigned int *)(0x7E005040)) = 0;
  return second;
}


x86 assembly (clang, -O0):
<get_rtc_second>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e005040,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x7e005040,%eax
mov    %ecx,(%rax)
mov    $0x7e005040,%eax
movl   $0x1,(%rax)
mov    $0x7e005070,%eax
mov    (%rax),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0x7,%eax
imul   $0xa,%eax,%eax
movsbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7e005040,%eax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rtc_second>:
orl    $0x8,0x7e005040
08
movl   $0x1,0x7e005040
mov    0x7e005070,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
and    $0x7,%ecx
lea    (%rcx,%rcx,4),%ecx
and    $0xf,%eax
lea    (%rax,%rcx,2),%eax
movl   $0x0,0x7e005040
ret

LLVM IR (-O0):
define i32 @get_rtc_second() {
%1 = alloca i8
%2 = alloca i32
%3 = load volatile i32, i32* inttoptr (i64 2113949760 to i32*)
%4 = or i32 %3, 8
store volatile i32 %4, i32* inttoptr (i64 2113949760 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113949760 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 2113949808 to i32*)
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = and i32 %9, 7
%11 = mul nsw i32 %10, 10
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = and i32 %13, 15
%15 = add nsw i32 %11, %14
store i32 %15, i32* %2
store volatile i32 0, i32* inttoptr (i64 2113949760 to i32*)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_rtc_second() {
%1 = load volatile i32, i32* inttoptr (i64 2113949760 to i32*)
%2 = or i32 %1, 8
store volatile i32 %2, i32* inttoptr (i64 2113949760 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113949760 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 2113949808 to i32*)
%4 = lshr i32 %3, 4
%5 = and i32 %4, 7
%6 = mul nuw nsw i32 %5, 10
%7 = and i32 %3, 15
%8 = add nuw nsw i32 %6, %7
store volatile i32 0, i32* inttoptr (i64 2113949760 to i32*)
ret i32 %8
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void foo() {
  int i = 0;
  for (i; i < 10000000; i++) {
    struct timeval tv;
    gettimeofday(&tv, NULL);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x989680,-0x4(%rbp)
jge    1147 <foo+0x37>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    $0x989680,%ebp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
add    $0xffffffff,%ebp
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @foo() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = load i32, i32* %1
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 10000000
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
br label %9
9: ; preds = %7
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %4
12: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @foo() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 10000000
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
cbuf10(f, n) int f, n;
{ cbuf(f, n, 10); }


x86 assembly (clang, -O0):
<cbuf10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0xa,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf10>:
mov    $0xa,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf10(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 10)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf10(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 10)
ret i32 undef
}
/* Type definitions */
struct timespec {
  long long tv_nsec;
  long long tv_sec;
};

/* Variables and functions */
void backend_timespec_add(struct timespec *t, long long i) {
  i += t->tv_nsec;
  t->tv_sec += i / 1000000000;
  t->tv_nsec = i % 1000000000;
}


x86 assembly (clang, -O0):
<backend_timespec_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
add    0x8(%rax),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
mov    -0x8(%rbp),%rax
mov    %rdx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<backend_timespec_add>:
add    (%rdi),%rsi
movabs $0x112e0be826d694b3,%rcx
0b 2e 11
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1a,%rdx
add    %rax,%rdx
add    %rdx,0x8(%rdi)
imul   $0x3b9aca00,%rdx,%rax
sub    %rax,%rsi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @backend_timespec_add(%struct.timespec* %0, i64 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
store i64 %1, i64* %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = add nsw i64 %8, %7
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = sdiv i64 %10, 1000000000
%12 = load %struct.timespec*, %struct.timespec** %3
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %12, i32 0, i32 1
%14 = load i64, i64* %13
%15 = add nsw i64 %14, %11
store i64 %15, i64* %13
%16 = load i64, i64* %4
%17 = srem i64 %16, 1000000000
%18 = load %struct.timespec*, %struct.timespec** %3
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %18, i32 0, i32 0
store i64 %17, i64* %19
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @backend_timespec_add(%struct.timespec* nocapture %0, i64 %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = add nsw i64 %4, %1
%6 = sdiv i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
store i64 %9, i64* %7
%10 = srem i64 %5, 1000000000
store i64 %10, i64* %3
ret void
}
int syslog_tm_ev(void *ctx, const struct tm *tm) { return (0); }


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

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

LLVM IR (-O0):
%struct.tm = type opaque
define i32 @syslog_tm_ev(i8* %0, %struct.tm* %1) {
%3 = alloca i8*
%4 = alloca %struct.tm*
store i8* %0, i8** %3
store %struct.tm* %1, %struct.tm** %4
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type opaque
define i32 @syslog_tm_ev(i8* nocapture readnone %0, %struct.tm* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_clkgr1(uint32_t val) { writel(val, (void *)0xb0000000 + (0x28)); }


x86 assembly (clang, -O0):
<write_clkgr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xb0000000,%esi
add    $0x28,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_clkgr1>:
mov    $0xb0000028,%esi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_clkgr1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @writel(i32 %3, i8* getelementptr (i8, i8* inttoptr (i64 2952790016 to i8*), i64 40))
ret void
}

LLVM IR (-O2):
define void @write_clkgr1(i32 %0) {
%2 = tail call i32 @writel(i32 %0, i8* inttoptr (i64 2952790056 to i8*))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ declare(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ retseq();
int /*<<< orphan*/ statement(int);
void function(void) {
  printf("\tpush\t%%ebp\n");
  printf("\tmov\t%%esp,%%ebp\n");
  declare(4);
  statement(1);
  retseq();
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <declare@plt>
mov    $0x1,%edi
call   1030 <statement@plt>
mov    $0x0,%al
call   1060 <retseq@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x4,%edi
call   1050 <declare@plt>
mov    $0x1,%edi
call   1030 <statement@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <retseq@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09push\09%%ebp\0A\00"
@.str.1 = [18 x i8] c"\09mov\09%%esp,%%ebp\0A\00"
define void @function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @declare(i32 4)
%4 = call i32 @statement(i32 1)
%5 = call i32 (...) @retseq()
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09push\09%%ebp\0A\00"
@.str.1 = [18 x i8] c"\09mov\09%%esp,%%ebp\0A\00"
define void @function() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @declare(i32 4)
%4 = tail call i32 @statement(i32 1)
%5 = tail call i32 (...) @retseq()
ret void
}
int ft_isalphalowercase(int c) {
  if (c >= 97 && c <= 122)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalphalowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <ft_isalphalowercase+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <ft_isalphalowercase+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isalphalowercase+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_isalphalowercase(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct UAE_CONFIG {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ calltrap(int, struct UAE_CONFIG *);
int GetUaeConfig(struct UAE_CONFIG *a) { calltrap(1, a); }


x86 assembly (clang, -O0):
<GetUaeConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calltrap@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUaeConfig>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <calltrap@plt>

LLVM IR (-O0):
%struct.UAE_CONFIG = type { i32 }
define i32 @GetUaeConfig(%struct.UAE_CONFIG* %0) {
%2 = alloca i32
%3 = alloca %struct.UAE_CONFIG*
store %struct.UAE_CONFIG* %0, %struct.UAE_CONFIG** %3
%4 = load %struct.UAE_CONFIG*, %struct.UAE_CONFIG** %3
%5 = call i32 @calltrap(i32 1, %struct.UAE_CONFIG* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
%struct.UAE_CONFIG = type { i32 }
define i32 @GetUaeConfig(%struct.UAE_CONFIG* %0) {
%2 = tail call i32 @calltrap(i32 1, %struct.UAE_CONFIG* %0)
ret i32 undef
}
/* Type definitions */
struct http2_setting {
  int dummy;
};
struct http2_connection {
  int dummy;
};

/* Variables and functions */
int http2_frame_settings_send(struct http2_connection *, struct http2_setting *,
                              int, int /*<<< orphan*/);
int http2_settings_send(struct http2_connection *conn,
                        struct http2_setting *set, int nsets) {
  return http2_frame_settings_send(conn, set, nsets, 0);
}


x86 assembly (clang, -O0):
<http2_settings_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <http2_frame_settings_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http2_settings_send>:
xor    %ecx,%ecx
jmp    1030 <http2_frame_settings_send@plt>

LLVM IR (-O0):
%struct.http2_connection = type { i32 }
%struct.http2_setting = type { i32 }
define i32 @http2_settings_send(%struct.http2_connection* %0, %struct.http2_setting* %1, i32 %2) {
%4 = alloca %struct.http2_connection*
%5 = alloca %struct.http2_setting*
%6 = alloca i32
store %struct.http2_connection* %0, %struct.http2_connection** %4
store %struct.http2_setting* %1, %struct.http2_setting** %5
store i32 %2, i32* %6
%7 = load %struct.http2_connection*, %struct.http2_connection** %4
%8 = load %struct.http2_setting*, %struct.http2_setting** %5
%9 = load i32, i32* %6
%10 = call i32 @http2_frame_settings_send(%struct.http2_connection* %7, %struct.http2_setting* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.http2_connection = type { i32 }
%struct.http2_setting = type { i32 }
define i32 @http2_settings_send(%struct.http2_connection* %0, %struct.http2_setting* %1, i32 %2) {
%4 = tail call i32 @http2_frame_settings_send(%struct.http2_connection* %0, %struct.http2_setting* %1, i32 %2, i32 0)
ret i32 %4
}
int test_imm_97int64_midword_reg(long long val) {
  return ((val >> 16) & (0x97 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_97int64_midword_reg>:
test   $0x970000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_97int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 151
%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_97int64_midword_reg(i64 %0) {
%2 = and i64 %0, 9895936
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct loc_code {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_indicator_list(struct loc_code *);
int /*<<< orphan*/ get_mv_indices(int, struct loc_code **);
int opal_indicator_probe_marvell(void) {
  struct loc_code *list = NULL;
  get_mv_indices(0x00, &list);
  if (list) {
    free_indicator_list(list);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<opal_indicator_probe_marvell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
xor    %edi,%edi
lea    -0x10(%rbp),%rsi
call   1030 <get_mv_indices@plt>
cmpq   $0x0,-0x10(%rbp)
je     115b <opal_indicator_probe_marvell+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <free_indicator_list@plt>
movl   $0x0,-0x4(%rbp)
jmp    1162 <opal_indicator_probe_marvell+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opal_indicator_probe_marvell>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
xor    %ebx,%ebx
lea    0x8(%rsp),%rsi
xor    %edi,%edi
call   1030 <get_mv_indices@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     114d <opal_indicator_probe_marvell+0x2d>
call   1040 <free_indicator_list@plt>
jmp    1152 <opal_indicator_probe_marvell+0x32>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.loc_code = type { i32 }
define i32 @opal_indicator_probe_marvell() {
%1 = alloca i32
%2 = alloca %struct.loc_code*
store %struct.loc_code* null, %struct.loc_code** %2
%3 = call i32 @get_mv_indices(i32 0, %struct.loc_code** %2)
%4 = load %struct.loc_code*, %struct.loc_code** %2
%5 = icmp ne %struct.loc_code* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load %struct.loc_code*, %struct.loc_code** %2
%8 = call i32 @free_indicator_list(%struct.loc_code* %7)
store i32 0, i32* %1
br label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.loc_code = type { i32 }
define i32 @opal_indicator_probe_marvell() {
%1 = alloca %struct.loc_code*
%2 = bitcast %struct.loc_code** %1 to i8*
store %struct.loc_code* null, %struct.loc_code** %1
%3 = call i32 @get_mv_indices(i32 0, %struct.loc_code** %1)
%4 = load %struct.loc_code*, %struct.loc_code** %1
%5 = icmp eq %struct.loc_code* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @free_indicator_list(%struct.loc_code* %4)
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ 0, %6 ], [ -1, %0 ]
ret i32 %9
}
/* Type definitions */
struct Sine {
  int dummy;
};

/* Variables and functions */
double M_PI;
int /*<<< orphan*/ Sine_set_f(struct Sine *, double, double);
void Sine_set_f3(struct Sine *this, double f, double fs, double phase) {
  Sine_set_f(this, f * M_PI / fs, phase);
}


x86 assembly (clang, -O0):
<Sine_set_f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    0x2ead(%rip),%rax
mulsd  (%rax),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <Sine_set_f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sine_set_f3>:
mov    0x2ed1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  %xmm1,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <Sine_set_f@plt>

LLVM IR (-O0):
%struct.Sine = type { i32 }
@M_PI = global double 0.000000e+00
define void @Sine_set_f3(%struct.Sine* %0, double %1, double %2, double %3) {
%5 = alloca %struct.Sine*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store %struct.Sine* %0, %struct.Sine** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load %struct.Sine*, %struct.Sine** %5
%10 = load double, double* %6
%11 = load double, double* @M_PI
%12 = fmul double %10, %11
%13 = load double, double* %7
%14 = fdiv double %12, %13
%15 = load double, double* %8
%16 = call i32 @Sine_set_f(%struct.Sine* %9, double %14, double %15)
ret void
}

LLVM IR (-O2):
%struct.Sine = type { i32 }
@M_PI = global double 0.000000e+00
define void @Sine_set_f3(%struct.Sine* %0, double %1, double %2, double %3) {
%5 = load double, double* @M_PI
%6 = fmul double %5, %1
%7 = fdiv double %6, %2
%8 = tail call i32 @Sine_set_f(%struct.Sine* %0, double %7, double %3)
ret void
}
int substring_member_of_array(string, array)
char *string;
const char **array;
{
  while (*array) {
    if (_rl_strindex(string, *array))
      return (1);
    array++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<substring_member_of_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1166 <substring_member_of_array+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    $0x0,%al
call   1030 <_rl_strindex@plt>
cmp    $0x0,%eax
je     1155 <substring_member_of_array+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116d <substring_member_of_array+0x5d>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <substring_member_of_array+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring_member_of_array>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
test   %rsi,%rsi
je     114a <substring_member_of_array+0x3a>
mov    %rdi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <_rl_strindex@plt>
test   %eax,%eax
jne    114e <substring_member_of_array+0x3e>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <substring_member_of_array+0x20>
xor    %eax,%eax
jmp    1153 <substring_member_of_array+0x43>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @substring_member_of_array(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %17, %2
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @_rl_strindex to i32 (i8*, i8*, ...)*)(i8* %11, i8* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %3
br label %21
17: ; preds = %10
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %5
br label %6
20: ; preds = %6
store i32 0, i32* %3
br label %21
21: ; preds = %20, %16
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @substring_member_of_array(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %8
5: ; preds = %8
%6 = load i8*, i8** %13
%7 = icmp eq i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %2, %5
%9 = phi i8* [ %6, %5 ], [ %3, %2 ]
%10 = phi i8** [ %13, %5 ], [ %1, %2 ]
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @_rl_strindex to i32 (i8*, i8*, ...)*)(i8* %0, i8* %9)
%12 = icmp eq i32 %11, 0
%13 = getelementptr inbounds i8*, i8** %10, i64 1
br i1 %12, label %5, label %14
14: ; preds = %8, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %15
}