xunge/DecIR huggingface dataset:
void map(int (*f)(int), int *list, int n) {
  for (int i = 0; i < n; i++)
    list[i] = f(list[i]);
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1152 <map+0x52>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <map+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1134 <map+0x34>
mov    %rsi,%r12
mov    %rdi,%r14
mov    %edx,%r15d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%edi
call   *%r14
mov    %eax,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1120 <map+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @map(i32 (i32)* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 %0(i32 %11)
store i32 %12, i32* %10
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %7, label %8
}
/* Variables and functions */
long x_argument(char, char const *, char *);
long multi_argument(const char *argument, char *arg) {
  return x_argument('*', argument, arg);
}


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

x86 assembly (clang, -O2):
<multi_argument>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2a,%edi
jmp    1030 <x_argument@plt>

LLVM IR (-O0):
define i64 @multi_argument(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 i64 @x_argument(i8 signext 42, i8* %5, i8* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @multi_argument(i8* %0, i8* %1) {
%3 = tail call i64 @x_argument(i8 signext 42, i8* %0, i8* %1)
ret i64 %3
}
int fun1029() { return 1029; }


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

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

LLVM IR (-O0):
define i32 @fun1029() {
ret i32 1029
}

LLVM IR (-O2):
define i32 @fun1029() {
ret i32 1029
}
void initgtkbuilderi18n() {}


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

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

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

LLVM IR (-O2):
define void @initgtkbuilderi18n() {
ret void
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
unsigned char read_reg8(struct device *, int);
int wait_busy(struct device *dev) {
  unsigned char st;
  do {
    st = read_reg8(dev, 518);
  } while ((st & (1 << 7)) && !(st & (1 << 0)));
  return st & (1 << 0) ? -1 : 0;
}


x86 assembly (clang, -O0):
<wait_busy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x206,%esi
call   1030 <read_reg8@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
and    $0x80,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1157 <wait_busy+0x47>
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    111c <wait_busy+0xc>
movzbl -0x9(%rbp),%edx
and    $0x1,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_busy>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x206,%esi
call   1030 <read_reg8@plt>
movzbl %al,%eax
mov    %eax,%ecx
and    $0xffffff81,%ecx
cmp    $0x80,%ecx
je     1120 <wait_busy+0x10>
and    $0x1,%eax
neg    %eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.device = type { i32 }
define i32 @wait_busy(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca i8
store %struct.device* %0, %struct.device** %2
br label %4
4: ; preds = %18, %1
%5 = load %struct.device*, %struct.device** %2
%6 = call zeroext i8 @read_reg8(%struct.device* %5, i32 518)
store i8 %6, i8* %3
br label %7
7: ; preds = %4
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = and i32 %9, 128
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = and i32 %14, 1
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
br label %18
18: ; preds = %12, %7
%19 = phi i1 [ false, %7 ], [ %17, %12 ]
br i1 %19, label %4, label %20
20: ; preds = %18
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = and i32 %22, 1
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 -1, i32 0
ret i32 %26
}

LLVM IR (-O2):
%struct.device = type { i32 }
define i32 @wait_busy(%struct.device* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call zeroext i8 @read_reg8(%struct.device* %0, i32 518)
%4 = zext i8 %3 to i32
%5 = and i32 %4, 129
%6 = icmp eq i32 %5, 128
br i1 %6, label %2, label %7
7: ; preds = %2
%8 = and i32 %4, 1
%9 = sub nsw i32 0, %8
ret i32 %9
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die(char *);
void *fcalloc(size_t n, size_t size) {
  void *p;
  if (size == 0 || n == 0)
    return NULL;
  if ((p = calloc(n, size)) == NULL)
    die("Failed to reserve memory:");
  return p;
}


x86 assembly (clang, -O0):
<fcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1146 <fcalloc+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    1153 <fcalloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1182 <fcalloc+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    117a <fcalloc+0x5a>
lea    0xe8b(%rip),%rdi
call   1040 <die@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcalloc>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1137 <fcalloc+0x17>
test   %rsi,%rsi
je     1137 <fcalloc+0x17>
call   1030 <calloc@plt>
test   %rax,%rax
je     1139 <fcalloc+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <die@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Failed to reserve memory:\00"
define i8* @fcalloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i64, i64* %4
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9, %2
store i8* null, i8** %3
br label %22
13: ; preds = %9
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = call i8* @calloc(i64 %14, i64 %15)
store i8* %16, i8** %6
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %13
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %20, %12
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
@.str = [26 x i8] c"Failed to reserve memory:\00"
define noalias i8* @fcalloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = icmp eq i64 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %6, %9, %2
%12 = phi i8* [ null, %2 ], [ null, %9 ], [ %7, %6 ]
ret i8* %12
}
float per_tetrag(float plevra) { return 4.0 * plevra; }


x86 assembly (clang, -O0):
<per_tetrag>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<per_tetrag>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @per_tetrag(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 4.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @per_tetrag(float %0) {
%2 = fmul float %0, 4.000000e+00
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int readln() {
  int i;
  scanf("%d", &i);
  return i;
}


x86 assembly (clang, -O0):
<readln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readln>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @readln() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @readln() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
void rec(int **u, int i) {
  *u = &i;
  if (i)
    return;
  else {
    i++;
    u = (int **)malloc(sizeof(int *));
    rec(u, i);
    return;
  }
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
lea    -0xc(%rbp),%rcx
mov    %rcx,(%rax)
cmpl   $0x0,-0xc(%rbp)
je     1149 <rec+0x29>
jmp    116c <rec+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <rec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
push   %rax
lea    0x4(%rsp),%rax
mov    %rax,(%rdi)
test   %esi,%esi
je     112f <rec+0xf>
pop    %rax
ret
movl   $0x1,0x4(%rsp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    0x4(%rsp),%esi
mov    %rax,%rdi
call   1040 <rec@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @rec(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
store i32* %4, i32** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %16
9: ; preds = %2
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
%12 = call i64 @malloc(i32 8)
%13 = inttoptr i64 %12 to i32**
store i32** %13, i32*** %3
%14 = load i32**, i32*** %3
%15 = load i32, i32* %4
br label %16
16: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @rec(i32** nocapture writeonly %0, i32 %1) {
%3 = alloca i32
store i32* %3, i32** %0
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %9
5: ; preds = %2
store i32 1, i32* %3
%6 = call i64 @malloc(i32 8)
%7 = inttoptr i64 %6 to i32**
%8 = load i32, i32* %3
br label %9
9: ; preds = %2, %5
ret void
}
int preen(int current, int max) {
  if (current > max)
    current = current - max;
  if (current < 0)
    current = current + max;
  return (current);
}


x86 assembly (clang, -O0):
<preen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    111f <preen+0x1f>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1132 <preen+0x32>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<preen>:
xor    %eax,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
sub    %eax,%edi
mov    %edi,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @preen(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %3
br label %12
12: ; preds = %8, %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @preen(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 0
%5 = sub nsw i32 %0, %4
%6 = icmp slt i32 %5, 0
%7 = select i1 %6, i32 %1, i32 0
%8 = add nsw i32 %7, %5
ret i32 %8
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
struct termios *malloc(int);
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
struct termios *get_termio_attr(void) {
  struct termios *current;
  current = malloc(sizeof(struct termios));
  tcgetattr(STDIN_FILENO, current);
  return current;
}


x86 assembly (clang, -O0):
<get_termio_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <tcgetattr@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_termio_attr>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <tcgetattr@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
define %struct.termios* @get_termio_attr() {
%1 = alloca %struct.termios*
%2 = call %struct.termios* @malloc(i32 4)
store %struct.termios* %2, %struct.termios** %1
%3 = load i32, i32* @STDIN_FILENO
%4 = load %struct.termios*, %struct.termios** %1
%5 = call i32 @tcgetattr(i32 %3, %struct.termios* %4)
%6 = load %struct.termios*, %struct.termios** %1
ret %struct.termios* %6
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
define %struct.termios* @get_termio_attr() {
%1 = tail call %struct.termios* @malloc(i32 4)
%2 = load i32, i32* @STDIN_FILENO
%3 = tail call i32 @tcgetattr(i32 %2, %struct.termios* %1)
ret %struct.termios* %1
}
/* Variables and functions */
int /*<<< orphan*/ yyparse();
int main(int argc, char **argv) { yyparse(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <yyparse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <yyparse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @yyparse()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @yyparse()
ret i32 0
}
void workload(double m1[1024 * 1024], double m2[1024 * 1024],
              double prod[1024 * 1024]) {
#pragma HLS INTERFACE m_axi port = m1 offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = m2 offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = prod offset = slave bundle = gmem
#pragma HLS INTERFACE s_axilite port = m1 bundle = control
#pragma HLS INTERFACE s_axilite port = m2 bundle = control
#pragma HLS INTERFACE s_axilite port = prod bundle = control
#pragma HLS INTERFACE s_axilite port = return bundle = control
  return;
}


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

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

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

LLVM IR (-O2):
define void @workload(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int puts(char *s) { return write(1, s, strlen(s)); }


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned long CountLeadingZeroes(unsigned long);
unsigned long NumBits(unsigned long x) { return 32 - CountLeadingZeroes(x); }


x86 assembly (clang, -O0):
<NumBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CountLeadingZeroes@plt>
mov    %rax,%rcx
mov    $0x20,%eax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumBits>:
push   %rax
call   1030 <CountLeadingZeroes@plt>
mov    $0x20,%ecx
sub    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @NumBits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @CountLeadingZeroes(i64 %3)
%5 = sub i64 32, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @NumBits(i64 %0) {
%2 = tail call i64 @CountLeadingZeroes(i64 %0)
%3 = sub i64 32, %2
ret i64 %3
}
/* Variables and functions */
unsigned long do_conv(char const *, char **, int, int /*<<< orphan*/);
unsigned long strtoul(const char *nptr, char **endptr, int base) {
  return do_conv(nptr, endptr, base, 0);
}


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

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

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

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @do_conv(i8* %0, i8** %1, i32 %2, i32 0)
ret i64 %4
}
char *GCMSystemIDToStr(char sysID) {
  switch (sysID) {
  case 'G':
    return "Gamecube";
  case 'U':
    return "GBA Player";
  default:
    return "Other";
  }
}


x86 assembly (clang, -O0):
<GCMSystemIDToStr>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x47,%eax
je     1130 <GCMSystemIDToStr+0x30>
jmp    111f <GCMSystemIDToStr+0x1f>
mov    -0x10(%rbp),%eax
sub    $0x55,%eax
je     1140 <GCMSystemIDToStr+0x40>
jmp    1150 <GCMSystemIDToStr+0x50>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <GCMSystemIDToStr+0x5b>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <GCMSystemIDToStr+0x5b>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCMSystemIDToStr>:
cmp    $0x55,%dil
lea    0xefe(%rip),%rax
lea    0xf02(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x47,%dil
lea    0xedf(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Gamecube\00"
@.str.1 = [11 x i8] c"GBA Player\00"
@.str.2 = [6 x i8] c"Other\00"
define i8* @GCMSystemIDToStr(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 71, label %6
i32 85, label %7
]
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"Gamecube\00"
@.str.1 = [11 x i8] c"GBA Player\00"
@.str.2 = [6 x i8] c"Other\00"
define i8* @GCMSystemIDToStr(i8 signext %0) {
%2 = icmp eq i8 %0, 85
%3 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i8 %0, 71
%5 = select i1 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int main() {
  PASS("big-jump-table");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <PASS@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <PASS@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"big-jump-table\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @PASS(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [15 x i8] c"big-jump-table\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @PASS(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outreg(int, int, int);
void serial_init(int channel) {
  outreg(channel, 0x03, 0x3);
  outreg(channel, 0x02, 0x07);
  outreg(channel, 0x01, 0x04);
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%edx
mov    %edx,%esi
call   1030 <outreg@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
mov    $0x7,%edx
call   1030 <outreg@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <outreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%esi
mov    $0x3,%edx
call   1030 <outreg@plt>
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x7,%edx
call   1030 <outreg@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x4,%edx
pop    %rbx
jmp    1030 <outreg@plt>

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

LLVM IR (-O2):
define void @serial_init(i32 %0) {
%2 = tail call i32 @outreg(i32 %0, i32 3, i32 3)
%3 = tail call i32 @outreg(i32 %0, i32 2, i32 7)
%4 = tail call i32 @outreg(i32 %0, i32 1, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_line(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  char line[4096];
  while (fgets(line, 4096, stdin) != NULL)
    do_line(line);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1010(%rbp),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0x1000,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
je     1177 <main+0x47>
lea    -0x1010(%rbp),%rdi
call   1050 <do_line@plt>
jmp    1142 <main+0x12>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    0x2ea7(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x1000,%esi
call   1030 <fgets@plt>
test   %rax,%rax
je     117d <main+0x4d>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1050 <do_line@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1030 <fgets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [4096 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %4, i32 4096, i32 %5)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %2, i64 0, i64 0
%10 = call i32 @do_line(i8* %9)
br label %3
11: ; preds = %3
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32* @fgets(i8* %2, i32 4096, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 @do_line(i8* %2)
%8 = load i32, i32* @stdin
%9 = call i32* @fgets(i8* %2, i32 4096, i32 %8)
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %0
%12 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
uint8_t capture_read_slave_dma(uint16_t port, void *p) {
  capture_event(p, (7 << 8), 0, port);
  return 0xff;
}


x86 assembly (clang, -O0):
<capture_read_slave_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x700,%esi
xor    %edx,%edx
call   1030 <capture_event@plt>
mov    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_read_slave_dma>:
push   %rax
mov    %edi,%ecx
mov    %rsi,%rdi
mov    $0x700,%esi
xor    %edx,%edx
call   1030 <capture_event@plt>
mov    $0xff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @capture_read_slave_dma(i32 %0, i8* %1) {
%3 = tail call i32 @capture_event(i8* %1, i32 1792, i32 0, i32 %0)
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ bug(double *, char, int, int, int, double, double *, int,
                       double *, int, double, double *, int);
void testTortureExecute(void) {
  double A[1], B[1], C[1];
  bug(C, 'B', 1, 2, 3, 4.0, A, 5, B, 6, 7.0, C, 8);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x18(%rbp),%rdi
lea    -0x8(%rbp),%r9
lea    -0x10(%rbp),%r10
lea    -0x18(%rbp),%rax
mov    $0x42,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
movsd  0xebb(%rip),%xmm0
movsd  0xebb(%rip),%xmm1
movl   $0x5,(%rsp)
mov    %r10,0x8(%rsp)
movl   $0x6,0x10(%rsp)
mov    %rax,0x18(%rsp)
movl   $0x8,0x20(%rsp)
call   1030 <bug@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
sub    $0x20,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rax
movsd  0xeda(%rip),%xmm0
lea    0x18(%rsp),%r9
movsd  0xed5(%rip),%xmm1
mov    $0x42,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
push   $0x8
push   %rdi
push   $0x6
push   %rax
push   $0x5
call   1030 <bug@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = alloca [1 x double]
%2 = alloca [1 x double]
%3 = alloca [1 x double]
%4 = getelementptr inbounds [1 x double], [1 x double]* %3, i64 0, i64 0
%5 = getelementptr inbounds [1 x double], [1 x double]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%7 = getelementptr inbounds [1 x double], [1 x double]* %3, i64 0, i64 0
%8 = call i32 @bug(double* %4, i8 signext 66, i32 1, i32 2, i32 3, double 4.000000e+00, double* %5, i32 5, double* %6, i32 6, double 7.000000e+00, double* %7, i32 8)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = alloca [1 x double]
%2 = alloca [1 x double]
%3 = alloca [1 x double]
%4 = bitcast [1 x double]* %1 to i8*
%5 = bitcast [1 x double]* %2 to i8*
%6 = bitcast [1 x double]* %3 to i8*
%7 = getelementptr inbounds [1 x double], [1 x double]* %3, i64 0, i64 0
%8 = getelementptr inbounds [1 x double], [1 x double]* %1, i64 0, i64 0
%9 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%10 = call i32 @bug(double* %7, i8 signext 66, i32 1, i32 2, i32 3, double 4.000000e+00, double* %8, i32 5, double* %9, i32 6, double 7.000000e+00, double* %7, i32 8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr,
                                     int prioceiling) {
  (void)attr;
  (void)prioceiling;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_mutexattr_setprioceiling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pthread_mutexattr_setprioceiling(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
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_mutexattr_setprioceiling(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _get_uf_id(size_t, size_t);
int /*<<< orphan*/ _union_uf(int /*<<< orphan*/, int /*<<< orphan*/);
void _union(size_t row1, size_t col1, size_t row2, size_t col2) {
  _union_uf(_get_uf_id(row1, col1), _get_uf_id(row2, col2));
}


x86 assembly (clang, -O0):
<_union>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_get_uf_id@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <_get_uf_id@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1030 <_union_uf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_union>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
call   1040 <_get_uf_id@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_get_uf_id@plt>
mov    %ebp,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_union_uf@plt>

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

LLVM IR (-O2):
define void @_union(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @_get_uf_id(i64 %0, i64 %1)
%6 = tail call i32 @_get_uf_id(i64 %2, i64 %3)
%7 = tail call i32 @_union_uf(i32 %5, i32 %6)
ret void
}
long core___core__Byte___Numeric__to_i(unsigned char self) {
  long var;
  long var1;
  var1 = (long)self;
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__Byte___Numeric__to_i>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @core___core__Byte___Numeric__to_i(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
%4 = alloca i64
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i64
store i64 %6, i64* %4
%7 = load i64, i64* %4
store i64 %7, i64* %3
br label %8
8: ; preds = %1
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @core___core__Byte___Numeric__to_i(i8 zeroext %0) {
%2 = zext i8 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void print_help(char *pname) {
  fprintf(stderr,
          "%s [option]\n"
          " -f [46]: specify family\n"
          " -a : specify bind address\n"
          " -p : specify port (default 9999)\n"
          " -h: help\n",
          pname);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [109 x i8] c"%s [option]\0A -f [46]: specify family\0A -a : specify bind address\0A -p : specify port (default 9999)\0A -h: help\0A\00"
define void @print_help(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 ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [109 x i8] c"%s [option]\0A -f [46]: specify family\0A -a : specify bind address\0A -p : specify port (default 9999)\0A -h: help\0A\00"
define void @print_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _init_signal();
int /*<<< orphan*/ exit(int);
int main();
void _start() {
  _init_signal();
  int ex = main();
  exit(ex);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_init_signal@plt>
mov    $0x0,%al
call   1040 <main@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1030 <_init_signal@plt>
xor    %eax,%eax
call   1040 <main@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @_start() {
%1 = alloca i32
%2 = call i32 (...) @_init_signal()
%3 = call i32 (...) @main()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @_init_signal()
%2 = tail call i32 (...) @main()
%3 = tail call i32 @exit(i32 %2)
unreachable
}
char *hash_plugin_summary(void) {
  return ("pwsafe \t\tPassword Safe passphrase plugin");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"pwsafe \09\09Password Safe passphrase plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [41 x i8] c"pwsafe \09\09Password Safe passphrase plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local2;
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        if (state[0UL] != local2 - local1) {
        }
        local2++;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 454761159UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jae    1185 <RandomFunc+0x85>
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1174 <RandomFunc+0x74>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    -0x28(%rbp),%rcx
cmp    %rcx,%rax
je     1163 <RandomFunc+0x63>
jmp    1163 <RandomFunc+0x63>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    113e <RandomFunc+0x3e>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
add    $0x1b1b1ac7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x2e8b115d,%eax
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = add i64 %10, 51238316
%12 = add i64 %11, 274866410
%13 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %12, i64* %13
store i64 0, i64* %7
br label %14
14: ; preds = %32, %2
%15 = load i64, i64* %7
%16 = icmp ult i64 %15, 1
br i1 %16, label %17, label %35
17: ; preds = %14
store i64 0, i64* %6
br label %18
18: ; preds = %29, %17
%19 = load i64, i64* %6
%20 = icmp ult i64 %19, 1
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%23 = load i64, i64* %22
%24 = load i64, i64* %6
%25 = load i64, i64* %7
%26 = sub i64 %24, %25
%27 = icmp ne i64 %23, %26
br i1 %27, label %28, label %29
28: ; preds = %21
br label %29
29: ; preds = %28, %21
%30 = load i64, i64* %6
%31 = add i64 %30, 1
store i64 %31, i64* %6
br label %18
32: ; preds = %18
%33 = load i64, i64* %7
%34 = add i64 %33, 2
store i64 %34, i64* %7
br label %14
35: ; preds = %14
%36 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%37 = load i64, i64* %36
%38 = add i64 %37, 454761159
%39 = load i64*, i64** %4
%40 = getelementptr inbounds i64, i64* %39, i64 0
store i64 %38, i64* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 780865885
store i64 %4, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, unsigned long, unsigned long,
                           unsigned long);
void makeFilename(char *name, unsigned long k, unsigned long modulus,
                  unsigned long high, char *prefix) {
  sprintf(name, "%s/b%lumod%lu_%lu.bk", prefix, k, modulus, high);
  return;
}


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

x86 assembly (clang, -O2):
<makeFilename>:
mov    %rcx,%r9
mov    %rdx,%rax
mov    %rsi,%rcx
lea    0xee0(%rip),%rsi
mov    %r8,%rdx
mov    %rax,%r8
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s/b%lumod%lu_%lu.bk\00"
define void @makeFilename(i8* %0, i64 %1, i64 %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %10
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load i64, i64* %9
%16 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12, i64 %13, i64 %14, i64 %15)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s/b%lumod%lu_%lu.bk\00"
define void @makeFilename(i8* nocapture writeonly %0, i64 %1, i64 %2, i64 %3, i8* %4) {
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %4, i64 %1, i64 %2, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
void skip_white_space(FILE *file) {
  int i;
  while ((i = getc(file)) != EOF)
    if ((i != ' ') && (i != '\t')) {
      ungetc(i, file);
      break;
    }
}


x86 assembly (clang, -O0):
<skip_white_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%eax
je     1171 <skip_white_space+0x51>
cmpl   $0x20,-0xc(%rbp)
je     116c <skip_white_space+0x4c>
cmpl   $0x9,-0xc(%rbp)
je     116c <skip_white_space+0x4c>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <ungetc@plt>
jmp    1171 <skip_white_space+0x51>
jmp    112c <skip_white_space+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_white_space>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    0x2eb5(%rip),%r14
jmp    1148 <skip_white_space+0x28>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r14),%eax
je     1168 <skip_white_space+0x48>
cmp    $0x20,%eax
je     1140 <skip_white_space+0x20>
cmp    $0x9,%eax
je     1140 <skip_white_space+0x20>
mov    %eax,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ungetc@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_white_space(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %19, %1
%5 = load i32*, i32** %2
%6 = call i32 @getc(i32* %5)
store i32 %6, i32* %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 32
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 9
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32, i32* %3
%17 = load i32*, i32** %2
%18 = call i32 @ungetc(i32 %16, i32* %17)
br label %20
19: ; preds = %12, %9
br label %4
20: ; preds = %15, %4
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_white_space(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %13, label %5
5: ; preds = %1, %7
%6 = phi i32 [ %8, %7 ], [ %2, %1 ]
switch i32 %6, label %11 [
i32 32, label %7
i32 9, label %7
]
7: ; preds = %5, %5
%8 = tail call i32 @getc(i32* %0)
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %13, label %5
11: ; preds = %5
%12 = tail call i32 @ungetc(i32 %6, i32* %0)
br label %13
13: ; preds = %7, %1, %11
ret void
}
/* Variables and functions */
int fdattr(int const);
int isadev(const int fd) { return (fdattr(fd) & 0x80) != 0; }


x86 assembly (clang, -O0):
<isadev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fdattr@plt>
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isadev>:
push   %rax
call   1030 <fdattr@plt>
shr    $0x7,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isadev(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fdattr(i32 %3)
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isadev(i32 %0) {
%2 = tail call i32 @fdattr(i32 %0)
%3 = lshr i32 %2, 7
%4 = and i32 %3, 1
ret i32 %4
}
void __attribute__((no)) foo(void) {
  char buf[128];
  snprintf(buf, sizeof(buf), "%s", __func__);
  printf("%s\n", buf);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x80(%rbp),%rdi
mov    $0x80,%esi
lea    0xec5(%rip),%rdx
lea    0xec1(%rip),%rcx
mov    $0x0,%al
call   1040 <snprintf@plt>
lea    -0x80(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x88,%rsp
movl   $0x6f6f66,(%rsp)
mov    %rsp,%rdi
call   1030 <puts@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@__func__.foo = [4 x i8] c"foo\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @foo() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %2, i64 128, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.foo, i64 0, i64 0))
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = bitcast [128 x i8]* %1 to i32*
store i32 7303014, i32* %3
%4 = call i32 @puts(i8* %2)
ret void
}