xunge/DecIR huggingface dataset:
/* Variables and functions */
int printf(char *);
int main() {
  if (printf("Hello ") == 9) {
    printf("Hello ");
  } else {
    printf("World\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x9,%eax
jne    1145 <main+0x35>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x41>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
cmp    $0x9,%eax
jne    1140 <main+0x20>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
jmp    114c <main+0x2c>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello \00"
@str = [6 x i8] c"World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 9
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pq_update_at(int, int, int *, int);
void pq_remove_at(int at, int *items, int *_size) {
  int size = *_size;
  if (at < size - 1) {
    int item = items[size - 1];
    pq_update_at(at, item, items, size - 1);
  }
  *_size = size - 1;
}


x86 assembly (clang, -O0):
<pq_remove_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1165 <pq_remove_at+0x55>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
call   1030 <pq_update_at@plt>
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pq_remove_at>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
movslq (%rdx),%rax
lea    -0x1(%rax),%ebp
cmp    %edi,%ebp
jle    112e <pq_remove_at+0x1e>
mov    %rsi,%rdx
mov    -0x4(%rsi,%rax,4),%esi
mov    %ebp,%ecx
call   1030 <pq_update_at@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @pq_remove_at(i32 %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
%6 = icmp sgt i32 %5, %0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @pq_update_at(i32 %0, i32 %10, i32* %1, i32 %5)
br label %12
12: ; preds = %7, %3
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
double exp(double);
scalar_t__ isnan(double);
double logExp(double x) {
  if (isnan(x))
    return 0;
  return exp(x);
}


x86 assembly (clang, -O0):
<logExp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     114e <logExp+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115d <logExp+0x3d>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logExp>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <isnan@plt>
test   %rax,%rax
je     1135 <logExp+0x15>
xorps  %xmm0,%xmm0
pop    %rax
ret
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @logExp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i64 @isnan(double %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = call double @exp(double %9)
store double %10, double* %2
br label %11
11: ; preds = %8, %7
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @logExp(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call double @exp(double %0)
br label %6
6: ; preds = %1, %4
%7 = phi double [ %5, %4 ], [ 0.000000e+00, %1 ]
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned char);
void mov_preg32pimm32_imm8(int reg32, unsigned long imm32, unsigned char imm8) {
  put8(0xC6);
  put8(0x80 + reg32);
  put32(imm32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<mov_preg32pimm32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    $0xc6,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%eax
movzbl %al,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
movzbl -0x11(%rbp),%edi
call   1030 <put8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg32pimm32_imm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xc6,%edi
call   1030 <put8@plt>
xor    $0x80,%bpl
movzbl %bpl,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
call   1040 <put32@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_preg32pimm32_imm8(i32 %0, i64 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = call i32 @put8(i8 zeroext -58)
%8 = load i32, i32* %4
%9 = add nsw i32 128, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @put8(i8 zeroext %10)
%12 = load i64, i64* %5
%13 = call i32 @put32(i64 %12)
%14 = load i8, i8* %6
%15 = call i32 @put8(i8 zeroext %14)
ret void
}

LLVM IR (-O2):
define void @mov_preg32pimm32_imm8(i32 %0, i64 %1, i8 zeroext %2) {
%4 = tail call i32 @put8(i8 zeroext -58)
%5 = trunc i32 %0 to i8
%6 = xor i8 %5, -128
%7 = tail call i32 @put8(i8 zeroext %6)
%8 = tail call i32 @put32(i64 %1)
%9 = tail call i32 @put8(i8 zeroext %2)
ret void
}
int strcmp_1(char *s, char *t) {
  int i = 0;
  for (; *s == *t; s++, t++) {
    if (*s = '\0') {
      return 0;
    };
  };
  return (*s - *t);
}


x86 assembly (clang, -O0):
<strcmp_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    116d <strcmp_1+0x6d>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
test   $0x1,%al
jne    113f <strcmp_1+0x3f>
jmp    114b <strcmp_1+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1180 <strcmp_1+0x80>
jmp    1150 <strcmp_1+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <strcmp_1+0x13>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_1>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1125 <strcmp_1+0x25>
mov    $0x1,%edx
nopl   (%rax)
movb   $0x0,-0x1(%rdi,%rdx,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp_1+0x10>
movsbl %cl,%ecx
movsbl %al,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp_1(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %0, %2 ]
%8 = phi i8* [ %10, %6 ], [ %1, %2 ]
store i8 0, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %9
%12 = load i8, i8* %10
%13 = icmp eq i8 %11, %12
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = phi i8 [ %3, %2 ], [ %11, %6 ]
%16 = phi i8 [ %4, %2 ], [ %12, %6 ]
%17 = sext i8 %16 to i32
%18 = sext i8 %15 to i32
%19 = sub nsw i32 %18, %17
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int i32sign(int);
int main() {
  assert(i32sign(42) == 1);
  assert(i32sign(0) == 0);
  assert(i32sign(-42) == -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <i32sign@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1030 <i32sign@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xffffffd6,%edi
call   1030 <i32sign@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <i32sign@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
call   1030 <i32sign@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0xffffffd6,%edi
call   1030 <i32sign@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @i32sign(i32 42)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @i32sign(i32 0)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @i32sign(i32 -42)
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @i32sign(i32 42)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @i32sign(i32 0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @i32sign(i32 -42)
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret i32 0
}
unsigned int buffer_match(void *in1, void *in2, unsigned int count) {
  unsigned char *ip1 = in1;
  unsigned char *ip2 = in2;
  while (count--) {
    if (*ip1++ != *ip2++)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<buffer_match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
je     1170 <buffer_match+0x70>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
movzbl (%rax),%eax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     116b <buffer_match+0x6b>
movl   $0x0,-0x4(%rbp)
jmp    1177 <buffer_match+0x77>
jmp    111f <buffer_match+0x1f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_match>:
mov    %edx,%r8d
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %ecx,%r8d
je     1128 <buffer_match+0x28>
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%rax
cmp    (%rsi,%rcx,1),%dl
mov    %rax,%rcx
je     1110 <buffer_match+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @buffer_match(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i32 [ %2, %3 ], [ %10, %9 ]
%6 = phi i8* [ %0, %3 ], [ %11, %9 ]
%7 = phi i8* [ %1, %3 ], [ %13, %9 ]
%8 = icmp eq i32 %5, 0
br i1 %8, label %16, label %9
9: ; preds = %4
%10 = add i32 %5, -1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %6
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %7
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %9
%17 = phi i32 [ 0, %9 ], [ 1, %4 ]
ret i32 %17
}
void __outl_p(unsigned int value, unsigned short port) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
  __asm__ __volatile__("outb %al,$0x80");
}


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

x86 assembly (clang, -O2):
<__outl_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @__outl_p(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct typeinfo {
  int dummy;
};

/* Variables and functions */
scalar_t__ ggc_test_and_set_mark(struct typeinfo *const);
void gt_ggc_mx_typeinfo(void *x_p) {
  struct typeinfo *const x = (struct typeinfo *)x_p;
  if (ggc_test_and_set_mark(x)) {
  }
}


x86 assembly (clang, -O0):
<gt_ggc_mx_typeinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ggc_test_and_set_mark@plt>
cmp    $0x0,%rax
je     113c <gt_ggc_mx_typeinfo+0x2c>
jmp    113c <gt_ggc_mx_typeinfo+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_ggc_mx_typeinfo>:
jmp    1030 <ggc_test_and_set_mark@plt>

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

LLVM IR (-O2):
%struct.typeinfo = type { i32 }
define void @gt_ggc_mx_typeinfo(i8* %0) {
%2 = bitcast i8* %0 to %struct.typeinfo*
%3 = tail call i64 @ggc_test_and_set_mark(%struct.typeinfo* %2)
ret void
}
int do_615() { return 615; }


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

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

LLVM IR (-O0):
define i32 @do_615() {
ret i32 615
}

LLVM IR (-O2):
define i32 @do_615() {
ret i32 615
}
__attribute__((__noreturn__)) void foo(void) {
  while (1)
    ;
}


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

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

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

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

/* Variables and functions */
__attribute__((const)) uint8_t av_clip_uint8(int a) {
  if (a & (~255))
    return (-a) >> 31;
  else
    return a;
}


x86 assembly (clang, -O0):
<av_clip_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
cmp    $0x0,%eax
je     1128 <av_clip_uint8+0x28>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <av_clip_uint8+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clip_uint8>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
neg    %eax
cmp    $0x100,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @av_clip_uint8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -256
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 0, %8
%10 = ashr i32 %9, 31
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @av_clip_uint8(i32 %0) {
%2 = icmp ult i32 %0, 256
%3 = icmp sgt i32 %0, 0
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
char tolower(char);
void strlwr(char *Str) {
  char *ptr;
  if (Str) {
    for (ptr = Str; *ptr != '\0'; ptr++)
      *ptr = tolower(*ptr);
  }
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <strlwr+0x59>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <strlwr+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <strlwr+0x1f>
jmp    1169 <strlwr+0x59>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %rbx
test   %rdi,%rdi
je     1146 <strlwr+0x36>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strlwr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
_Bool signed_int_to_bool(signed int src) { return src; }


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

x86 assembly (clang, -O2):
<signed_int_to_bool>:
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define zeroext i1 @signed_int_to_bool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @signed_int_to_bool(i32 %0) {
%2 = icmp ne i32 %0, 0
ret i1 %2
}
void RTDbgAsModuleQueryMapByIndex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsModuleQueryMapByIndex() {
ret void
}
void ft_strclr(char *s) {
  if (s) {
    while (*s != 0x00)
      *s++ = 0x00;
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <ft_strclr+0x44>
jmp    1118 <ft_strclr+0x18>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113f <ft_strclr+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    1118 <ft_strclr+0x18>
jmp    1144 <ft_strclr+0x44>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int /*<<< orphan*/ *);
int /*<<< orphan*/ err_sys(char *);
int Accept(int sockfd, struct sockaddr *addr, socklen_t *len) {
  int n;
  if ((n = accept(sockfd, addr, len)) < 0)
    err_sys("accept error");
  return n;
}


x86 assembly (clang, -O0):
<Accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115b <Accept+0x3b>
lea    0xeaa(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Accept>:
push   %rbx
call   1040 <accept@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Accept+0x18>
lea    0xecd(%rip),%rdi
call   1030 <err_sys@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [13 x i8] c"accept error\00"
define i32 @Accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32*, i32** %6
%11 = call i32 @accept(i32 %8, %struct.sockaddr* %9, i32* %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [13 x i8] c"accept error\00"
define i32 @Accept(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int rand();
int wrapc_getrand(int n) { return rand() % n; }


x86 assembly (clang, -O0):
<wrapc_getrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapc_getrand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wrapc_getrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @wrapc_getrand(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
int none_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @none_init() {
ret i32 0
}
int op_ldll(void) { return (4); }


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

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

LLVM IR (-O0):
define i32 @op_ldll() {
ret i32 4
}

LLVM IR (-O2):
define i32 @op_ldll() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_INT3_PIN() { clear_io_bit(0x43, 3); }


x86 assembly (clang, -O0):
<TOSH_CLR_INT3_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x3,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_INT3_PIN>:
mov    $0x43,%edi
mov    $0x3,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_INT3_PIN() {
%1 = call i32 @clear_io_bit(i32 67, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_INT3_PIN() {
%1 = tail call i32 @clear_io_bit(i32 67, i32 3)
ret void
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/);
long shim_sgetmask(void) { return (long)shim_enosys(0); }


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

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

LLVM IR (-O0):
define i64 @shim_sgetmask() {
%1 = call i64 @shim_enosys(i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @shim_sgetmask() {
%1 = tail call i64 @shim_enosys(i32 0)
ret i64 %1
}
/* Variables and functions */
char *timlib_sql_injection_escape(char *);
char *timlib_escape_sql_injection(char *source) {
  return timlib_sql_injection_escape(source);
}


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

x86 assembly (clang, -O2):
<timlib_escape_sql_injection>:
jmp    1030 <timlib_sql_injection_escape@plt>

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

LLVM IR (-O2):
define i8* @timlib_escape_sql_injection(i8* %0) {
%2 = tail call i8* @timlib_sql_injection_escape(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ *wcpncpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
wchar_t *overlappingWriteFunction_wcpncpy(wchar_t *src, wchar_t *dest,
                                          ssize_t n) {
  (void)wcpncpy(dest, src, n);
  return wcpncpy(src, src + 3, 4);
}


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

x86 assembly (clang, -O2):
<overlappingWriteFunction_wcpncpy>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <wcpncpy@plt>
lea    0xc(%rbx),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
pop    %rbx
jmp    1030 <wcpncpy@plt>

LLVM IR (-O0):
define i32* @overlappingWriteFunction_wcpncpy(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
%7 = load i32*, i32** %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = call i32* @wcpncpy(i32* %7, i32* %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = call i32* @wcpncpy(i32* %11, i32* %13, i32 4)
ret i32* %14
}

LLVM IR (-O2):
define i32* @overlappingWriteFunction_wcpncpy(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32* @wcpncpy(i32* %1, i32* %0, i32 %2)
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = tail call i32* @wcpncpy(i32* %0, i32* %5, i32 4)
ret i32* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_wday;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(void *);
int date_get_dayofweek(void) {
  time_t t = time((void *)0);
  struct tm *lt = localtime(&t);
  return lt->tm_wday;
}


x86 assembly (clang, -O0):
<date_get_dayofweek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_dayofweek>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_dayofweek() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i8* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_dayofweek() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i8* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t reduce(uint32_t hash, uint32_t n) {
  return (uint32_t)(((uint64_t)hash * n) >> 32);
}


x86 assembly (clang, -O0):
<reduce>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reduce(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 = mul nsw i32 %5, %6
%8 = ashr i32 %7, 32
ret i32 %8
}

LLVM IR (-O2):
define i32 @reduce(i32 %0, i32 %1) {
ret i32 poison
}
int test00(int a, int b) { return a / b; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @test00(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test00(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec bench_start() {
  struct timespec start_t;
  clock_gettime(CLOCK_REALTIME, &start_t);
  return start_t;
}


x86 assembly (clang, -O0):
<bench_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench_start>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @bench_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @bench_start() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Msp430ClockP__Msp430ClockInit__defaultInitClocks();
void Msp430ClockP__Msp430ClockInit__default__initClocks(void) {
  Msp430ClockP__Msp430ClockInit__defaultInitClocks();
}


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

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

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

LLVM IR (-O2):
define void @Msp430ClockP__Msp430ClockInit__default__initClocks() {
%1 = tail call i32 (...) @Msp430ClockP__Msp430ClockInit__defaultInitClocks()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void WriteBE32(unsigned char *ptr, uint32_t x) {
  ptr[0] = x >> 24;
  ptr[1] = x >> 16;
  ptr[2] = x >> 8;
  ptr[3] = x;
}


x86 assembly (clang, -O0):
<WriteBE32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @WriteBE32(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
struct ber_element {
  int dummy;
};

/* Variables and functions */
struct ber_element *ber_get_element(int);
int /*<<< orphan*/ ber_link_elements(struct ber_element *,
                                     struct ber_element *);
struct ber_element *ber_add_sequence(struct ber_element *prev) {
  struct ber_element *elm;
  if ((elm = ber_get_element(16)) == NULL)
    return NULL;
  ber_link_elements(prev, elm);
  return elm;
}


x86 assembly (clang, -O0):
<ber_add_sequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x10,%edi
call   1030 <ber_get_element@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1151 <ber_add_sequence+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1166 <ber_add_sequence+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ber_link_elements@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ber_add_sequence>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x10,%edi
call   1030 <ber_get_element@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1144 <ber_add_sequence+0x24>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <ber_link_elements@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ber_element = type { i32 }
define %struct.ber_element* @ber_add_sequence(%struct.ber_element* %0) {
%2 = alloca %struct.ber_element*
%3 = alloca %struct.ber_element*
%4 = alloca %struct.ber_element*
store %struct.ber_element* %0, %struct.ber_element** %3
%5 = call %struct.ber_element* @ber_get_element(i32 16)
store %struct.ber_element* %5, %struct.ber_element** %4
%6 = icmp eq %struct.ber_element* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store %struct.ber_element* null, %struct.ber_element** %2
br label %13
8: ; preds = %1
%9 = load %struct.ber_element*, %struct.ber_element** %3
%10 = load %struct.ber_element*, %struct.ber_element** %4
%11 = call i32 @ber_link_elements(%struct.ber_element* %9, %struct.ber_element* %10)
%12 = load %struct.ber_element*, %struct.ber_element** %4
store %struct.ber_element* %12, %struct.ber_element** %2
br label %13
13: ; preds = %8, %7
%14 = load %struct.ber_element*, %struct.ber_element** %2
ret %struct.ber_element* %14
}

LLVM IR (-O2):
%struct.ber_element = type { i32 }
define %struct.ber_element* @ber_add_sequence(%struct.ber_element* %0) {
%2 = tail call %struct.ber_element* @ber_get_element(i32 16)
%3 = icmp eq %struct.ber_element* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @ber_link_elements(%struct.ber_element* %0, %struct.ber_element* %2)
br label %6
6: ; preds = %1, %4
ret %struct.ber_element* %2
}
/* Type definitions */
struct content {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ initFiles(struct content *);
int /*<<< orphan*/ openFile(char *, struct content *);
int /*<<< orphan*/ processing(struct content *);
void processFile(char *fileName, struct content *con) {
  initFiles(con);
  openFile(fileName, con);
  processing(con);
}


x86 assembly (clang, -O0):
<processFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <initFiles@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <openFile@plt>
mov    -0x10(%rbp),%rdi
call   1050 <processing@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processFile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <initFiles@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <openFile@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <processing@plt>

LLVM IR (-O0):
%struct.content = type { i32 }
define void @processFile(i8* %0, %struct.content* %1) {
%3 = alloca i8*
%4 = alloca %struct.content*
store i8* %0, i8** %3
store %struct.content* %1, %struct.content** %4
%5 = load %struct.content*, %struct.content** %4
%6 = call i32 @initFiles(%struct.content* %5)
%7 = load i8*, i8** %3
%8 = load %struct.content*, %struct.content** %4
%9 = call i32 @openFile(i8* %7, %struct.content* %8)
%10 = load %struct.content*, %struct.content** %4
%11 = call i32 @processing(%struct.content* %10)
ret void
}

LLVM IR (-O2):
%struct.content = type { i32 }
define void @processFile(i8* %0, %struct.content* %1) {
%3 = tail call i32 @initFiles(%struct.content* %1)
%4 = tail call i32 @openFile(i8* %0, %struct.content* %1)
%5 = tail call i32 @processing(%struct.content* %1)
ret void
}
const char *trimpath(const char *path) {
  if (*path == '.' && *(path + 1) == '/')
    path += 2;
  return path;
}


x86 assembly (clang, -O0):
<trimpath>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1135 <trimpath+0x35>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    1135 <trimpath+0x35>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimpath>:
mov    %rdi,%rax
cmpb   $0x2e,(%rdi)
jne    1115 <trimpath+0x15>
xor    %ecx,%ecx
cmpb   $0x2f,0x1(%rax)
sete   %cl
lea    (%rax,%rcx,2),%rax
ret

LLVM IR (-O0):
define i8* @trimpath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 46
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 47
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
store i8* %15, i8** %2
br label %16
16: ; preds = %13, %7, %1
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @trimpath(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
%8 = select i1 %7, i64 2, i64 0
%9 = getelementptr i8, i8* %0, i64 %8
br label %10
10: ; preds = %4, %1
%11 = phi i8* [ %0, %1 ], [ %9, %4 ]
ret i8* %11
}
/* Type definitions */
struct list_i {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list_i *);
int /*<<< orphan*/ list_i_clear(struct list_i *);
void list_i_free(struct list_i *target) {
  list_i_clear(target);
  free(target);
}


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

x86 assembly (clang, -O2):
<list_i_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_i_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.list_i = type { i32 }
define void @list_i_free(%struct.list_i* %0) {
%2 = alloca %struct.list_i*
store %struct.list_i* %0, %struct.list_i** %2
%3 = load %struct.list_i*, %struct.list_i** %2
%4 = call i32 @list_i_clear(%struct.list_i* %3)
%5 = load %struct.list_i*, %struct.list_i** %2
%6 = call i32 @free(%struct.list_i* %5)
ret void
}

LLVM IR (-O2):
%struct.list_i = type { i32 }
define void @list_i_free(%struct.list_i* %0) {
%2 = tail call i32 @list_i_clear(%struct.list_i* %0)
%3 = tail call i32 @free(%struct.list_i* %0)
ret void
}