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

/* Variables and functions */
int /*<<< orphan*/ nvpair_insert_string(struct nvpair *, char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
void nvpair_insert_float(struct nvpair *n, const char *name, double fvalue) {
  char value[256];
  sprintf(value, "%lf", fvalue);
  nvpair_insert_string(n, name, (char *)value);
}


x86 assembly (clang, -O0):
<nvpair_insert_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x120(%rbp),%rdx
call   1030 <nvpair_insert_string@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvpair_insert_float>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <nvpair_insert_string@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.nvpair = type { i32 }
@.str = [4 x i8] c"%lf\00"
define void @nvpair_insert_float(%struct.nvpair* %0, i8* %1, double %2) {
%4 = alloca %struct.nvpair*
%5 = alloca i8*
%6 = alloca double
%7 = alloca [256 x i8]
store %struct.nvpair* %0, %struct.nvpair** %4
store i8* %1, i8** %5
store double %2, double* %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = load double, double* %6
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = load %struct.nvpair*, %struct.nvpair** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%14 = call i32 @nvpair_insert_string(%struct.nvpair* %11, i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.nvpair = type { i32 }
@.str = [4 x i8] c"%lf\00"
define void @nvpair_insert_float(%struct.nvpair* %0, i8* %1, double %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%7 = call i32 @nvpair_insert_string(%struct.nvpair* %0, i8* %1, i8* %5)
ret void
}
int dumfftwdrv() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dumfftwdrv() {
ret i32 0
}
int main(argc, argv)
int argc;
char *argv[];
{
  printf("Hello %s!", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int getColor(int colors[], int number) {
  switch (number) {
  case 0:
    return 153;
  case 1:
    return colors[0];
  case 2:
    return colors[1];
  default:
    return colors[2];
  }
}


x86 assembly (clang, -O0):
<getColor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     1140 <getColor+0x40>
jmp    111e <getColor+0x1e>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     114c <getColor+0x4c>
jmp    112f <getColor+0x2f>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     115a <getColor+0x5a>
jmp    1169 <getColor+0x69>
movl   $0x99,-0x4(%rbp)
jmp    1173 <getColor+0x73>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <getColor+0x73>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <getColor+0x73>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getColor>:
test   %esi,%esi
je     1115 <getColor+0x15>
cmp    $0x1,%esi
je     111f <getColor+0x1f>
cmp    $0x2,%esi
jne    111b <getColor+0x1b>
add    $0x4,%rdi
mov    (%rdi),%eax
ret
mov    $0x99,%eax
ret
add    $0x8,%rdi
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getColor(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* %5
switch i32 %6, label %16 [
i32 0, label %7
i32 1, label %8
i32 2, label %12
]
7: ; preds = %2
store i32 153, i32* %3
br label %20
8: ; preds = %2
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
store i32 %11, i32* %3
br label %20
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
store i32 %15, i32* %3
br label %20
16: ; preds = %2
%17 = load i32*, i32** %4
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = load i32, i32* %18
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %12, %8, %7
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @getColor(i32* nocapture %0, i32 %1) {
switch i32 %1, label %5 [
i32 0, label %10
i32 1, label %7
i32 2, label %3
]
3: ; preds = %2
%4 = getelementptr inbounds i32, i32* %0, i64 1
br label %7
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %0, i64 2
br label %7
7: ; preds = %2, %3, %5
%8 = phi i32* [ %6, %5 ], [ %4, %3 ], [ %0, %2 ]
%9 = load i32, i32* %8
br label %10
10: ; preds = %7, %2
%11 = phi i32 [ 153, %2 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
unsigned long long makedev(unsigned int, unsigned int);
unsigned long long os_makedev(unsigned major, unsigned minor) {
  return makedev(major, minor);
}


x86 assembly (clang, -O0):
<os_makedev>:
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   1030 <makedev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_makedev>:
jmp    1030 <makedev@plt>

LLVM IR (-O0):
define i64 @os_makedev(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 i64 @makedev(i32 %5, i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @os_makedev(i32 %0, i32 %1) {
%3 = tail call i64 @makedev(i32 %0, i32 %1)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ const int8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int8_t absolute_value(const int16_t x) {
  if (x >= 0) {
    return x;
  } else {
    return -x;
  }
}


x86 assembly (clang, -O0):
<absolute_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <absolute_value+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <absolute_value+0x24>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute_value>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absolute_value(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int foo(int p1, short p2) { return p1 / p2; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
cltd
idiv   %ecx
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0, i16 signext %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
%7 = sext i16 %6 to i32
%8 = sdiv i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i16 signext %1) {
%3 = sext i16 %1 to i32
%4 = sdiv i32 %0, %3
ret i32 %4
}
int find_largest_prime_factor(int n) {
  int i = 2;
  while (n > 1) {
    if (n % i == 0)
      n /= i;
    else
      i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<find_largest_prime_factor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1147 <find_largest_prime_factor+0x47>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1139 <find_largest_prime_factor+0x39>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1142 <find_largest_prime_factor+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <find_largest_prime_factor+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_largest_prime_factor>:
mov    $0x2,%eax
cmp    $0x2,%edi
jl     1127 <find_largest_prime_factor+0x27>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
cmove  %eax,%edi
lea    0x1(%rcx),%eax
cmove  %ecx,%eax
mov    %eax,%ecx
cmp    $0x1,%edi
jg     1110 <find_largest_prime_factor+0x10>
ret

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

LLVM IR (-O2):
define i32 @find_largest_prime_factor(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 2, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = srem i32 %5, %4
%7 = sdiv i32 %5, %4
%8 = icmp eq i32 %6, 0
%9 = add nsw i32 %4, 1
%10 = select i1 %8, i32 %7, i32 %5
%11 = select i1 %8, i32 %4, i32 %9
%12 = icmp sgt i32 %10, 1
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i32 [ 2, %1 ], [ %11, %3 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int ioctl(int, int, void *);
int xioctl(int fd, int request, void *arg) {
  int r;
  do {
    r = ioctl(fd, request, arg);
  } while ((r == -1) && (errno == EINTR));
  return r;
}


x86 assembly (clang, -O0):
<xioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jne    115d <xioctl+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1122 <xioctl+0x12>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xioctl>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%r15
mov    0x2eab(%rip),%r12
nopl   (%rax)
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    114a <xioctl+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <xioctl+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @xioctl(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @ioctl(i32 %9, i32 %10, i8* %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @xioctl(i32 %0, i32 %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @ioctl(i32 %0, i32 %1, i8* %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ quicksorth(int *, int /*<<< orphan*/, int);
int quicksort(int lista[], int t) {
  int l = t;
  quicksorth(lista, 0, l);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
xor    %esi,%esi
call   1030 <quicksorth@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <quicksorth@plt>

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

LLVM IR (-O2):
define i32 @quicksort(i32* %0, i32 %1) {
%3 = tail call i32 @quicksorth(i32* %0, i32 0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void IRGEN_Handler() { default_isr(); }


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

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

LLVM IR (-O0):
define weak void @IRGEN_Handler() {
%1 = call i32 (...) @default_isr()
ret void
}

LLVM IR (-O2):
define weak void @IRGEN_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bwipp_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<bwipp_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @bwipp_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void ff_hevc_put_hevc_epel_v16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_v16_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ipv4head(int osvers, int osrel, int ossub) {
  printf("inrecv/s outreq/s indeliver/s forward/s "
         "reasmok/s fragcreat/s  _ipv4_");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"inrecv/s outreq/s indeliver/s forward/s reasmok/s fragcreat/s _ipv4_\00"
define void @ipv4head(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 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"inrecv/s outreq/s indeliver/s forward/s reasmok/s fragcreat/s _ipv4_\00"
define void @ipv4head(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
void bar_int(int *x) { *x = __real foo_int(5); }


x86 assembly (clang, -O0):
<bar_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <foo_int@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_int>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <foo_int@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @bar_int(i32* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo_int to i32 (i32, ...)*)(i32 5)
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int execl(const char *path, const char *arg, ...) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "execl");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<execl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execl>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"execl\00"
define i32 @execl(i8* %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"execl\00"
define i32 @execl(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @assert(i32 0)
ret i32 undef
}
void *test(int *i) {
  short a = 1;
  i += a;
  i + a;
  a + i;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movw   $0x1,-0x12(%rbp)
movswl -0x12(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @test(i32* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dummy_mysql() { printf("\n"); }


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

x86 assembly (clang, -O2):
<dummy_mysql>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @dummy_mysql() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
double imax2(double i1, double i2) { return (i1 > i2) ? i1 : i2; }


x86 assembly (clang, -O0):
<imax2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <imax2+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <imax2+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax2>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @imax2(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_usage(char *program) {
  fprintf(stderr,
          "usage: %s starting_dir [-name filename-or-pattern] [-type "
          "{f|d|b|c|p|l|s}]\n",
          program);
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"usage: %s starting_dir [-name filename-or-pattern] [-type {f|d|b|c|p|l|s}]\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"usage: %s starting_dir [-name filename-or-pattern] [-type {f|d|b|c|p|l|s}]\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_30int16_reg(short val) {
  return ((val) & (-0x30 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_30int16_reg(i16 signext %0) {
%2 = and i16 %0, -48
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prog) {
  printf("** Test program for the parser\n"
         "** Usage: %s <pcap_in> <pcap_anonymized>\n",
         prog);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"** Test program for the parser\0A** Usage: %s <pcap_in> <pcap_anonymized>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [73 x i8] c"** Test program for the parser\0A** Usage: %s <pcap_in> <pcap_anonymized>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
unsigned long _marshall_get32(const void *pBuf) {
  unsigned long i;
  ((char *)(&i))[0] = ((char *)(pBuf))[3],
         ((char *)(&i))[1] = ((char *)(pBuf))[2],
         ((char *)(&i))[2] = ((char *)(pBuf))[1],
         ((char *)(&i))[3] = ((char *)(pBuf))[0];
  return i;
}


x86 assembly (clang, -O0):
<_marshall_get32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xf(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_marshall_get32>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @_marshall_get32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = load i8, i8* %0
%9 = zext i8 %8 to i64
%10 = shl nuw nsw i64 %9, 24
%11 = zext i8 %7 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = zext i8 %5 to i64
%14 = shl nuw nsw i64 %13, 8
%15 = zext i8 %3 to i64
%16 = or i64 %14, %15
%17 = or i64 %16, %12
%18 = or i64 %17, %10
ret i64 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __pmp_inline_atomic_xchg32(int /*<<< orphan*/ volatile *,
                                              int /*<<< orphan*/);
int32_t __pmp_atomic_xchg32(volatile int32_t *p, int32_t new_value) {
  return __pmp_inline_atomic_xchg32(p, new_value);
}


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

x86 assembly (clang, -O2):
<__pmp_atomic_xchg32>:
jmp    1030 <__pmp_inline_atomic_xchg32@plt>

LLVM IR (-O0):
define i32 @__pmp_atomic_xchg32(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 @__pmp_inline_atomic_xchg32(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__pmp_atomic_xchg32(i32* %0, i32 %1) {
%3 = tail call i32 @__pmp_inline_atomic_xchg32(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int russianPeasant(int, int);
int main() {
  printf("%u\n", russianPeasant(18, 1));
  printf("%u\n", russianPeasant(20, 12));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x12,%edi
mov    $0x1,%esi
call   1040 <russianPeasant@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x14,%edi
mov    $0xc,%esi
call   1040 <russianPeasant@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x12,%edi
mov    $0x1,%esi
call   1040 <russianPeasant@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x14,%edi
mov    $0xc,%esi
call   1040 <russianPeasant@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @russianPeasant(i32 18, i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @russianPeasant(i32 20, i32 12)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @russianPeasant(i32 18, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @russianPeasant(i32 20, i32 12)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int strlen(char *str) {
  int i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerCapComP__0__Compare__default__fired();
void Msp430TimerCapComP__0__Compare__fired(void) {
  Msp430TimerCapComP__0__Compare__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__0__Compare__fired() {
%1 = tail call i32 (...) @Msp430TimerCapComP__0__Compare__default__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
int /*<<< orphan*/ Send_Byte(unsigned char);
void WRSR(unsigned char byte) {
  CE_Low();
  Send_Byte(0x01);
  Send_Byte(byte);
  CE_High();
}


x86 assembly (clang, -O0):
<WRSR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1050 <CE_Low@plt>
mov    $0x1,%edi
call   1030 <Send_Byte@plt>
movzbl -0x1(%rbp),%edi
call   1030 <Send_Byte@plt>
mov    $0x0,%al
call   1040 <CE_High@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WRSR>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <CE_Low@plt>
mov    $0x1,%edi
call   1030 <Send_Byte@plt>
mov    %ebx,%edi
call   1030 <Send_Byte@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <CE_High@plt>

LLVM IR (-O0):
define void @WRSR(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @CE_Low()
%4 = call i32 @Send_Byte(i8 zeroext 1)
%5 = load i8, i8* %2
%6 = call i32 @Send_Byte(i8 zeroext %5)
%7 = call i32 (...) @CE_High()
ret void
}

LLVM IR (-O2):
define void @WRSR(i8 zeroext %0) {
%2 = tail call i32 (...) @CE_Low()
%3 = tail call i32 @Send_Byte(i8 zeroext 1)
%4 = tail call i32 @Send_Byte(i8 zeroext %0)
%5 = tail call i32 (...) @CE_High()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strchr(char *, char);
int main(int argc, char **argv) {
  char *tmp;
  char *tmps;
  tmp = strchr(argv[1], '(');
  tmps = tmp;
  printf("%s\n", tmps);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x28,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x28,%esi
call   1030 <strchr@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i8* @strchr(i8* %10, i8 signext 40)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @strchr(i8* dereferenceable(1) %4, i8 signext 40)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void latex_output_document_footer(FILE *output_stream) {
  fprintf(output_stream, "\\end{document}\n");
}


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

x86 assembly (clang, -O2):
<latex_output_document_footer>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"\\end{document}\0A\00"
define void @latex_output_document_footer(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 15, i64 1, i32* %0)
ret void
}
void term_winsize(void) {}


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

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

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

LLVM IR (-O2):
define void @term_winsize() {
ret void
}
/* Variables and functions */
int length_l(void **list) {
  if (list == NULL)
    return 0;
  int i = -1;
  while (list[++i] != NULL)
    ;
  return i;
}


x86 assembly (clang, -O0):
<length_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <length_l+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    114c <length_l+0x4c>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1146 <length_l+0x46>
jmp    1126 <length_l+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length_l>:
test   %rdi,%rdi
je     111e <length_l+0x1e>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <length_l+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @length_l(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ -1, %1 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ insertseg(int, int, int, int);
void initialsegs(void) {
  insertseg(0, 0x00000000, 0x00000000, 0x00000000);
  insertseg(1, 0x00000000, 0xffffffff,
            (0x0400 | 0x0200 | 0x0080 | 0x0000 | 0x0010 | 0x000a));
  insertseg(2, 0x00000000, 0xffffffff,
            (0x0400 | 0x0200 | 0x0080 | 0x0000 | 0x0010 | 0x0002));
  insertseg(3, 0x00000000, 0xffffffff,
            (0x0400 | 0x0200 | 0x0080 | 0x0000 | 0x0010 | 0x0002));
}


x86 assembly (clang, -O0):
<initialsegs>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <insertseg@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x69a,%ecx
call   1030 <insertseg@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x692,%ecx
call   1030 <insertseg@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x692,%ecx
call   1030 <insertseg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialsegs>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <insertseg@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x69a,%ecx
call   1030 <insertseg@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x692,%ecx
call   1030 <insertseg@plt>
mov    $0x3,%edi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0x692,%ecx
pop    %rax
jmp    1030 <insertseg@plt>

LLVM IR (-O0):
define void @initialsegs() {
%1 = call i32 @insertseg(i32 0, i32 0, i32 0, i32 0)
%2 = call i32 @insertseg(i32 1, i32 0, i32 -1, i32 1690)
%3 = call i32 @insertseg(i32 2, i32 0, i32 -1, i32 1682)
%4 = call i32 @insertseg(i32 3, i32 0, i32 -1, i32 1682)
ret void
}

LLVM IR (-O2):
define void @initialsegs() {
%1 = tail call i32 @insertseg(i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @insertseg(i32 1, i32 0, i32 -1, i32 1690)
%3 = tail call i32 @insertseg(i32 2, i32 0, i32 -1, i32 1682)
%4 = tail call i32 @insertseg(i32 3, i32 0, i32 -1, i32 1682)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int dumpio_fopen(char *, int);
int /*<<< orphan*/ dumpio_set_str(char *, char const *, int);
void dumpio_fopen_(int32_t *fid, const char *fname, int32_t *mode,
                   int32_t fname_len) {
  char _fname[256];
  int32_t _fname_len = fname_len;
  if (_fname_len > 256 - 1) {
    _fname_len = 256 - 1;
  }
  dumpio_set_str(_fname, fname, _fname_len);
  *fid = dumpio_fopen(_fname, *mode);
}


x86 assembly (clang, -O0):
<dumpio_fopen_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x124(%rbp)
cmpl   $0xff,-0x124(%rbp)
jle    115d <dumpio_fopen_+0x3d>
movl   $0xff,-0x124(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x124(%rbp),%edx
call   1040 <dumpio_set_str@plt>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1030 <dumpio_fopen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpio_fopen_>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
cmp    $0xff,%ecx
mov    $0xff,%edx
cmovl  %ecx,%edx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <dumpio_set_str@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
call   1030 <dumpio_fopen@plt>
mov    %eax,(%r14)
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @dumpio_fopen_(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [256 x i8]
%10 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%11 = load i32, i32* %8
store i32 %11, i32* %10
%12 = load i32, i32* %10
%13 = icmp sgt i32 %12, 255
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 255, i32* %10
br label %15
15: ; preds = %14, %4
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = load i8*, i8** %6
%18 = load i32, i32* %10
%19 = call i32 @dumpio_set_str(i8* %16, i8* %17, i32 %18)
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = call i32 @dumpio_fopen(i8* %20, i32 %22)
%24 = load i32*, i32** %5
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @dumpio_fopen_(i32* nocapture writeonly %0, i8* %1, i32* nocapture %2, i32 %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = icmp slt i32 %3, 255
%8 = select i1 %7, i32 %3, i32 255
%9 = call i32 @dumpio_set_str(i8* %6, i8* %1, i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @dumpio_fopen(i8* %6, i32 %10)
store i32 %11, i32* %0
ret void
}
void d2i_AUTHORITY_INFO_ACCESS(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_AUTHORITY_INFO_ACCESS() {
ret void
}
/* Variables and functions */
int strcmp(void *, void *);
int string_cmp_key(void *key1, void *key2) { return strcmp(key1, key2); }


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

x86 assembly (clang, -O2):
<string_cmp_key>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @string_cmp_key(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}