xunge/DecIR huggingface dataset:
int StaticTestFunction(int x) {
  int y = x * 3;
  return y;
}


x86 assembly (clang, -O0):
<StaticTestFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StaticTestFunction>:
lea    (%rdi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @StaticTestFunction(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 3
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @StaticTestFunction(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
int compare(const void *a, const void *b) {
  return (*(char *)a) - (*(char *)b);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(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* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
struct iio_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct iio_context *iio_create_usb_context(unsigned short vid,
                                           unsigned short pid) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<iio_create_usb_context>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    0x2ecf(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb6(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iio_create_usb_context>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.iio_context* @iio_create_usb_context(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret %struct.iio_context* null
}

LLVM IR (-O2):
%struct.iio_context = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.iio_context* @iio_create_usb_context(i16 zeroext %0, i16 zeroext %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.iio_context* null
}
/* Variables and functions */
char __VERIFIER_nondet_char();
int main() {
  signed char b = __VERIFIER_nondet_char();
  if (b < 0) {
    b = -b;
  }
  unsigned char a = b;
  b = b | 128;
  a = a | 128;
  if (a != b) {
  ERROR:
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_char@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jge    1141 <main+0x31>
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x5(%rbp)
movzbl -0x6(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
je     1180 <main+0x70>
jmp    1174 <main+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <main+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call signext i8 (...) @__VERIFIER_nondet_char()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = sub nsw i32 0, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %13
13: ; preds = %8, %0
%14 = load i8, i8* %2
store i8 %14, i8* %3
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = or i32 %16, 128
%18 = trunc i32 %17 to i8
store i8 %18, i8* %2
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = or i32 %20, 128
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %24, %26
br i1 %27, label %28, label %30
28: ; preds = %13
br label %29
29: ; preds = %28
store i32 -1, i32* %1
br label %31
30: ; preds = %13
store i32 0, i32* %1
br label %31
31: ; preds = %30, %29
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @__VERIFIER_nondet_char()
ret i32 -1
}
int sequence_two(int b) { return ((2 * b * b) % 5) + 11; }


x86 assembly (clang, -O0):
<sequence_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0xb,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_two>:
imul   %edi,%edi
add    %edi,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0xb,%eax
ret

LLVM IR (-O0):
define i32 @sequence_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = srem i32 %6, 5
%8 = add nsw i32 %7, 11
ret i32 %8
}

LLVM IR (-O2):
define i32 @sequence_two(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = srem i32 %3, 5
%5 = add nsw i32 %4, 11
ret i32 %5
}
/* Variables and functions */
double cos_73(double);
double poly_cos(double x) { return cos_73(x); }


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

x86 assembly (clang, -O2):
<poly_cos>:
jmp    1030 <cos_73@plt>

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

LLVM IR (-O2):
define double @poly_cos(double %0) {
%2 = tail call double @cos_73(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x0a() {
  Assert_real((isascii(10)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              55, ("isascii should be 1 for 0x0a"));
}


x86 assembly (clang, -O0):
<t_isascii_0x0a>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x37,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x0a>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x37,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0a\00"
define void @t_isascii_0x0a() {
%1 = call i32 @isascii(i32 10)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0a\00"
define void @t_isascii_0x0a() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 55, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *copystring(char *s) {
  char *b;
  b = malloc(strlen(s) + 1);
  strcpy(b, s);
  return b;
}


x86 assembly (clang, -O0):
<copystring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystring>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copystring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @copystring(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("Enter a whole number\n");
  scanf("%d", &number);
  if (number % 2 == 0)
    printf("Your number is even.\n");
  else
    printf("Your number is odd.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xee2(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter a whole number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Your number is even.\0A\00"
@.str.3 = [21 x i8] c"Your number is odd.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [21 x i8] c"Enter a whole number\00"
@str.4 = [20 x i8] c"Your number is odd.\00"
@str.5 = [21 x i8] c"Your number is even.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int errno;
scalar_t__ stat(char const *, struct stat *);
int is_dir(const char *path) {
  struct stat st;
  if (stat(path, &st) >= 0)
    return S_ISDIR(st.st_mode);
  return -errno;
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jl     1153 <is_dir+0x33>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
jmp    1161 <is_dir+0x41>
xor    %eax,%eax
mov    0x2e84(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1138 <is_dir+0x18>
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret
mov    0x2ea1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISDIR(i32 %10)
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load i32, i32* @errno
%14 = sub nsw i32 0, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp sgt i64 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %13
10: ; preds = %1
%11 = load i32, i32* @errno
%12 = sub nsw i32 0, %11
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %9, %6 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 10, y = 24, z;
  z = y % x;
  printf("integer remainder: %d\n", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x18,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"integer remainder: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
void RTMemPoolRealloc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemPoolRealloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char cwd[1024];
  if (!getcwd(cwd, 1024)) {
    perror("getcwd");
    exit(EXIT_FAILURE);
  }
  printf("cwd= %s\n", cwd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
cmp    $0x0,%eax
jne    117f <main+0x3f>
lea    0xe94(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    -0x400(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1040 <getcwd@plt>
test   %eax,%eax
je     1171 <main+0x31>
lea    0xea8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
ret
lea    0xe88(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"getcwd\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [9 x i8] c"cwd= %s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 1024)
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"getcwd\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [9 x i8] c"cwd= %s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 1024)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
size_t ft_strlen(const char *s) {
  int i;
  i = 0;
  while (s[i] != '\0')
    i++;
  return (i);
}


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

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

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

LLVM IR (-O2):
define i64 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
ret i64 %9
}
/* Variables and functions */
int xs2ap(float, float, float, float);
int xs2ap_(float *x1, float *y1, float *x2, float *y2) {
  return xs2ap(*x1, *y1, *x2, *y2);
}


x86 assembly (clang, -O0):
<xs2ap_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm3
call   1030 <xs2ap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xs2ap_>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  (%rdx),%xmm2
movss  (%rcx),%xmm3
jmp    1030 <xs2ap@plt>

LLVM IR (-O0):
define i32 @xs2ap_(float* %0, float* %1, float* %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load float*, float** %5
%10 = load float, float* %9
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = load float*, float** %8
%16 = load float, float* %15
%17 = call i32 @xs2ap(float %10, float %12, float %14, float %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @xs2ap_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3) {
%5 = load float, float* %0
%6 = load float, float* %1
%7 = load float, float* %2
%8 = load float, float* %3
%9 = tail call i32 @xs2ap(float %5, float %6, float %7, float %8)
ret i32 %9
}
void XcmsCIELabQueryMaxL() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIELabQueryMaxL() {
ret void
}
int calculaColumna(char tauler[6][7], int numFill) {
  int i, j = 0;
  for (i = 0; j <= numFill; i++) {
    if (tauler[6 - 1][i] == '-')
      j++;
  }
  return i - 1;
}


x86 assembly (clang, -O0):
<calculaColumna>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1157 <calculaColumna+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl 0x23(%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    1144 <calculaColumna+0x44>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <calculaColumna+0x49>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <calculaColumna+0x19>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculaColumna>:
test   %esi,%esi
js     1126 <calculaColumna+0x26>
add    $0x23,%rdi
xor    %ecx,%ecx
mov    $0xffffffff,%eax
nop
xor    %edx,%edx
cmpb   $0x2d,(%rdi)
sete   %dl
add    %edx,%ecx
add    $0x1,%rdi
add    $0x1,%eax
cmp    %esi,%ecx
jle    1110 <calculaColumna+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @calculaColumna([7 x i8]* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %17, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %12, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ 0, %2 ]
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %0, i64 5, i64 %5
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 45
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = add nuw i64 %5, 1
%13 = icmp sgt i32 %11, %1
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %12 to i32
%16 = add i32 %15, -1
br label %17
17: ; preds = %14, %2
%18 = phi i32 [ -1, %2 ], [ %16, %14 ]
ret i32 %18
}
int test1(int a, int b) { return (a ^ b) == 0; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test1(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 = xor i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int file_time_default(int *day, int *month, int *year) {
  *day = 1;
  *month = 1;
  *year = 1970;
  return 0;
}


x86 assembly (clang, -O0):
<file_time_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7b2,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_time_default>:
movl   $0x1,(%rdi)
movl   $0x1,(%rsi)
movl   $0x7b2,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @file_time_default(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
store i32 1, i32* %7
%8 = load i32*, i32** %5
store i32 1, i32* %8
%9 = load i32*, i32** %6
store i32 1970, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @file_time_default(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 1, i32* %0
store i32 1, i32* %1
store i32 1970, i32* %2
ret i32 0
}
int test_imm_96int8_reg(signed char val) {
  return ((val) & (-0x96 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_96int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff6a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_96int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -150
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int isprime1(int input) {
  int n;
  if (input < 1) {
    return 0;
  }
  n = input - 1;
  while (n > 1) {
    if (input % n == 0)
      return 0;
    n--;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <isprime1+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1161 <isprime1+0x61>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    115a <isprime1+0x5a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    114c <isprime1+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1161 <isprime1+0x61>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <isprime1+0x26>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime1>:
xor    %ecx,%ecx
test   %edi,%edi
jle    1121 <isprime1+0x21>
mov    %edi,%esi
nopl   0x0(%rax,%rax,1)
cmp    $0x3,%esi
jl     1124 <isprime1+0x24>
add    $0xffffffff,%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1110 <isprime1+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime1(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %5, %7 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = icmp sgt i32 %4, 2
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = srem i32 %0, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %7, %1
%11 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ]
ret i32 %11
}
/* Variables and functions */
char **helpReadLines(int /*<<< orphan*/);
char **readLines(void) { return helpReadLines(0); }


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

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

LLVM IR (-O0):
define i8** @readLines() {
%1 = call i8** @helpReadLines(i32 0)
ret i8** %1
}

LLVM IR (-O2):
define i8** @readLines() {
%1 = tail call i8** @helpReadLines(i32 0)
ret i8** %1
}
/* Variables and functions */
int /*<<< orphan*/ _SendPacket(unsigned char *, unsigned char *, unsigned int);
int SEGGER_SYSVIEW_SendPacket(unsigned char *pPacket,
                              unsigned char *pPayloadEnd,
                              unsigned int EventId) {
  ;
  _SendPacket(pPacket + 4, pPayloadEnd, EventId);
  ;
  return 0;
}


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

x86 assembly (clang, -O2):
<SEGGER_SYSVIEW_SendPacket>:
push   %rax
add    $0x4,%rdi
call   1030 <_SendPacket@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SEGGER_SYSVIEW_SendPacket(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 = getelementptr inbounds i8, i8* %7, i64 4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @_SendPacket(i8* %8, i8* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @SEGGER_SYSVIEW_SendPacket(i8* %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = tail call i32 @_SendPacket(i8* %4, i8* %1, i32 %2)
ret i32 0
}
long double test_lgammal(long double x) { return __builtin_lgammal(x); }


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

x86 assembly (clang, -O2):
<test_lgammal>:
jmp    1030 <lgammal@plt>

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

LLVM IR (-O2):
define x86_fp80 @test_lgammal(x86_fp80 %0) {
%2 = tail call x86_fp80 @lgammal(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long *);
long get_pid_max(void) {
  long pid_max = 32768;
  FILE *fp = fopen("/proc/sys/kernel/pid_max", "r");
  if (fp) {
    fscanf(fp, "%ld", &pid_max);
    fclose(fp);
  }
  return pid_max;
}


x86 assembly (clang, -O0):
<get_pid_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x8000,-0x8(%rbp)
lea    0xeb9(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117f <get_pid_max+0x4f>
mov    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pid_max>:
push   %rbx
sub    $0x10,%rsp
movq   $0x8000,0x8(%rsp)
lea    0xebb(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     117c <get_pid_max+0x4c>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0x8(%rsp),%rax
jmp    1181 <get_pid_max+0x51>
mov    $0x8000,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"/proc/sys/kernel/pid_max\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%ld\00"
define i64 @get_pid_max() {
%1 = alloca i64
%2 = alloca i32*
store i64 32768, i64* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32*, i32** %2
%8 = call i32 @fscanf(i32* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%9 = load i32*, i32** %2
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %0
%12 = load i64, i64* %1
ret i64 %12
}

LLVM IR (-O2):
@.str = [25 x i8] c"/proc/sys/kernel/pid_max\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%ld\00"
define i64 @get_pid_max() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 32768, i64* %1
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%7 = call i32 @fclose(i32* %3)
%8 = load i64, i64* %1
br label %9
9: ; preds = %5, %0
%10 = phi i64 [ %8, %5 ], [ 32768, %0 ]
ret i64 %10
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = 2;
  while (x >= 0) {
    x = x - y;
    y = (y + 1) / 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1159 <main+0x49>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "error info\n");
  printf("ok info\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"error info\0A\00"
@.str.1 = [9 x i8] c"ok info\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"error info\0A\00"
@str = [8 x i8] c"ok info\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int O_RDONLY;
int fcntl_O_RDONLY() { return O_RDONLY; }


x86 assembly (clang, -O0):
<fcntl_O_RDONLY>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl_O_RDONLY>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define i32 @fcntl_O_RDONLY() {
%1 = load i32, i32* @O_RDONLY
ret i32 %1
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define i32 @fcntl_O_RDONLY() {
%1 = load i32, i32* @O_RDONLY
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ TAB_Fct(char);
void IF_TABProd(void) { TAB_Fct('*'); }


x86 assembly (clang, -O0):
<IF_TABProd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1030 <TAB_Fct@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_TABProd>:
mov    $0x2a,%edi
jmp    1030 <TAB_Fct@plt>

LLVM IR (-O0):
define void @IF_TABProd() {
%1 = call i32 @TAB_Fct(i8 signext 42)
ret void
}

LLVM IR (-O2):
define void @IF_TABProd() {
%1 = tail call i32 @TAB_Fct(i8 signext 42)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_greetings(void) { printf("Hello. This is an UNPATCHED version!\n"); }


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"Hello. This is an UNPATCHED version!\0A\00"
define void @print_greetings() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Hello. This is an UNPATCHED version!\00"
define void @print_greetings() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_int_array(int a[], int num_elements) {
  int i;
  for (i = 0; i < num_elements; i++) {
    printf("%d\n", a[i]);
  }
}


x86 assembly (clang, -O0):
<print_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <print_int_array+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_int_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print_int_array+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_int_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print_int_array(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 = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_int_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned int CalcTileWidth_elt(unsigned int);
unsigned int CalcWidthInTiles_elt(unsigned int width, unsigned int bit_cnt) {
  unsigned int tsize = CalcTileWidth_elt(bit_cnt);
  return (width + tsize - 1) / tsize;
}


x86 assembly (clang, -O0):
<CalcWidthInTiles_elt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <CalcTileWidth_elt@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcWidthInTiles_elt>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <CalcTileWidth_elt@plt>
mov    %eax,%ecx
lea    (%rbx,%rcx,1),%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CalcWidthInTiles_elt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @CalcTileWidth_elt(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = add i32 %8, %9
%11 = sub i32 %10, 1
%12 = load i32, i32* %5
%13 = udiv i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @CalcWidthInTiles_elt(i32 %0, i32 %1) {
%3 = tail call i32 @CalcTileWidth_elt(i32 %1)
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = udiv i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
void skip_cmt(FILE *in) {
  int c, p;
  for (p = 0; (c = fgetc(in)) != EOF; p = c)
    if (c == '/' && p == '*')
      break;
  ungetc(' ', in);
}


x86 assembly (clang, -O0):
<skip_cmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%eax
je     1177 <skip_cmt+0x57>
cmpl   $0x2f,-0xc(%rbp)
jne    1167 <skip_cmt+0x47>
cmpl   $0x2a,-0x10(%rbp)
jne    1167 <skip_cmt+0x47>
jmp    1177 <skip_cmt+0x57>
jmp    116c <skip_cmt+0x4c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <skip_cmt+0x13>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_cmt>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %ebp,%ebp
mov    0x2eb8(%rip),%r14
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r14),%eax
je     114b <skip_cmt+0x2b>
cmp    $0x2a,%ebp
mov    %eax,%ebp
jne    1130 <skip_cmt+0x10>
mov    %eax,%ebp
cmp    $0x2f,%eax
jne    1130 <skip_cmt+0x10>
mov    $0x20,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ungetc@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_cmt(i32* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i32 [ 0, %1 ], [ %4, %7 ]
%4 = tail call i32 @fgetc(i32* %0)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = icmp eq i32 %4, 47
%9 = icmp eq i32 %3, 42
%10 = and i1 %9, %8
br i1 %10, label %11, label %2
11: ; preds = %7, %2
%12 = tail call i32 @ungetc(i8 signext 32, i32* %0)
ret void
}