xunge/DecIR huggingface dataset:
int LZ4_versionNumber(void) { return (1 * 100 * 100 + 8 * 100 + 1); }


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

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

LLVM IR (-O0):
define i32 @LZ4_versionNumber() {
ret i32 10801
}

LLVM IR (-O2):
define i32 @LZ4_versionNumber() {
ret i32 10801
}
int main() {
  int *arr;
  arr = (int[]){1, func(), func()};
  return arr[0] + arr[1] + arr[2] + func();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x10(%rbp),%rcx
add    0x8(%rcx),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <func@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <func@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <func@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1030 <func@plt>
add    %ebx,%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [3 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 1, i32* %4
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = call i32 (...) @func()
store i32 %6, i32* %5
%7 = getelementptr inbounds i32, i32* %5, i64 1
%8 = call i32 (...) @func()
store i32 %8, i32* %7
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32* %9, i32** %2
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = add nsw i32 %12, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = load i32, i32* %18
%20 = add nsw i32 %16, %19
%21 = call i32 (...) @func()
%22 = add nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
%2 = tail call i32 (...) @func()
%3 = add nsw i32 %1, 1
%4 = add nsw i32 %3, %2
%5 = tail call i32 (...) @func()
%6 = add nsw i32 %4, %5
ret i32 %6
}
char *AAS_ModelFromIndex(int index) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @AAS_ModelFromIndex(i32 %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ stdout;
char get_char() {
  char c;
  fflush(stdout);
  c = getchar();
  if (c != '\n')
    while (getchar() != '\n')
      ;
  return c;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     116f <get_char+0x4f>
jmp    1152 <get_char+0x32>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     116a <get_char+0x4a>
jmp    1152 <get_char+0x32>
jmp    116f <get_char+0x4f>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ebx
cmp    $0xa,%al
je     114b <get_char+0x2b>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1140 <get_char+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define signext i8 @get_char() {
%1 = alloca i8
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %15
8: ; preds = %0
br label %9
9: ; preds = %13, %8
%10 = call signext i8 (...) @getchar()
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
br label %15
15: ; preds = %14, %0
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
@stdout = global i32 0
define signext i8 @get_char() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, 10
br i1 %4, label %8, label %5
5: ; preds = %0, %5
%6 = tail call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %5
8: ; preds = %5, %0
ret i8 %3
}
/* Variables and functions */
char *smalloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *sstrdup(const char *str) {
  char *new;
  size_t s = strlen(str);
  new = smalloc(s + 1);
  strcpy(new, str);
  return new;
}


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

x86 assembly (clang, -O2):
<sstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <smalloc@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* @sstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = add i64 %7, 1
%9 = call i8* @smalloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @sstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @smalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main(void) { return !test(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, char const *, struct timespec const *, int);
int uv__utimesat(int dirfd, const char *path, const struct timespec times[2],
                 int flags) {
  return syscall(280, dirfd, path, times, flags);
}


x86 assembly (clang, -O0):
<uv__utimesat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x118,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__utimesat>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x118,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @uv__utimesat(i32 %0, i8* %1, %struct.timespec* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.timespec*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.timespec* %2, %struct.timespec** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load %struct.timespec*, %struct.timespec** %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 280, i32 %9, i8* %10, %struct.timespec* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @uv__utimesat(i32 %0, i8* %1, %struct.timespec* %2, i32 %3) {
%5 = tail call i32 @syscall(i32 280, i32 %0, i8* %1, %struct.timespec* %2, i32 %3)
ret i32 %5
}
void test1(short n, int *x) {
  short i;
  for (i = 0; i < n; i++)
    x[i] = 0;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    1146 <test1+0x46>
mov    -0x10(%rbp),%rax
movswq -0x12(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1115 <test1+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %di,%di
jle    112b <test1+0x1b>
push   %rax
movzwl %di,%edx
shl    $0x2,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @test1(i16 signext %0, i32* nocapture writeonly %1) {
%3 = icmp sgt i16 %0, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %1 to i8*
%6 = zext i16 %0 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
int verify_benchmark(int r) {
  int expected = 1207487004;
  if (r != expected)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x47f8ca1c,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0x47f8ca1c,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 1207487004
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void reverb_free(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @reverb_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_29int32_reg(int val) { return ((val) & (0x29 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_29int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x29,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_29int32_reg>:
test   $0x29,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_29int32_reg(i32 %0) {
%2 = and i32 %0, 41
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void mystery1(char *s1, const char *s2) {
  while (*s1 != '\0') {
    s1++;
  }
  for (; *s1 = *s2; s1++, s2++) {
    ;
  }
}


x86 assembly (clang, -O0):
<mystery1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <mystery1+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystery1+0xc>
jmp    1132 <mystery1+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1168 <mystery1+0x68>
jmp    114b <mystery1+0x4b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <mystery1+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystery1>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <mystery1>
mov    (%rsi),%al
mov    %al,-0x1(%rdi)
test   %al,%al
je     1130 <mystery1+0x30>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <mystery1+0x20>
ret

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

LLVM IR (-O2):
define void @mystery1(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %15, %11 ], [ %1, %8 ]
%13 = phi i8* [ %14, %11 ], [ %4, %8 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int acquire_seed(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int acquire_and_print_seed(FILE *fp, char *seed_from_argument) {
  int seed = acquire_seed(seed_from_argument);
  fprintf(fp, "seed: %d\n", seed);
  return seed;
}


x86 assembly (clang, -O0):
<acquire_and_print_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <acquire_seed@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acquire_and_print_seed>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <acquire_seed@plt>
mov    %eax,%ebp
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"seed: %d\0A\00"
define i32 @acquire_and_print_seed(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @acquire_seed(i8* %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %5
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
@.str = [10 x i8] c"seed: %d\0A\00"
define i32 @acquire_and_print_seed(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @acquire_seed(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ do_exit();
int do_init();
int main(void) {
  int rc;
  rc = do_init();
  if (rc == 0)
    do_exit();
  return rc;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <do_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114a <main+0x2a>
mov    $0x0,%al
call   1030 <do_exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <do_init@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1135 <main+0x15>
xor    %eax,%eax
call   1030 <do_exit@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @do_init()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @do_exit()
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @do_exit()
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Type definitions */
struct TCP_segment {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tcpfrag_delete(struct TCP_segment **);
void tcpfrag_delete_all(struct TCP_segment **r_frag) {
  while (*r_frag)
    tcpfrag_delete(r_frag);
}


x86 assembly (clang, -O0):
<tcpfrag_delete_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1138 <tcpfrag_delete_all+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <tcpfrag_delete@plt>
jmp    111c <tcpfrag_delete_all+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpfrag_delete_all>:
push   %rbx
cmpq   $0x0,(%rdi)
je     112e <tcpfrag_delete_all+0x1e>
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <tcpfrag_delete@plt>
cmpq   $0x0,(%rbx)
jne    1120 <tcpfrag_delete_all+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.TCP_segment = type { i32 }
define void @tcpfrag_delete_all(%struct.TCP_segment** %0) {
%2 = alloca %struct.TCP_segment**
store %struct.TCP_segment** %0, %struct.TCP_segment*** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.TCP_segment**, %struct.TCP_segment*** %2
%5 = load %struct.TCP_segment*, %struct.TCP_segment** %4
%6 = icmp ne %struct.TCP_segment* %5, null
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load %struct.TCP_segment**, %struct.TCP_segment*** %2
%9 = call i32 @tcpfrag_delete(%struct.TCP_segment** %8)
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.TCP_segment = type { i32 }
define void @tcpfrag_delete_all(%struct.TCP_segment** %0) {
%2 = load %struct.TCP_segment*, %struct.TCP_segment** %0
%3 = icmp eq %struct.TCP_segment* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 @tcpfrag_delete(%struct.TCP_segment** %0)
%6 = load %struct.TCP_segment*, %struct.TCP_segment** %0
%7 = icmp eq %struct.TCP_segment* %6, null
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int StatCovMomentFloat(float *, float *, int, int, int, int);
double StatCovnFloat(float a[], float b[], int n, int s) {
  return StatCovMomentFloat(a, b, n, s, 1, 1) / n;
}


x86 assembly (clang, -O0):
<StatCovnFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <StatCovMomentFloat@plt>
cltd
idivl  -0x14(%rbp)
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatCovnFloat>:
push   %rbx
mov    %edx,%ebx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <StatCovMomentFloat@plt>
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

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

LLVM IR (-O2):
define double @StatCovnFloat(float* %0, float* %1, i32 %2, i32 %3) {
%5 = tail call i32 @StatCovMomentFloat(float* %0, float* %1, i32 %2, i32 %3, i32 1, i32 1)
%6 = sdiv i32 %5, %2
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xe6() {
  Assert_real((isupper(230) == 0),
              "/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_isupper.c",
              1155, ("isupper should be 0 for 0xe6"));
}


x86 assembly (clang, -O0):
<t_isupper_0xe6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe6,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x483,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xe6>:
push   %rax
mov    $0xe6,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x483,%edx
pop    %rax
jmp    1040 <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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe6\00"
define void @t_isupper_0xe6() {
%1 = call i64 @isupper(i32 230)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1155, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe6\00"
define void @t_isupper_0xe6() {
%1 = tail call i64 @isupper(i32 230)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void end_rtf_document() { printf("}\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"}\00"
define void @end_rtf_document() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void memoryAllocationCheck(void *pointer) {
  if (pointer == NULL) {
    fprintf(stderr, "Memory allocation error.");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<memoryAllocationCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115a <memoryAllocationCheck+0x3a>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memoryAllocationCheck>:
test   %rdi,%rdi
je     1126 <memoryAllocationCheck+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Memory allocation error.\00"
@EXIT_FAILURE = global i32 0
define void @memoryAllocationCheck(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Memory allocation error.\00"
@EXIT_FAILURE = global i32 0
define void @memoryAllocationCheck(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char word;
  scanf("%c", &word);
  printf("%c", 'z' - (word - 'a'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
lea    0xeac(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0xf(%rsp),%al
movsbl %al,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 97
%7 = sub nsw i32 122, %6
%8 = trunc i32 %7 to i8
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
double abs(double x) {
  if (x < 0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <abs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <abs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @abs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int is_any_bit_equals_0(int);
int is_any_bit_of_first_byte_equals_0(int x) {
  int offset = (sizeof(int) - 1) << 3;
  int mask = -1 << offset;
  return is_any_bit_equals_0(x | ~mask);
}


x86 assembly (clang, -O0):
<is_any_bit_of_first_byte_equals_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
or     %eax,%edi
call   1030 <is_any_bit_equals_0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_any_bit_of_first_byte_equals_0>:
or     $0xffffff,%edi
jmp    1030 <is_any_bit_equals_0@plt>

LLVM IR (-O0):
define i32 @is_any_bit_of_first_byte_equals_0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 24, i32* %3
%5 = load i32, i32* %3
%6 = shl i32 -1, %5
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = or i32 %7, %9
%11 = call i32 @is_any_bit_equals_0(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_any_bit_of_first_byte_equals_0(i32 %0) {
%2 = or i32 %0, 16777215
%3 = tail call i32 @is_any_bit_equals_0(i32 %2)
ret i32 %3
}
void util_dispose_split(char **argv) {
  if (!argv)
    return;
  if (argv[0])
    free(argv[0]);
  free(argv);
}


x86 assembly (clang, -O0):
<util_dispose_split>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <util_dispose_split+0x1c>
jmp    114f <util_dispose_split+0x3f>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1146 <util_dispose_split+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_dispose_split>:
test   %rdi,%rdi
je     112f <util_dispose_split+0x1f>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1126 <util_dispose_split+0x16>
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @util_dispose_split(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %3
tail call void @free(i8* %4)
br label %7
7: ; preds = %6, %3
%8 = bitcast i8** %0 to i8*
tail call void @free(i8* %8)
br label %9
9: ; preds = %1, %7
ret void
}
void avpriv_h264_has_num_reorder_frames() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_h264_has_num_reorder_frames() {
ret void
}
void g(int x, int *y) { *y = *y + x; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
add    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @g(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32*, i32** %4
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @g(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, %0
store i32 %4, i32* %1
ret void
}
void RTMemEfFreeNP(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemEfFreeNP() {
ret void
}
void swap(int arr[], int pos1, int pos2) {
  int tmp;
  tmp = arr[pos1];
  arr[pos1] = arr[pos2];
  arr[pos2] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int main(argc, argv)
int argc;
char *argv[];
{
  char *pn;
  if ((pn = (char *)strrchr(argv[0], '/')))
    pn++;
  else
    pn = argv[0];
  (void)printf("%s ... %s\n", pn, "this test does not run on this dialect.");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1166 <main+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1171 <main+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe84(%rip),%rdi
lea    0xe88(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rsi),%rbx
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rsi
test   %rax,%rax
cmove  %rbx,%rsi
lea    0xebd(%rip),%rdi
lea    0xec1(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s ... %s\0A\00"
@.str.1 = [40 x i8] c"this test does not run on this dialect.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i8* @strrchr(i8* %9, i32 47)
store i8* %10, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %6
br label %19
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
store i8* %18, i8** %6
br label %19
19: ; preds = %15, %12
%20 = load i8*, i8** %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s ... %s\0A\00"
@.str.1 = [40 x i8] c"this test does not run on this dialect.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %3, i32 47)
%5 = icmp eq i8* %4, null
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = select i1 %5, i8* %3, i8* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int va_demo(int, int, int, int, int, int);
int main(void) {
  printf("sum == %d\n", va_demo(5, 1, 2, 3, 4, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%r9d
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %r9d,%edi
call   1040 <va_demo@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
call   1040 <va_demo@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"sum == %d\0A\00"
define i32 @main() {
%1 = tail call i32 @va_demo(i32 5, i32 1, i32 2, i32 3, i32 4, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void abort_me(void) {
  int i;
  int j;
  char *foo = (char *)0;
  fflush(stdout);
  fflush(stderr);
  j = 0;
  i = 1 / j;
  *foo = 'a';
  exit(13);
}


x86 assembly (clang, -O0):
<abort_me>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
mov    $0xd,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<abort_me>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
define void @abort_me() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i8* null, i8** %3
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
store i32 0, i32* %2
%8 = load i32, i32* %2
%9 = sdiv i32 1, %8
store i32 %9, i32* %1
%10 = load i8*, i8** %3
store i8 97, i8* %10
%11 = call i32 @exit(i32 13)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
define void @abort_me() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
unreachable
}
/* Variables and functions */
char *itoa(int, int);
int main(void) {
  int value;
  char *num = itoa(132, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x84,%edi
mov    $0xa,%esi
call   1030 <itoa@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x84,%edi
mov    $0xa,%esi
call   1030 <itoa@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @itoa(i32 132, i32 10)
store i8* %4, i8** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @itoa(i32 132, i32 10)
ret i32 0
}
/* Variables and functions */
long double expd(long double);
long double alogd(long double x) { return expd(x); }


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

x86 assembly (clang, -O2):
<alogd>:
jmp    1030 <expd@plt>

LLVM IR (-O0):
define x86_fp80 @alogd(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 @expd(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @alogd(x86_fp80 %0) {
%2 = tail call x86_fp80 @expd(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ K_terminate();
int /*<<< orphan*/ atomic(int);
int terminate() {
  atomic(1);
  K_terminate();
  atomic(0);
  return 0;
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <atomic@plt>
mov    $0x0,%al
call   1030 <K_terminate@plt>
xor    %edi,%edi
call   1040 <atomic@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate>:
push   %rax
mov    $0x1,%edi
call   1040 <atomic@plt>
xor    %eax,%eax
call   1030 <K_terminate@plt>
xor    %edi,%edi
call   1040 <atomic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @terminate() {
%1 = call i32 @atomic(i32 1)
%2 = call i32 (...) @K_terminate()
%3 = call i32 @atomic(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @terminate() {
%1 = tail call i32 @atomic(i32 1)
%2 = tail call i32 (...) @K_terminate()
%3 = tail call i32 @atomic(i32 0)
ret i32 0
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
struct list_node *print_and_reverse(struct list_node *);
void print_twice(struct list_node *head) {
  print_and_reverse(print_and_reverse(head));
}


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

x86 assembly (clang, -O2):
<print_twice>:
push   %rax
call   1030 <print_and_reverse@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <print_and_reverse@plt>

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

LLVM IR (-O2):
%struct.list_node = type { i32 }
define void @print_twice(%struct.list_node* %0) {
%2 = tail call %struct.list_node* @print_and_reverse(%struct.list_node* %0)
%3 = tail call %struct.list_node* @print_and_reverse(%struct.list_node* %2)
ret void
}
int test_imm_77int16_reg(short val) {
  return ((val) & (0x77 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_77int16_reg>:
test   $0x77,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_77int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 119
%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_77int16_reg(i16 signext %0) {
%2 = and i16 %0, 119
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}