xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ is_empty();
char pop();
int /*<<< orphan*/ push(char);
int /*<<< orphan*/ putchar(char);
int main(void) {
  push('a');
  push('b');
  push('c');
  while (!is_empty())
    putchar(pop());
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1060 <push@plt>
mov    $0x62,%edi
call   1060 <push@plt>
mov    $0x63,%edi
call   1060 <push@plt>
mov    $0x0,%al
call   1040 <is_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1189 <main+0x49>
jmp    119d <main+0x5d>
mov    $0x0,%al
call   1050 <pop@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    116d <main+0x2d>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1060 <push@plt>
mov    $0x62,%edi
call   1060 <push@plt>
mov    $0x63,%edi
call   1060 <push@plt>
nop
xor    %eax,%eax
call   1040 <is_empty@plt>
test   %eax,%eax
jne    117c <main+0x3c>
xor    %eax,%eax
call   1050 <pop@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @push(i8 signext 97)
%3 = call i32 @push(i8 signext 98)
%4 = call i32 @push(i8 signext 99)
br label %5
5: ; preds = %9, %0
%6 = call i32 (...) @is_empty()
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = call signext i8 (...) @pop()
%11 = call i32 @putchar(i8 signext %10)
br label %5
12: ; preds = %5
%13 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @push(i8 signext 97)
%2 = tail call i32 @push(i8 signext 98)
%3 = tail call i32 @push(i8 signext 99)
%4 = tail call i32 (...) @is_empty()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = tail call signext i8 (...) @pop()
%8 = tail call i32 @putchar(i8 signext %7)
%9 = tail call i32 (...) @is_empty()
%10 = icmp eq i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %0
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void debugpins_fsm_toggle() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_fsm_toggle() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite_err(void const *, int, int, int /*<<< orphan*/ *);
void toasim_write_64(const char *fname, const void *val, FILE *file) {
  uint32_t sz = 8;
  fwrite_err(fname, 4, 1, file);
  fwrite_err(&sz, 4, 1, file);
  fwrite_err(val, sz, 1, file);
}


x86 assembly (clang, -O0):
<toasim_write_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x8,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite_err@plt>
lea    -0x1c(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite_err@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite_err@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toasim_write_64>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
movl   $0x8,0x4(%rsp)
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite_err@plt>
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite_err@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite_err@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @toasim_write_64(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
store i32 8, i32* %7
%8 = load i8*, i8** %4
%9 = load i32*, i32** %6
%10 = call i32 @fwrite_err(i8* %8, i32 4, i32 1, i32* %9)
%11 = bitcast i32* %7 to i8*
%12 = load i32*, i32** %6
%13 = call i32 @fwrite_err(i8* %11, i32 4, i32 1, i32* %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = load i32*, i32** %6
%17 = call i32 @fwrite_err(i8* %14, i32 %15, i32 1, i32* %16)
ret void
}

LLVM IR (-O2):
define void @toasim_write_64(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 8, i32* %4
%6 = tail call i32 @fwrite_err(i8* %0, i32 4, i32 1, i32* %2)
%7 = call i32 @fwrite_err(i8* %5, i32 4, i32 1, i32* %2)
%8 = load i32, i32* %4
%9 = call i32 @fwrite_err(i8* %1, i32 %8, i32 1, i32* %2)
ret void
}
regx0imm1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cmp    $0x21,%eax
jg     1140 <regx0imm1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <regx0imm1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0imm1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpw   $0x22,(%r8,%rcx,2)
setl   %al
ret

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

LLVM IR (-O2):
define i32 @regx0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = icmp slt i16 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void printFile(FILE **fp, const char *str) {
  if (1 == 1) {
    fprintf(*fp, "file:%s ", str);
  } else {
  }
}


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

x86 assembly (clang, -O2):
<printFile>:
mov    %rsi,%rdx
mov    (%rdi),%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"file:%s \00"
define void @printFile(i32** nocapture %0, i8* %1) {
%3 = load i32*, i32** %0
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int write(int, unsigned char *, int);
void read_request(int file, unsigned char buf[10]) {
  if ((write(file, buf, 1)) != 1) {
    printf("Error writing to i2c slave\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<read_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
je     116f <read_request+0x3f>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_request>:
push   %rax
mov    $0x1,%edx
call   1040 <write@plt>
cmp    $0x1,%eax
jne    1142 <read_request+0x12>
pop    %rax
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error writing to i2c slave\0A\00"
define void @read_request(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @write(i32 %5, i8* %6, i32 1)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Error writing to i2c slave\00"
define void @read_request(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
unsigned short int f69(unsigned short int x, unsigned int y) {
  return (x << y) + (x >> ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f69>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0xf,%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f69>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0xf,%cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f69(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub i32 0, %11
%13 = and i32 %12, 15
%14 = ashr i32 %10, %13
%15 = add nsw i32 %8, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @f69(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = shl i32 %3, %1
%5 = sub i32 0, %1
%6 = and i32 %5, 15
%7 = lshr i32 %3, %6
%8 = add nsw i32 %7, %4
%9 = trunc i32 %8 to i16
ret i16 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int tgaReadColor(FILE *f, unsigned int *col) {
  unsigned char b[3];
  size_t read = fread(b, 3, 1, f);
  *col = (b[2] << 16) | (b[1] << 8) | b[0];
  return read;
}


x86 assembly (clang, -O0):
<tgaReadColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x13(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
movzbl -0x11(%rbp),%ecx
shl    $0x10,%ecx
movzbl -0x12(%rbp),%eax
shl    $0x8,%eax
or     %eax,%ecx
movzbl -0x13(%rbp),%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgaReadColor>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xd(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzbl 0xf(%rsp),%ecx
shl    $0x10,%ecx
movzbl 0xe(%rsp),%edx
shl    $0x8,%edx
or     %ecx,%edx
movzbl 0xd(%rsp),%ecx
or     %edx,%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tgaReadColor(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = call i64 @fread(i8* %4, i32 3, i32 1, i32* %0)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %13, %9
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %1
%18 = trunc i64 %5 to i32
ret i32 %18
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int is_cdda_url(const char *name) { return strncmp(name, "cdda://", 7) == 0; }


x86 assembly (clang, -O0):
<is_cdda_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cdda_url>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"cdda://\00"
define i32 @is_cdda_url(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"cdda://\00"
define i32 @is_cdda_url(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int fun972() { return 972; }


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

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

LLVM IR (-O0):
define i32 @fun972() {
ret i32 972
}

LLVM IR (-O2):
define i32 @fun972() {
ret i32 972
}
/* Variables and functions */
int ez_net_tcp_accept2(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *);
int ez_net_tcp_accept(int fd) { return ez_net_tcp_accept2(fd, NULL, 0, NULL); }


x86 assembly (clang, -O0):
<ez_net_tcp_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%ecx
xor    %edx,%edx
mov    %rcx,%rsi
call   1030 <ez_net_tcp_accept2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_net_tcp_accept>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <ez_net_tcp_accept2@plt>

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

LLVM IR (-O2):
define i32 @ez_net_tcp_accept(i32 %0) {
%2 = tail call i32 @ez_net_tcp_accept2(i32 %0, i32* null, i32 0, i32* null)
ret i32 %2
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int close_socket(int sock) {
  if (close(sock)) {
    fprintf(stderr, "Failed closing socket.\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     115e <close_socket+0x3e>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1165 <close_socket+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_socket>:
push   %rax
call   1030 <close@plt>
test   %rax,%rax
je     1147 <close_socket+0x27>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Failed closing socket.\0A\00"
define i32 @close_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Failed closing socket.\0A\00"
define i32 @close_socket(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ pal2bin(char *, char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i;
  if (argc < 3) {
    printf("too few arguments\n");
    exit(1);
  }
  pal2bin(argv[1], argv[2], argv[3]);
  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)
cmpl   $0x3,-0x8(%rbp)
jge    1166 <main+0x36>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1030 <pal2bin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jle    114e <main+0x1e>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rax
mov    0x18(%rsi),%rdx
mov    %rax,%rsi
call   1030 <pal2bin@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"too few arguments\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 3
%21 = load i8*, i8** %20
%22 = call i32 @pal2bin(i8* %15, i8* %18, i8* %21)
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"too few arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call i32 @pal2bin(i8* %9, i8* %11, i8* %13)
ret i32 0
}
void sysReleaseAccess(void) {}


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

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

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

LLVM IR (-O2):
define void @sysReleaseAccess() {
ret void
}
__attribute__((always_)) int pm_schedule_suspend(struct device *dev,
                                                 unsigned int delay) {
  return -38;
}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @pm_schedule_suspend(%struct.device* %0, i32 %1) {
%3 = alloca %struct.device*
%4 = alloca i32
store %struct.device* %0, %struct.device** %3
store i32 %1, i32* %4
ret i32 -38
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @pm_schedule_suspend(%struct.device* nocapture readnone %0, i32 %1) {
ret i32 -38
}
char ReadByte(char **src) {
  char b = **src++;
  return b;
}


x86 assembly (clang, -O0):
<ReadByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadByte>:
mov    (%rdi),%rax
mov    (%rax),%al
ret

LLVM IR (-O0):
define signext i8 @ReadByte(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i32 1
store i8** %5, i8*** %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
store i8 %7, i8* %3
%8 = load i8, i8* %3
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @ReadByte(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
ret i8 %3
}
int buffer_equal(unsigned int *a, unsigned int *b) { return (a == b) ? 1 : 0; }


x86 assembly (clang, -O0):
<buffer_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @buffer_equal(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = icmp eq i32* %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @buffer_equal(i32* readnone %0, i32* readnone %1) {
%3 = icmp eq i32* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "usage: cpufreqctl [-h] [turbo {get,0,1}] [min "
                  "{get,check,VALUE}] [max {get,VALUE}]\n");
}


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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [84 x i8] c"usage: cpufreqctl [-h] [turbo {get,0,1}] [min {get,check,VALUE}] [max {get,VALUE}]\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [84 x i8] c"usage: cpufreqctl [-h] [turbo {get,0,1}] [min {get,check,VALUE}] [max {get,VALUE}]\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}
void FMdemodHilber_terminate(void) {}


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

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

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

LLVM IR (-O2):
define void @FMdemodHilber_terminate() {
ret void
}
int main(void) {
  int i, j = 21;
  i = j + j;
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ real_cfg_change_dir(char *, char *);
int cfg_change_dir(char *dirbuffer, char *newdir) {
  real_cfg_change_dir(dirbuffer, newdir);
  return (1);
}


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

x86 assembly (clang, -O2):
<cfg_change_dir>:
push   %rax
call   1030 <real_cfg_change_dir@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cfg_change_dir(i8* %0, i8* %1) {
%3 = tail call i32 @real_cfg_change_dir(i8* %0, i8* %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg_babble1() {
  printf("\nHow many paragraphs do you want to write? ");
  return;
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"\0AHow many paragraphs do you want to write? \00"
define void @msg_babble1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"\0AHow many paragraphs do you want to write? \00"
define void @msg_babble1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
int sgn(int x) { return (x >= 0) ? +1 : -1; }


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x1,%eax
ret

LLVM IR (-O0):
define i32 @sgn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 -1
ret i32 %6
}

LLVM IR (-O2):
define i32 @sgn(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
void RefBuffer_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @RefBuffer_RestoreConfig() {
ret void
}
__attribute__((always_)) unsigned int bswap_32(unsigned int x) {
  x = ((x << 8) & 0xFF00FF00) | ((x >> 8) & 0x00FF00FF);
  return (x >> 16) | (x << 16);
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = lshr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = lshr i32 %10, 16
%12 = load i32, i32* %2
%13 = shl i32 %12, 16
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @bswap_32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
void bzero(char *p, int n) {
  for (int i = 0; i < n; i++)
    p[i] = 0;
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <bzero+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <bzero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
jle    1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
void foo63() {}


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

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

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

LLVM IR (-O2):
define void @foo63() {
ret void
}
/* Variables and functions */
int open(char const *, int, int);
int __libc_open64(const char *file, int oflag, int mode) {
  return open(file, oflag | 0, mode);
}


x86 assembly (clang, -O0):
<__libc_open64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
or     $0x0,%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_open64>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @__libc_open64(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void bitmap_free_bit_array(char *array) { free(array); }


x86 assembly (clang, -O0):
<bitmap_free_bit_array>:
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):
<bitmap_free_bit_array>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @bitmap_free_bit_array(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 @bitmap_free_bit_array(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_graph();
int main() {
  test_graph();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_graph()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_graph()
ret i32 0
}
void *VMM_ERR_CAST(const void *ptr) { return (void *)ptr; }


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

x86 assembly (clang, -O2):
<VMM_ERR_CAST>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @VMM_ERR_CAST(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @VMM_ERR_CAST(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
double exp(double);
double pow(double, int);
double f(double x) { return x * exp(-x) + pow(x, 3) + 1; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1040 <pow@plt>
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe77(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
movaps %xmm0,%xmm1
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
xorps  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
mov    $0x3,%edi
call   1040 <pow@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
addsd  0xea7(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %4
%6 = call double @exp(double %5)
%7 = load double, double* %2
%8 = call double @pow(double %7, i32 3)
%9 = call double @llvm.fmuladd.f64(double %3, double %6, double %8)
%10 = fadd double %9, 1.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = tail call double @pow(double %0, i32 3)
%5 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %4)
%6 = fadd double %5, 1.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_0(char *s) { printf("%s", s); }


x86 assembly (clang, -O0):
<print_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_0>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print_0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_0(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ triexit(int);
void *trimalloc(int size) {
  void *memptr;
  memptr = (void *)malloc((unsigned int)size);
  if (memptr == (void *)NULL) {
    printf("Error:  Out of memory.\n");
    triexit(1);
  }
  return (memptr);
}


x86 assembly (clang, -O0):
<trimalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1168 <trimalloc+0x38>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <triexit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimalloc>:
push   %rbx
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1154 <trimalloc+0x24>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <triexit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Error: Out of memory.\0A\00"
define i8* @trimalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @triexit(i32 1)
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@str = [23 x i8] c"Error: Out of memory.\00"
define i8* @trimalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @triexit(i32 1)
br label %7
7: ; preds = %4, %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
void audio_open_output() {}


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

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

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

LLVM IR (-O2):
define void @audio_open_output() {
ret void
}
/* Variables and functions */
float fmax(float x, float y) {
  if (x > y)
    return x;
  else
    return y;
}


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

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

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

LLVM IR (-O2):
define float @fmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct fileinfo_list_link {
  int dummy;
};
struct fileinfo {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_link_data(struct genlist_link const *);
struct fileinfo *
fileinfo_list_link_data(const struct fileinfo_list_link *plink) {
  return (
      (struct fileinfo *)genlist_link_data((const struct genlist_link *)plink));
}


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

x86 assembly (clang, -O2):
<fileinfo_list_link_data>:
jmp    1030 <genlist_link_data@plt>

LLVM IR (-O0):
%struct.fileinfo = type { i32 }
%struct.fileinfo_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fileinfo* @fileinfo_list_link_data(%struct.fileinfo_list_link* %0) {
%2 = alloca %struct.fileinfo_list_link*
store %struct.fileinfo_list_link* %0, %struct.fileinfo_list_link** %2
%3 = load %struct.fileinfo_list_link*, %struct.fileinfo_list_link** %2
%4 = bitcast %struct.fileinfo_list_link* %3 to %struct.genlist_link*
%5 = call i64 @genlist_link_data(%struct.genlist_link* %4)
%6 = inttoptr i64 %5 to %struct.fileinfo*
ret %struct.fileinfo* %6
}

LLVM IR (-O2):
%struct.fileinfo = type { i32 }
%struct.fileinfo_list_link = type { i32 }
%struct.genlist_link = type { i32 }
define %struct.fileinfo* @fileinfo_list_link_data(%struct.fileinfo_list_link* %0) {
%2 = bitcast %struct.fileinfo_list_link* %0 to %struct.genlist_link*
%3 = tail call i64 @genlist_link_data(%struct.genlist_link* %2)
%4 = inttoptr i64 %3 to %struct.fileinfo*
ret %struct.fileinfo* %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t get_leading_digit_place(uint32_t a) {
  uint32_t divisor_leading_digit = 0x80000000;
  uint32_t i = 31;
  while (true) {
    if ((a & divisor_leading_digit) != 0) {
      return i;
    }
    divisor_leading_digit = divisor_leading_digit >> 1;
    --i;
  }
}


x86 assembly (clang, -O0):
<get_leading_digit_place>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1129 <get_leading_digit_place+0x29>
mov    -0xc(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <get_leading_digit_place+0x15>

x86 assembly (clang, -O2):
<get_leading_digit_place>:
test   %edi,%edi
js     111a <get_leading_digit_place+0x1a>
mov    $0x80000000,%ecx
mov    $0x1f,%eax
xchg   %ax,%ax
sar    %ecx
add    $0xffffffff,%eax
test   %edi,%ecx
je     1110 <get_leading_digit_place+0x10>
ret
mov    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @get_leading_digit_place(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
store i32 31, i32* %4
br label %5
5: ; preds = %1, %12
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = load i32, i32* %4
ret i32 %11
12: ; preds = %5
%13 = load i32, i32* %3
%14 = ashr i32 %13, 1
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
br label %5
}

LLVM IR (-O2):
define i32 @get_leading_digit_place(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %5, %1
%4 = phi i32 [ 31, %1 ], [ %9, %5 ]
ret i32 %4
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 31, %1 ]
%7 = phi i32 [ %8, %5 ], [ -2147483648, %1 ]
%8 = ashr i32 %7, 1
%9 = add nsw i32 %6, -1
%10 = and i32 %8, %0
%11 = icmp eq i32 %10, 0
br i1 %11, label %5, label %3
}
long long rdtsc(void) {
  unsigned long low, hi;
  asm volatile("rdtsc" : "=d"(hi), "=a"(low));
  return ((((long long)hi) << 32) | ((long long)low));
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rdx,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={dx},={ax},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %2
store i64 %5, i64* %1
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = load i64, i64* %1
%9 = or i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={dx},={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %2, 32
%5 = or i64 %4, %3
ret i64 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int xtmp;
  int res;
  int restmp;
  x = __VERIFIER_nondet_int();
  res = 0;
  while (x > 1) {
    xtmp = x;
    restmp = 0;
    while (xtmp > 1) {
      xtmp = xtmp - 2;
      restmp = restmp + 1;
    }
    x = xtmp;
    res = res + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    117c <main+0x6c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1168 <main+0x58>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <main+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}