xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int factorial = 1;
  int i;
  for (i = 0; i < 10; i++) {
    factorial = factorial * array[i];
  }
  printf("10! is %d.\n", factorial);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x1,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x38(%rbp)
jge    1179 <main+0x59>
mov    -0x34(%rbp),%eax
movslq -0x38(%rbp),%rcx
imul   -0x30(%rbp,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1152 <main+0x32>
mov    -0x34(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [12 x i8] c"10! is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [10 x i32]* %2 to i8*
store i32 1, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = mul nsw i32 %10, %14
store i32 %15, i32* %3
br label %16
16: ; preds = %9
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [12 x i8] c"10! is %d.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
double r18(void *x) { return *(double *)(x + 32750); }


x86 assembly (clang, -O0):
<r18>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x7fee(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<r18>:
movsd  0x7fee(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @r18(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32750
%5 = bitcast i8* %4 to double*
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
define double @r18(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32750
%3 = bitcast i8* %2 to double*
%4 = load double, double* %3
ret double %4
}
unsigned xrop3_86_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_86_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_86_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %eax,%ecx
xor    $0xff,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_86_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = xor i32 %29, -1
%31 = and i32 %28, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = or i32 %31, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @xrop3_86_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, 255
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ swap(int *, int, int);
void reverse(int array[], int size) {
  int i;
  for (i = 0; i < size / 2; i++) {
    swap(array, i, size - i - 1);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1167 <reverse+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <swap@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <reverse+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     1157 <reverse+0x47>
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%r15d
shr    $0x1f,%r15d
add    %esi,%r15d
sar    %r15d
add    $0xffffffff,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <swap@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebp,%r15d
jne    1140 <reverse+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @reverse(i32* %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i32 [ %10, %5 ], [ 0, %2 ]
%7 = xor i32 %6, -1
%8 = add i32 %7, %1
%9 = tail call i32 @swap(i32* %0, i32 %6, i32 %8)
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, %3
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
double __ieee754_acos(double);
double acos(double x) { return __ieee754_acos(x); }


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

x86 assembly (clang, -O2):
<acos>:
jmp    1030 <__ieee754_acos@plt>

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

LLVM IR (-O2):
define double @acos(double %0) {
%2 = tail call double @__ieee754_acos(double %0)
ret double %2
}
void pci_pri_init(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_pri_init(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int strlen(char *);
void fill_trailing_zeroes(char *buf, int bufsize) {
  int len;
  buf[bufsize - 1] = '\0';
  len = strlen(buf);
  if (bufsize - len > 0)
    memset(&buf[len], 0, bufsize - len);
}


x86 assembly (clang, -O0):
<fill_trailing_zeroes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
jle    1173 <fill_trailing_zeroes+0x53>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
add    %rax,%rdi
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_trailing_zeroes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %esi,%r14
movb   $0x0,-0x1(%r14,%rdi,1)
call   1030 <strlen@plt>
sub    %eax,%r14d
jle    1153 <fill_trailing_zeroes+0x33>
cltq
add    %rax,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memset@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @fill_trailing_zeroes(i8* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
%6 = tail call i32 @strlen(i8* %0)
%7 = sub nsw i32 %1, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = sext i32 %6 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = tail call i32 @memset(i8* %11, i32 0, i32 %7)
br label %13
13: ; preds = %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  int i = 0x0102;
  char *p = (char *)&i;
  printf("Bytes of i: %d, %d\n", p[0], p[1]);
  assert(p[0] == 0);
  assert(p[1] == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x102,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xeb8(%rip),%rdi
movsbl %cl,%esi
movsbl 0x1(%rax),%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %edi,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Bytes of i: %d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 258, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Bytes of i: %d, %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8 signext 2, i8 signext 1)
%2 = tail call i32 @assert(i32 0)
%3 = tail call i32 @assert(i32 0)
ret i32 0
}
unsigned char low(int value) { return (value & 0xff); }


x86 assembly (clang, -O0):
<low>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @low(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @low(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void InitKeyboard() {
  initscr();
  noecho();
  cbreak();
  keypad(stdscr, TRUE);
  refresh();
}


x86 assembly (clang, -O0):
<InitKeyboard>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitKeyboard>:
push   %rax
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1070 <noecho@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @InitKeyboard() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @cbreak()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = call i32 @keypad(i32 %4, i32 %5)
%7 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @InitKeyboard() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @cbreak()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int car(int);
scalar_t__ integral(int);
int scalar(int t) { return (integral(t) || car(t) == (-4)); }


x86 assembly (clang, -O0):
<scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <integral@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1156 <scalar+0x36>
mov    -0x4(%rbp),%edi
call   1040 <car@plt>
cmp    $0xfffffffc,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalar>:
push   %rbx
mov    %edi,%ebx
call   1030 <integral@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <scalar+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <car@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xfffffffc,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @scalar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @integral(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @car(i32 %7)
%9 = icmp eq i32 %8, -4
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @scalar(i32 %0) {
%2 = tail call i64 @integral(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @car(i32 %0)
%6 = icmp eq i32 %5, -4
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ imprimir_memoria(int ***, int, int);
int main() {
  int arreglo[2][5] = {{4, 6, 18, 10, 12}, {5, 23, 43, 78, 98}};
  imprimir_memoria(&arreglo, 2, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1040 <imprimir_memoria@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1030 <imprimir_memoria@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arreglo = [2 x [5 x i32]] [[5 x i32] [i32 4, i32 6, i32 18, i32 10, i32 12], [5 x i32] [i32 5, i32 23, i32 43, i32 78, i32 98]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [5 x i32]]
store i32 0, i32* %1
%3 = bitcast [2 x [5 x i32]]* %2 to i8*
%4 = bitcast [2 x [5 x i32]]* %2 to i32***
%5 = call i32 @imprimir_memoria(i32*** %4, i32 2, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arreglo = [2 x [5 x i32]] [[5 x i32] [i32 4, i32 6, i32 18, i32 10, i32 12], [5 x i32] [i32 5, i32 23, i32 43, i32 78, i32 98]]
define i32 @main() {
%1 = alloca [2 x [5 x i32]]
%2 = bitcast [2 x [5 x i32]]* %1 to i8*
%3 = bitcast [2 x [5 x i32]]* %1 to i32***
%4 = call i32 @imprimir_memoria(i32*** %3, i32 2, i32 5)
ret i32 0
}
void k(void) {}


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

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

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

LLVM IR (-O2):
define void @k() {
ret void
}
unsigned char telnet_opt_nak(unsigned char cmd) {
  switch (cmd) {
  case 253:
    return 252;
  case 254:
    return 251;
  case 251:
    return 254;
  case 252:
    return 253;
  }
  return 0;
}


x86 assembly (clang, -O0):
<telnet_opt_nak>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffff05,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     115a <telnet_opt_nak+0x5a>
mov    -0x10(%rbp),%rax
lea    0xed3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0xfc,-0x1(%rbp)
jmp    115e <telnet_opt_nak+0x5e>
movb   $0xfb,-0x1(%rbp)
jmp    115e <telnet_opt_nak+0x5e>
movb   $0xfe,-0x1(%rbp)
jmp    115e <telnet_opt_nak+0x5e>
movb   $0xfd,-0x1(%rbp)
jmp    115e <telnet_opt_nak+0x5e>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<telnet_opt_nak>:
mov    $0xf9,%al
sub    %dil,%al
add    $0x5,%dil
xor    %ecx,%ecx
cmp    $0x4,%dil
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @telnet_opt_nak(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %10 [
i32 253, label %6
i32 254, label %7
i32 251, label %8
i32 252, label %9
]
6: ; preds = %1
store i8 -4, i8* %2
br label %11
7: ; preds = %1
store i8 -5, i8* %2
br label %11
8: ; preds = %1
store i8 -2, i8* %2
br label %11
9: ; preds = %1
store i8 -3, i8* %2
br label %11
10: ; preds = %1
store i8 0, i8* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @telnet_opt_nak(i8 zeroext %0) {
%2 = add i8 %0, 5
%3 = icmp ult i8 %2, 4
%4 = sub i8 -7, %0
%5 = select i1 %3, i8 %4, i8 0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ argument_count(char *);
int /*<<< orphan*/ printf(char *, int);
int sum(int /*<<< orphan*/, int);
int main(void) {
  printf("Sum((1, 1, 1, 1, 1))"
         " = [%d]\n",
         (sum(argument_count("(1, 1, 1, 1, 1)"), (1, 1, 1, 1, 1))));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed7(%rip),%rdi
call   1040 <argument_count@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <sum@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee5(%rip),%rdi
call   1040 <argument_count@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <sum@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Sum((1, 1, 1, 1, 1)) = [%d]\0A\00"
@.str.1 = [16 x i8] c"(1, 1, 1, 1, 1)\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @argument_count(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @sum(i32 %2, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Sum((1, 1, 1, 1, 1)) = [%d]\0A\00"
@.str.1 = [16 x i8] c"(1, 1, 1, 1, 1)\00"
define i32 @main() {
%1 = tail call i32 @argument_count(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @sum(i32 %1, i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
struct PdTransport {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ block_process_(struct PdTransport *);
void pd_transport_block_process(struct PdTransport *ts) { block_process_(ts); }


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

x86 assembly (clang, -O2):
<pd_transport_block_process>:
jmp    1030 <block_process_@plt>

LLVM IR (-O0):
%struct.PdTransport = type { i32 }
define void @pd_transport_block_process(%struct.PdTransport* %0) {
%2 = alloca %struct.PdTransport*
store %struct.PdTransport* %0, %struct.PdTransport** %2
%3 = load %struct.PdTransport*, %struct.PdTransport** %2
%4 = call i32 @block_process_(%struct.PdTransport* %3)
ret void
}

LLVM IR (-O2):
%struct.PdTransport = type { i32 }
define void @pd_transport_block_process(%struct.PdTransport* %0) {
%2 = tail call i32 @block_process_(%struct.PdTransport* %0)
ret void
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  printf("Put two numbers (separated by space) to calculate\nthe Greatest "
         "Common Divisor: ");
  int i, j;
  scanf("%i%i", &i, &j);
  printf("\n  Greatest Common Divisor: %i\n", gcd(i, j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%esi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <gcd@plt>
lea    0xeef(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [80 x i8] c"Put two numbers (separated by space) to calculate\0Athe Greatest Common Divisor: \00"
@.str.1 = [5 x i8] c"%i%i\00"
@.str.2 = [32 x i8] c"\0A Greatest Common Divisor: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @gcd(i32 %6, i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [80 x i8] c"Put two numbers (separated by space) to calculate\0Athe Greatest Common Divisor: \00"
@.str.1 = [5 x i8] c"%i%i\00"
@.str.2 = [32 x i8] c"\0A Greatest Common Divisor: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @gcd(i32 %7, i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
long grib_power(long, long);
long grib_op_pow(long a, long b) { return grib_power(a, b); }


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

x86 assembly (clang, -O2):
<grib_op_pow>:
jmp    1030 <grib_power@plt>

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

LLVM IR (-O2):
define i64 @grib_op_pow(i64 %0, i64 %1) {
%3 = tail call i64 @grib_power(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_square(void) { printf("I'm a Square\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"I'm a Square\00"
define void @print_square() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mbtowc(int /*<<< orphan*/ *, char const *, size_t);
int mblen(const char *s, size_t n) { return mbtowc(NULL, s, n); }


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

x86 assembly (clang, -O2):
<mblen>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <mbtowc@plt>

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

LLVM IR (-O2):
define i32 @mblen(i8* %0, i64 %1) {
%3 = tail call i32 @mbtowc(i32* null, i8* %0, i64 %1)
ret i32 %3
}
/* Type definitions */
struct game {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ move_left(struct game *);
int /*<<< orphan*/ rotate_clockwise(struct game *);
void move_up(struct game *game) {
  rotate_clockwise(game);
  rotate_clockwise(game);
  rotate_clockwise(game);
  move_left(game);
  rotate_clockwise(game);
}


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

x86 assembly (clang, -O2):
<move_up>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1040 <rotate_clockwise@plt>
mov    %rbx,%rdi
call   1030 <move_left@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <rotate_clockwise@plt>

LLVM IR (-O0):
%struct.game = type { i32 }
define void @move_up(%struct.game* %0) {
%2 = alloca %struct.game*
store %struct.game* %0, %struct.game** %2
%3 = load %struct.game*, %struct.game** %2
%4 = call i32 @rotate_clockwise(%struct.game* %3)
%5 = load %struct.game*, %struct.game** %2
%6 = call i32 @rotate_clockwise(%struct.game* %5)
%7 = load %struct.game*, %struct.game** %2
%8 = call i32 @rotate_clockwise(%struct.game* %7)
%9 = load %struct.game*, %struct.game** %2
%10 = call i32 @move_left(%struct.game* %9)
%11 = load %struct.game*, %struct.game** %2
%12 = call i32 @rotate_clockwise(%struct.game* %11)
ret void
}

LLVM IR (-O2):
%struct.game = type { i32 }
define void @move_up(%struct.game* %0) {
%2 = tail call i32 @rotate_clockwise(%struct.game* %0)
%3 = tail call i32 @rotate_clockwise(%struct.game* %0)
%4 = tail call i32 @rotate_clockwise(%struct.game* %0)
%5 = tail call i32 @move_left(%struct.game* %0)
%6 = tail call i32 @rotate_clockwise(%struct.game* %0)
ret void
}
/* Variables and functions */
int rand();
float ranf(void) {
  long r = (rand() & 077777);
  return ((float)r / 32768.);
}


x86 assembly (clang, -O0):
<ranf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x7fff,%eax
cltq
mov    %rax,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x7fff,%eax
cvtsi2ss %eax,%xmm0
mulss  0xed7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ranf() {
%1 = alloca i64
%2 = call i32 (...) @rand()
%3 = and i32 %2, 32767
%4 = sext i32 %3 to i64
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = sitofp i64 %5 to float
%7 = fpext float %6 to double
%8 = fdiv double %7, 3.276800e+04
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @ranf() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 32767
%3 = uitofp i32 %2 to float
%4 = fmul float %3, 0x3F00000000000000
ret float %4
}
/* Variables and functions */
int ssleay_rand_bytes(unsigned char *, int, int /*<<< orphan*/, int);
int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num) {
  return ssleay_rand_bytes(buf, num, 0, 1);
}


x86 assembly (clang, -O0):
<ssleay_rand_nopseudo_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <ssleay_rand_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssleay_rand_nopseudo_bytes>:
xor    %edx,%edx
mov    $0x1,%ecx
jmp    1030 <ssleay_rand_bytes@plt>

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

LLVM IR (-O2):
define i32 @ssleay_rand_nopseudo_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @ssleay_rand_bytes(i8* %0, i32 %1, i32 0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printInvalidKeywordError() {
  fprintf(stderr, "Invalid keyword found in file\n");
}


x86 assembly (clang, -O0):
<printInvalidKeywordError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printInvalidKeywordError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Invalid keyword found in file\0A\00"
define void @printInvalidKeywordError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Invalid keyword found in file\0A\00"
define void @printInvalidKeywordError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
int func(int x) {
#pragma critTer : 3 :../../ test / resources / functionCommentParam.c:
  return 0;
#pragma critTer : 4 :../../ test / resources / functionCommentParam.c:
}


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

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

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

LLVM IR (-O2):
define i32 @func(i32 %0) {
ret i32 0
}
int parse_ff(char **buf, unsigned int len) {
  *buf += len;
  return len;
}


x86 assembly (clang, -O0):
<parse_ff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    %edx,%edx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_ff>:
mov    %esi,%eax
mov    %esi,%ecx
add    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @parse_ff(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %6
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @parse_ff(i8** nocapture %0, i32 returned %1) {
%3 = load i8*, i8** %0
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %3, i64 %4
store i8* %5, i8** %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ gdb_pollrx();
void gdb_putchar(char c) {
  (*((volatile unsigned int *)((0x12000000 + 0x000) + 0x8))) = c;
  while ((*((volatile unsigned int *)((0x12000000 + 0x000) + 0x4))) & (1 << 3))
    gdb_pollrx();
}


x86 assembly (clang, -O0):
<gdb_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x12000008,%eax
mov    %ecx,(%rax)
mov    $0x12000004,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1148 <gdb_putchar+0x38>
mov    $0x0,%al
call   1030 <gdb_pollrx@plt>
jmp    1129 <gdb_putchar+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_putchar>:
push   %rax
mov    %edi,0x12000008
testl  $0x8,0x12000004
je     1144 <gdb_putchar+0x34>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <gdb_pollrx@plt>
testl  $0x8,0x12000004
jne    1130 <gdb_putchar+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @gdb_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
store volatile i32 %4, i32* inttoptr (i64 301989896 to i32*)
br label %5
5: ; preds = %9, %1
%6 = load volatile i32, i32* inttoptr (i64 301989892 to i32*)
%7 = and i32 %6, 8
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 (...) @gdb_pollrx()
br label %5
11: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @gdb_putchar(i8 signext %0) {
%2 = sext i8 %0 to i32
store volatile i32 %2, i32* inttoptr (i64 301989896 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 301989892 to i32*)
%4 = and i32 %3, 8
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1, %6
%7 = tail call i32 (...) @gdb_pollrx()
%8 = load volatile i32, i32* inttoptr (i64 301989892 to i32*)
%9 = and i32 %8, 8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flip_word(char *, char *);
int strcmp(char *, char *);
size_t strlen(char *);
int is_palindrome_rec(char *input) {
  char output[100];
  flip_word(input, output);
  output[strlen(input) - 1] = input[0];
  output[strlen(input)] = '\0';
  return strcmp(input, output);
}


x86 assembly (clang, -O0):
<is_palindrome_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <flip_word@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x71(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x71(%rbp),%cl
sub    $0x1,%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
movb   $0x0,-0x70(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <strcmp@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome_rec>:
push   %rbp
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <flip_word@plt>
mov    (%rbx),%bpl
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %bpl,-0x1(%rsp,%rax,1)
movb   $0x0,(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_palindrome_rec(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @flip_word(i8* %4, i8* %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = sub i64 %11, 1
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %12
store i8 %9, i8* %13
%14 = load i8*, i8** %2
%15 = call i64 @strlen(i8* %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %2
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%19 = call i32 @strcmp(i8* %17, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_palindrome_rec(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @flip_word(i8* %0, i8* %3)
%5 = load i8, i8* %0
%6 = call i64 @strlen(i8* %0)
%7 = add i64 %6, -1
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %7
store i8 %5, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %6
store i8 0, i8* %9
%10 = call i32 @strcmp(i8* %0, i8* %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
clearscreen() { printf("[2J"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define i32 @clearscreen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int _spi_transfer(int, int, int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int spi_read_reg(int fd, uint8_t addr, uint8_t *data) {
  return _spi_transfer(fd, false, addr, data, 1);
}


x86 assembly (clang, -O0):
<spi_read_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%r8d
call   1030 <_spi_transfer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_read_reg>:
mov    %rdx,%rcx
mov    %esi,%edx
xor    %esi,%esi
mov    $0x1,%r8d
jmp    1030 <_spi_transfer@plt>

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

LLVM IR (-O2):
define i32 @spi_read_reg(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @_spi_transfer(i32 %0, i32 0, i32 %1, i32* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  int pid;
  int status;
  if ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
    printf(" Signal % d reçu \n ", sig);
  }
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    115d <traitement_signal+0x3d>
mov    -0x4(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    1151 <traitement_signal+0x31>
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [21 x i8] c" Signal % d re\C3\A7u \0A \00"
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 -1, i32* %4, i32 %5)
store i32 %6, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [21 x i8] c" Signal % d re\C3\A7u \0A \00"
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int strlen(char *);
char *chomp(char *line) {
  int l = strlen(line);
  if (l > 0 && line[l - 1] == '\n')
    line[l - 1] = 0;
  return line;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115d <chomp+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115d <chomp+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <chomp+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <chomp+0x1a>
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @chomp(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ i2c_EnableNoiseFilter(int /*<<< orphan*/);
void i2c0_EnableNoiseFilter(void) { i2c_EnableNoiseFilter(0); }


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

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

LLVM IR (-O0):
define void @i2c0_EnableNoiseFilter() {
%1 = call i32 @i2c_EnableNoiseFilter(i32 0)
ret void
}

LLVM IR (-O2):
define void @i2c0_EnableNoiseFilter() {
%1 = tail call i32 @i2c_EnableNoiseFilter(i32 0)
ret void
}
/* Variables and functions */
long double pow(long double, long double);
long double powl(long double a1, long double a2) { return pow(a1, a2); }


x86 assembly (clang, -O0):
<powl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <pow@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powl>:
jmp    1030 <pow@plt>

LLVM IR (-O0):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @pow(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @powl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @pow(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}