xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *saisir_chaine(void) {
  char *saisie, *chaine;
  saisie = (char *)malloc(sizeof(char) * 32);
  scanf("%s", saisie);
  chaine = (char *)malloc(sizeof(char) * (strlen(saisie) + 1));
  strcpy(chaine, saisie);
  return chaine;
}


x86 assembly (clang, -O0):
<saisir_chaine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
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):
<saisir_chaine>:
push   %r14
push   %rbx
push   %rax
mov    $0x20,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
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):
@.str = [3 x i8] c"%s\00"
define i8* @saisir_chaine() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i64 @malloc(i32 32)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = mul i64 1, %10
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %2
%15 = load i8*, i8** %2
%16 = load i8*, i8** %1
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i8* @saisir_chaine() {
%1 = tail call i64 @malloc(i32 32)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @strlen(i8* %2)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strcpy(i8* %7, i8* %2)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ execute(unsigned char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void execute_cstr(const char *str) {
  execute((const unsigned char *)str, strlen(str), 0);
}


x86 assembly (clang, -O0):
<execute_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <execute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_cstr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <execute@plt>

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

LLVM IR (-O2):
define void @execute_cstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @execute(i8* %0, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int *malloc(int);
int main() {
  int *p;
  int havoc;
  p = malloc(sizeof(int));
  if (havoc) {
    *p = 0;
  } else {
    *p = 1;
  }
  assert(*p == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1156 <main+0x36>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
jmp    1160 <main+0x40>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
xor    %edi,%edi
call   1030 <assert@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* @malloc(i32 4)
store i32* %4, i32** %2
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %11
9: ; preds = %0
%10 = load i32*, i32** %2
store i32 1, i32* %10
br label %11
11: ; preds = %9, %7
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
long foo3(long a) {
  long b = a + 1;
  if (b >= 0)
    return b;
  return 1;
}


x86 assembly (clang, -O0):
<foo3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jl     112c <foo3+0x2c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <foo3+0x34>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo3>:
lea    0x1(%rdi),%rcx
cmp    $0xffffffffffffffff,%rdi
mov    $0x1,%eax
cmovge %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @foo3(i64 %0) {
%2 = icmp sgt i64 %0, -2
%3 = add nsw i64 %0, 1
%4 = select i1 %2, i64 %3, i64 1
ret i64 %4
}
int do_680() { return 680; }


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

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

LLVM IR (-O0):
define i32 @do_680() {
ret i32 680
}

LLVM IR (-O2):
define i32 @do_680() {
ret i32 680
}
void foo33() {}


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

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

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

LLVM IR (-O2):
define void @foo33() {
ret void
}
void converte(int sec, int res[]) {
  res[0] = sec % 60;
  res[1] = sec % 3600 / 60;
  res[2] = sec / (60 * 60);
}


x86 assembly (clang, -O0):
<converte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<converte>:
movslq %edi,%rax
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
mov    %edx,(%rsi)
imul   $0xffffffff91a2b3c5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xb,%ecx
add    %edx,%ecx
imul   $0xe10,%ecx,%edx
sub    %edx,%eax
movswl %ax,%edx
imul   $0xffff8889,%edx,%edx
shr    $0x10,%edx
add    %eax,%edx
movzwl %dx,%eax
movswl %ax,%edx
shr    $0xf,%eax
sar    $0x5,%edx
add    %eax,%edx
movswl %dx,%eax
mov    %eax,0x4(%rsi)
mov    %ecx,0x8(%rsi)
ret

LLVM IR (-O0):
define void @converte(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 = srem i32 %5, 60
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = srem i32 %9, 3600
%11 = sdiv i32 %10, 60
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32, i32* %3
%15 = sdiv i32 %14, 3600
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
ret void
}

LLVM IR (-O2):
define void @converte(i32 %0, i32* nocapture writeonly %1) {
%3 = srem i32 %0, 60
store i32 %3, i32* %1
%4 = srem i32 %0, 3600
%5 = trunc i32 %4 to i16
%6 = sdiv i16 %5, 60
%7 = sext i16 %6 to i32
%8 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %7, i32* %8
%9 = sdiv i32 %0, 3600
%10 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %9, i32* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ isatty(int /*<<< orphan*/);
unsigned int getttywidth(void) {
  unsigned int width = 0;
  if (!isatty(STDOUT_FILENO))
    return 0;
  return width == 0 ? 80 : width;
}


x86 assembly (clang, -O0):
<getttywidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
call   1030 <isatty@plt>
cmp    $0x0,%eax
jne    1142 <getttywidth+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1165 <getttywidth+0x55>
cmpl   $0x0,-0x8(%rbp)
jne    1159 <getttywidth+0x49>
mov    $0x50,%eax
mov    %eax,-0xc(%rbp)
jmp    115f <getttywidth+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getttywidth>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
call   1030 <isatty@plt>
test   %eax,%eax
mov    $0x50,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define i32 @getttywidth() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @isatty(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %0
store i32 0, i32* %1
br label %15
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %7
br label %13
11: ; preds = %7
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %10
%14 = phi i32 [ 80, %10 ], [ %12, %11 ]
store i32 %14, i32* %1
br label %15
15: ; preds = %13, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define i32 @getttywidth() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @isatty(i32 %1)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 80
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void recurse(unsigned int i) {
  printf("%d\n", i);
  if (i < 10)
    recurse(i + 1);
  printf("%d\n", i);
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0xa,-0x4(%rbp)
jae    114f <recurse+0x2f>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <recurse@plt>
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
cmp    $0x9,%ebx
ja     113e <recurse+0x1e>
lea    0x1(%rbx),%edi
call   1030 <recurse@plt>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @recurse(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp ult i32 %0, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nuw nsw i32 %0, 1
tail call void @recurse(i32 %5)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
long UINT_TO_LINT(unsigned short var) {
  long newvar;
  newvar = (long)var;
  return newvar;
}


x86 assembly (clang, -O0):
<UINT_TO_LINT>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @UINT_TO_LINT(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @UINT_TO_LINT(i16 zeroext %0) {
%2 = zext i16 %0 to i64
ret i64 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t grid_getl(const uint8_t *buf) {
  return (((uint32_t)buf[0]) << 24) | (((uint32_t)buf[1]) << 16) |
         (((uint32_t)buf[2]) << 8) | ((uint32_t)buf[3]);
}


x86 assembly (clang, -O0):
<grid_getl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_getl>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @grid_getl(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
short int CiHwRead(unsigned char chan, short int offset, unsigned char *val) {
  return -8;
}


x86 assembly (clang, -O0):
<CiHwRead>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0xfff8,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<CiHwRead>:
mov    $0xfff8,%ax
ret

LLVM IR (-O0):
define signext i16 @CiHwRead(i8 zeroext %0, i16 signext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i16
%6 = alloca i8*
store i8 %0, i8* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
ret i16 -8
}

LLVM IR (-O2):
define signext i16 @CiHwRead(i8 zeroext %0, i16 signext %1, i8* nocapture readnone %2) {
ret i16 -8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long next_octagonal_num();
void next_octagonal_num_test(void) {
  long num = 0;
  for (size_t i = 0; i < 10; i++)
    num = next_octagonal_num();
  assert(num == 280);
}


x86 assembly (clang, -O0):
<next_octagonal_num_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xa,-0x10(%rbp)
jae    115f <next_octagonal_num_test+0x3f>
mov    $0x0,%al
call   1040 <next_octagonal_num@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <next_octagonal_num_test+0x18>
cmpq   $0x118,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_octagonal_num_test>:
push   %rax
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %eax,%eax
call   1040 <next_octagonal_num@plt>
xor    %edi,%edi
cmp    $0x118,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @next_octagonal_num_test() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
br label %3
3: ; preds = %8, %0
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i64 (...) @next_octagonal_num()
store i64 %7, i64* %1
br label %8
8: ; preds = %6
%9 = load i64, i64* %2
%10 = add i64 %9, 1
store i64 %10, i64* %2
br label %3
11: ; preds = %3
%12 = load i64, i64* %1
%13 = icmp eq i64 %12, 280
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
define void @next_octagonal_num_test() {
%1 = tail call i64 (...) @next_octagonal_num()
%2 = tail call i64 (...) @next_octagonal_num()
%3 = tail call i64 (...) @next_octagonal_num()
%4 = tail call i64 (...) @next_octagonal_num()
%5 = tail call i64 (...) @next_octagonal_num()
%6 = tail call i64 (...) @next_octagonal_num()
%7 = tail call i64 (...) @next_octagonal_num()
%8 = tail call i64 (...) @next_octagonal_num()
%9 = tail call i64 (...) @next_octagonal_num()
%10 = tail call i64 (...) @next_octagonal_num()
%11 = icmp eq i64 %10, 280
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void stdout_putf(void *unused, char c) {
  (void)(unused);
  putchar(c);
}


x86 assembly (clang, -O0):
<stdout_putf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdout_putf>:
mov    %esi,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @stdout_putf(i8* nocapture readnone %0, i8 signext %1) {
%3 = tail call i32 @putchar(i8 signext %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int read32(void *);
int /*<<< orphan*/ write32(void *, int);
void setbits32(uint32_t bits, void *addr) {
  write32(addr, read32(addr) | bits);
}


x86 assembly (clang, -O0):
<setbits32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <read32@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
or     -0x4(%rbp),%esi
call   1030 <write32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <read32@plt>
or     %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write32@plt>

LLVM IR (-O0):
define void @setbits32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @read32(i8* %6)
%8 = load i32, i32* %3
%9 = or i32 %7, %8
%10 = call i32 @write32(i8* %5, i32 %9)
ret void
}

LLVM IR (-O2):
define void @setbits32(i32 %0, i8* %1) {
%3 = tail call i32 @read32(i8* %1)
%4 = or i32 %3, %0
%5 = tail call i32 @write32(i8* %1, i32 %4)
ret void
}
void X509_REQ_INFO_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_INFO_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbgprintf(char *, char const *);
int /*<<< orphan*/ find_expr_end(char const *);
scalar_t__ skip_space(int /*<<< orphan*/);
char *next_expr(const char *e) {
  dbgprintf("next_expr: %s\n", e);
  return (char *)(skip_space(find_expr_end(e)));
}


x86 assembly (clang, -O0):
<next_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1050 <dbgprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <find_expr_end@plt>
mov    %eax,%edi
call   1030 <skip_space@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_expr>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1050 <dbgprintf@plt>
mov    %rbx,%rdi
call   1040 <find_expr_end@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <skip_space@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"next_expr: %s\0A\00"
define i8* @next_expr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @dbgprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @find_expr_end(i8* %5)
%7 = call i64 @skip_space(i32 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"next_expr: %s\0A\00"
define i8* @next_expr(i8* %0) {
%2 = tail call i32 @dbgprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @find_expr_end(i8* %0)
%4 = tail call i64 @skip_space(i32 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: "
                  "sg_prevent [--allow] [--help] [--prevent=PC] [--verbose] "
                  "[--version]\n"
                  "                  DEVICE\n"
                  "  where:\n"
                  "    --allow|-a            allow media removal\n"
                  "    --help|-h             print usage message then exit\n"
                  "    --prevent=PC|-p PC    prevent code value (def: 1 -> "
                  "prevent)\n"
                  "                            0 -> allow, 1 -> prevent\n"
                  "                            2 -> persistent allow, 3 -> "
                  "persistent prevent\n"
                  "    --verbose|-v          increase verbosity\n"
                  "    --version|-V          print version string and exit\n\n"
                  "Performs a SCSI PREVENT ALLOW MEDIUM REMOVAL command\n");
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [561 x i8] c"Usage: sg_prevent [--allow] [--help] [--prevent=PC] [--verbose] [--version]\0A DEVICE\0A where:\0A --allow|-a allow media removal\0A --help|-h print usage message then exit\0A --prevent=PC|-p PC prevent code value (def: 1 -> prevent)\0A 0 -> allow, 1 -> prevent\0A 2 -> persistent allow, 3 -> persistent prevent\0A --verbose|-v increase verbosity\0A --version|-V print version string and exit\0A\0APerforms a SCSI PREVENT ALLOW MEDIUM REMOVAL command\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([561 x i8], [561 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [561 x i8] c"Usage: sg_prevent [--allow] [--help] [--prevent=PC] [--verbose] [--version]\0A DEVICE\0A where:\0A --allow|-a allow media removal\0A --help|-h print usage message then exit\0A --prevent=PC|-p PC prevent code value (def: 1 -> prevent)\0A 0 -> allow, 1 -> prevent\0A 2 -> persistent allow, 3 -> persistent prevent\0A --verbose|-v increase verbosity\0A --version|-V print version string and exit\0A\0APerforms a SCSI PREVENT ALLOW MEDIUM REMOVAL command\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([561 x i8], [561 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mapper190_Sync();
void Mapper190_Restore(int version) { Mapper190_Sync(); }


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

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

LLVM IR (-O0):
define void @Mapper190_Restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Mapper190_Sync()
ret void
}

LLVM IR (-O2):
define void @Mapper190_Restore(i32 %0) {
%2 = tail call i32 (...) @Mapper190_Sync()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) add_constraint(unsigned char is_a) {
  if (is_a)
    abort();
}


x86 assembly (clang, -O0):
<add_constraint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     112f <add_constraint+0x1f>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_constraint>:
test   %edi,%edi
jne    1115 <add_constraint+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @add_constraint(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @add_constraint(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_pages(int);
void switch_pages(void) { do_pages(1); }


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

x86 assembly (clang, -O2):
<switch_pages>:
mov    $0x1,%edi
jmp    1030 <do_pages@plt>

LLVM IR (-O0):
define void @switch_pages() {
%1 = call i32 @do_pages(i32 1)
ret void
}

LLVM IR (-O2):
define void @switch_pages() {
%1 = tail call i32 @do_pages(i32 1)
ret void
}
void foo452() {}


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

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

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

LLVM IR (-O2):
define void @foo452() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
time_t posix_stat_st_mtime(const struct stat *st) { return st->st_mtime; }


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

x86 assembly (clang, -O2):
<posix_stat_st_mtime>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @posix_stat_st_mtime(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
%4 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @posix_stat_st_mtime(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
int de_feat_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @de_feat_init() {
ret i32 0
}
/* Variables and functions */
size_t index_bounds(scalar_t__, int, size_t);
scalar_t__ strlen(char const *);
size_t str_index_bounds(const char *str, int is_terminator_out_of_bounds,
                        size_t index) {
  return index_bounds(strlen(str) + 1, is_terminator_out_of_bounds, index);
}


x86 assembly (clang, -O0):
<str_index_bounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <index_bounds@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_index_bounds>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <strlen@plt>
lea    0x1(%rax),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <index_bounds@plt>

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

LLVM IR (-O2):
define i64 @str_index_bounds(i8* nocapture %0, i32 %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @index_bounds(i64 %5, i32 %1, i64 %2)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void starBar() { puts("********************************"); }


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

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

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

LLVM IR (-O2):
@.str = [33 x i8] c"********************************\00"
define void @starBar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_printf(char *);
int /*<<< orphan*/ itoa(char *, unsigned int, int);
void io_print_u(unsigned int u) {
  char num[16];
  itoa(num, u, 10);
  io_printf(num);
}


x86 assembly (clang, -O0):
<io_print_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    $0xa,%edx
call   1040 <itoa@plt>
lea    -0x20(%rbp),%rdi
call   1030 <io_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_print_u>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <itoa@plt>
mov    %rbx,%rdi
call   1030 <io_printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @io_print_u(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @itoa(i8* %4, i32 %5, i32 10)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @io_printf(i8* %7)
ret void
}

LLVM IR (-O2):
define void @io_print_u(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @itoa(i8* %3, i32 %0, i32 10)
%5 = call i32 @io_printf(i8* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t min64(int64_t a, int64_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<min64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min64(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 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_matrix(void **pointer, int row) {
  int loop;
  for (loop = row - 1; loop >= 0; loop--) {
    free(pointer[loop]);
  }
  free(pointer);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1151 <free_matrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <free_matrix+0x18>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <free_matrix+0x36>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <free_matrix+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(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 i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i8**, i8*** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = bitcast i8* %16 to i8**
%18 = call i32 @free(i8** %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 %8
22: ; preds = %8
%23 = load i8**, i8*** %3
%24 = call i32 @free(i8** %23)
ret void
}

LLVM IR (-O2):
define void @free_matrix(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = bitcast i8** %10 to i8***
%12 = load i8**, i8*** %11
%13 = tail call i32 @free(i8** %12)
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %2
%16 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __environ;
int __execvpe(char const *, char *const *, int /*<<< orphan*/);
int execvp(const char *file, char *const argv[]) {
  return __execvpe(file, argv, __environ);
}


x86 assembly (clang, -O0):
<execvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
call   1030 <__execvpe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execvp>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <__execvpe@plt>

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

LLVM IR (-O2):
@__environ = global i32 0
define i32 @execvp(i8* %0, i8** %1) {
%3 = load i32, i32* @__environ
%4 = tail call i32 @__execvpe(i8* %0, i8** %1, i32 %3)
ret i32 %4
}
int cdops_read_sectors_pio(char *buf, int sec, int num) {
  struct {
    int sec, num;
    void *buffer;
    int dunno;
  } param;
  param.sec = sec;
  param.num = num;
  param.buffer = buf;
  param.dunno = 0;
  return cdops_exec_cmd(16, &param);
}


x86 assembly (clang, -O0):
<cdops_read_sectors_pio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x10,%edi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1030 <cdops_exec_cmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdops_read_sectors_pio>:
sub    $0x18,%rsp
mov    %esi,(%rsp)
mov    %edx,0x4(%rsp)
mov    %rdi,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x10,%edi
xor    %eax,%eax
call   1030 <cdops_exec_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i32, i32, i8*, i32 }
define i32 @cdops_read_sectors_pio(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.anon
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %6
%11 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 1
store i32 %10, i32* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 2
store i8* %12, i8** %13
%14 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 3
store i32 0, i32* %14
%15 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 16, %struct.anon* %7)
ret i32 %15
}

LLVM IR (-O2):
%struct.anon = type { i32, i32, i8*, i32 }
define i32 @cdops_read_sectors_pio(i8* %0, i32 %1, i32 %2) {
%4 = alloca %struct.anon
%5 = bitcast %struct.anon* %4 to i8*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 1
store i32 %2, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 2
store i8* %0, i8** %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 3
store i32 0, i32* %9
%10 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 16, %struct.anon* %4)
ret i32 %10
}
void onintr(signo) int signo;
{ done(1); }


x86 assembly (clang, -O0):
<onintr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <done@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onintr>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <done@plt>

LLVM IR (-O0):
define void @onintr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @done to i32 (i32, ...)*)(i32 1)
ret void
}

LLVM IR (-O2):
define void @onintr(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @done to i32 (i32, ...)*)(i32 1)
ret void
}
/* Variables and functions */
int EINVAL;
void *spx_alloc(int, size_t const, int *);
void *spx_object_new_alone(const size_t s, int *err) {
  if (0 == s) {
    *err = EINVAL;
    return NULL;
  }
  return spx_alloc(1, s, err);
}


x86 assembly (clang, -O0):
<spx_object_new_alone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1148 <spx_object_new_alone+0x38>
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
jmp    115e <spx_object_new_alone+0x4e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%edi
call   1030 <spx_alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spx_object_new_alone>:
mov    %rsi,%rdx
test   %rdi,%rdi
je     1125 <spx_object_new_alone+0x15>
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <spx_alloc@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i8* @spx_object_new_alone(i64 %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %4
store i32* %1, i32** %5
%6 = load i64, i64* %4
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = load i32*, i32** %5
store i32 %9, i32* %10
store i8* null, i8** %3
br label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i32*, i32** %5
%14 = call i8* @spx_alloc(i32 1, i64 %12, i32* %13)
store i8* %14, i8** %3
br label %15
15: ; preds = %11, %8
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i8* @spx_object_new_alone(i64 %0, i32* %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EINVAL
store i32 %5, i32* %1
br label %8
6: ; preds = %2
%7 = tail call i8* @spx_alloc(i32 1, i64 %0, i32* %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ null, %4 ], [ %7, %6 ]
ret i8* %9
}
float max(float a, float b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <max+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <max+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fucom() {
  db(0xDD);
  db(0xE1);
}


x86 assembly (clang, -O0):
<fucom>:
push   %rbp
mov    %rsp,%rbp
mov    $0xdd,%edi
call   1030 <db@plt>
mov    $0xe1,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fucom>:
push   %rax
mov    $0xdd,%edi
call   1030 <db@plt>
mov    $0xe1,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fucom() {
%1 = call i32 @db(i32 221)
%2 = call i32 @db(i32 225)
ret void
}

LLVM IR (-O2):
define void @fucom() {
%1 = tail call i32 @db(i32 221)
%2 = tail call i32 @db(i32 225)
ret void
}
/* Variables and functions */
void *__getMemory(int);
void *my_malloc(int size) { return __getMemory(size); }


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__getMemory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
jmp    1030 <__getMemory@plt>

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

LLVM IR (-O2):
define i8* @my_malloc(i32 %0) {
%2 = tail call i8* @__getMemory(i32 %0)
ret i8* %2
}
/* Variables and functions */
void *malloc(size_t);
void *ALmodulatorState_New(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ALmodulatorState_New>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ALmodulatorState_New(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  int a, b, p, q;
  a = 1;
  p = ((a++) - (a++));
  printf("a=%d, p=%d\n", a, p);
  b = 1;
  q = ((++b) - (++b));
  printf("b=%d, q=%d\n", b, q);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"a=%d, p=%d\0A\00"
@.str.1 = [12 x i8] c"b=%d, q=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
%13 = sub nsw i32 %9, %11
store i32 %13, i32* %7
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
store i32 1, i32* %6
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
%21 = sub nsw i32 %18, %20
store i32 %21, i32* %8
%22 = load i32, i32* %6
%23 = load i32, i32* %8
%24 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"a=%d, p=%d\0A\00"
@.str.1 = [12 x i8] c"b=%d, q=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 3, i32 -1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 -1)
ret i32 0
}