xunge/DecIR huggingface dataset:
int a_twist_l_on_eflip(eflip)
int eflip;
{
  int temp_arr[12];
  a_eflip_unpack(eflip, temp_arr);
  four_cycle(temp_arr, 11, 7, 9, 3);
  return a_eflip_pack(temp_arr);
}


x86 assembly (clang, -O0):
<a_twist_l_on_eflip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1030 <a_eflip_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0xb,%esi
mov    $0x7,%edx
mov    $0x9,%ecx
mov    $0x3,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <a_eflip_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_twist_l_on_eflip>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <a_eflip_unpack@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
mov    $0x7,%edx
mov    $0x9,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <a_eflip_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a_twist_l_on_eflip(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eflip_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 11, i32 7, i32 9, i32 3)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eflip_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @a_twist_l_on_eflip(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eflip_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 11, i32 7, i32 9, i32 3)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eflip_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int EOF;
int getchar();
void clean_stdin() {
  int c;
  do {
    c = getchar();
  } while (c != '\n' && c != EOF);
}


x86 assembly (clang, -O0):
<clean_stdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1143 <clean_stdin+0x33>
mov    -0x4(%rbp),%eax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1118 <clean_stdin+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_stdin>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1130 <clean_stdin+0x20>
cmp    (%rbx),%eax
jne    1120 <clean_stdin+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @clean_stdin() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
br label %4
4: ; preds = %2
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %1
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br label %11
11: ; preds = %7, %4
%12 = phi i1 [ false, %4 ], [ %10, %7 ]
br i1 %12, label %2, label %13
13: ; preds = %11
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @clean_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
void g_date_free() {}


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

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

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

LLVM IR (-O2):
define void @g_date_free() {
ret void
}
void w7(void *x, double y) { *(double *)(x + 32761) = y; }


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

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

LLVM IR (-O0):
define void @w7(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32761
%8 = bitcast i8* %7 to double*
store double %5, double* %8
ret void
}

LLVM IR (-O2):
define void @w7(i8* nocapture writeonly %0, double %1) {
%3 = getelementptr i8, i8* %0, i64 32761
%4 = bitcast i8* %3 to double*
store double %1, double* %4
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};
struct dentry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pr_debug(char *, struct dentry *, int);
int vfs_rmdir(struct inode *, struct dentry *);
int ovl_do_rmdir(struct inode *dir, struct dentry *dentry) {
  int err = vfs_rmdir(dir, dentry);
  pr_debug("rmdir(%pd2) = %i\n", dentry, err);
  return err;
}


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

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

LLVM IR (-O0):
%struct.inode = type { i32 }
%struct.dentry = type { i32 }
@.str = [18 x i8] c"rmdir(%pd2) = %i\0A\00"
define i32 @ovl_do_rmdir(%struct.inode* %0, %struct.dentry* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.dentry*
%5 = alloca i32
store %struct.inode* %0, %struct.inode** %3
store %struct.dentry* %1, %struct.dentry** %4
%6 = load %struct.inode*, %struct.inode** %3
%7 = load %struct.dentry*, %struct.dentry** %4
%8 = call i32 @vfs_rmdir(%struct.inode* %6, %struct.dentry* %7)
store i32 %8, i32* %5
%9 = load %struct.dentry*, %struct.dentry** %4
%10 = load i32, i32* %5
%11 = call i32 @pr_debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.dentry* %9, i32 %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
%struct.inode = type { i32 }
%struct.dentry = type { i32 }
@.str = [18 x i8] c"rmdir(%pd2) = %i\0A\00"
define i32 @ovl_do_rmdir(%struct.inode* %0, %struct.dentry* %1) {
%3 = tail call i32 @vfs_rmdir(%struct.inode* %0, %struct.dentry* %1)
%4 = tail call i32 @pr_debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.dentry* %1, i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, void *);
char *funcname(void *addr) {
  static char buf[256];
  sprintf(buf, "%p", addr);
  return buf;
}


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

x86 assembly (clang, -O2):
<funcname>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@funcname.buf = internal global [256 x i8] zeroinitializer
@.str = [3 x i8] c"%p\00"
define i8* @funcname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @funcname.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @funcname.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@funcname.buf = internal global [256 x i8] zeroinitializer
@.str = [3 x i8] c"%p\00"
define i8* @funcname(i8* %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @funcname.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @funcname.buf, i64 0, i64 0)
}
int opcode(int instruction) { return (instruction >> 26) & 0x0000003f; }


x86 assembly (clang, -O0):
<opcode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1a,%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opcode>:
mov    %edi,%eax
shr    $0x1a,%eax
ret

LLVM IR (-O0):
define i32 @opcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 26
%5 = and i32 %4, 63
ret i32 %5
}

LLVM IR (-O2):
define i32 @opcode(i32 %0) {
%2 = lshr i32 %0, 26
ret i32 %2
}
/* Type definitions */
struct stat {
  int st_mode;
};
struct dirent {
  int dummy;
};

/* Variables and functions */
int S_IFREG;
int _file_only(const struct dirent *d, const struct stat *s) {
  return s->st_mode & S_IFREG ? 1 : 0;
}


x86 assembly (clang, -O0):
<_file_only>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    0x2ecf(%rip),%rax
and    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_file_only>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsi)
setne  %al
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
%struct.stat = type { i32 }
@S_IFREG = global i32 0
define i32 @_file_only(%struct.dirent* %0, %struct.stat* %1) {
%3 = alloca %struct.dirent*
%4 = alloca %struct.stat*
store %struct.dirent* %0, %struct.dirent** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load %struct.stat*, %struct.stat** %4
%6 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @S_IFREG
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
ret i32 %12
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
%struct.stat = type { i32 }
@S_IFREG = global i32 0
define i32 @_file_only(%struct.dirent* nocapture readnone %0, %struct.stat* nocapture %1) {
%3 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = load i32, i32* @S_IFREG
%6 = and i32 %5, %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ print_helloworld_threetimes();
void main() { print_helloworld_threetimes(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <print_helloworld_threetimes@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @print_helloworld_threetimes()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @print_helloworld_threetimes()
ret void
}
int test_imm_75int32_reg(int val) { return ((val) & (0x75 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_75int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 117
%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_75int32_reg(i32 %0) {
%2 = and i32 %0, 117
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int ftruncate(int, int /*<<< orphan*/);
int lisp_ftruncate(int fd, off_t length) { return ftruncate(fd, length); }


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

x86 assembly (clang, -O2):
<lisp_ftruncate>:
jmp    1030 <ftruncate@plt>

LLVM IR (-O0):
define i32 @lisp_ftruncate(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 = call i32 @ftruncate(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lisp_ftruncate(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;
typedef int original;

/* Variables and functions */
uint16_t byte_swap2(uint16_t original) {
  uint16_t swapped;
  swapped = (((original)&0xff00) >> 8) | (((original)&0x00ff) << 8);
  return swapped;
}


x86 assembly (clang, -O0):
<byte_swap2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_swap2>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @byte_swap2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 65280
%6 = ashr i32 %5, 8
%7 = load i32, i32* %2
%8 = and i32 %7, 255
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @byte_swap2(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void append_error(void) {
  fprintf(stderr, "Error: Token buffer exceeded\n");
  exit(1);
}


x86 assembly (clang, -O0):
<append_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<append_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Error: Token buffer exceeded\0A\00"
define void @append_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Error: Token buffer exceeded\0A\00"
define void @append_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool AUXTDCIdle(uint32_t ui32Base) {
  ;
  return ((((*((volatile unsigned long *)(ui32Base + 0x00000004))) &
            0x0000003F) == 0x00000006)
              ? true
              : false);
}


x86 assembly (clang, -O0):
<AUXTDCIdle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rdx
and    $0x3f,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x6,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AUXTDCIdle>:
mov    0x4(%rdi),%rcx
and    $0x3f,%ecx
xor    %eax,%eax
cmp    $0x6,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @AUXTDCIdle(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 63
%8 = icmp eq i64 %7, 6
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @AUXTDCIdle(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 63
%6 = icmp eq i64 %5, 6
%7 = zext i1 %6 to i32
ret i32 %7
}
void ff_hevc_put_hevc_uni_w_pel_pixels48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels48_8_sse4() {
ret void
}
int assignedvar(int v, int i) {
  if (v < 0 && (-1 - v) <= i)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<assignedvar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <assignedvar+0x31>
mov    $0xffffffff,%eax
sub    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1131 <assignedvar+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <assignedvar+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignedvar>:
test   %edi,%edi
sets   %al
not    %edi
cmp    %esi,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @assignedvar(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = xor i32 %0, -1
%5 = icmp sle i32 %4, %1
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int splitNameParameter(char *cmdline, char *name, char *parameter) {
  while ((*name++ = *cmdline++) != ' ')
    ;
  name--;
  *name = '\0';
  strcpy(parameter, cmdline);
  return 0;
}


x86 assembly (clang, -O0):
<splitNameParameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x20,%eax
je     1157 <splitNameParameter+0x47>
jmp    1124 <splitNameParameter+0x14>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitNameParameter>:
push   %rax
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rax),%ecx
add    $0x1,%rax
mov    %cl,(%rsi)
add    $0x1,%rsi
cmp    $0x20,%cl
jne    1120 <splitNameParameter+0x10>
movb   $0x0,-0x1(%rsi)
mov    %rdx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @splitNameParameter(i8* %0, i8* nocapture writeonly %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %1, %3 ], [ %9, %4 ]
%6 = phi i8* [ %0, %3 ], [ %7, %4 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = icmp eq i8 %8, 32
br i1 %10, label %11, label %4
11: ; preds = %4
store i8 0, i8* %5
%12 = tail call i32 @strcpy(i8* %2, i8* %7)
ret i32 0
}
float vcylinder(float a, float b) {
  float x = 3.141592 * a * a;
  return (x * b);
}


x86 assembly (clang, -O0):
<vcylinder>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcylinder>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @vcylinder(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fmul double 0x400921FAFC8B007A, %7
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fmul double %8, %10
%12 = fptrunc double %11 to float
store float %12, float* %5
%13 = load float, float* %5
%14 = load float, float* %4
%15 = fmul float %13, %14
ret float %15
}

LLVM IR (-O2):
define float @vcylinder(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fmul double %3, 0x400921FAFC8B007A
%5 = fmul double %4, %3
%6 = fptrunc double %5 to float
%7 = fmul float %6, %1
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int getushort(FILE *f) {
  int ch1 = getc(f);
  int ch2 = getc(f);
  if (ch2 == EOF)
    return (EOF);
  return ((ch1 << 8) | ch2);
}


x86 assembly (clang, -O0):
<getushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <getushort+0x47>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <getushort+0x53>
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getushort>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
mov    0x2ebc(%rip),%rcx
mov    (%rcx),%ecx
shl    $0x8,%ebp
or     %eax,%ebp
cmp    %ecx,%eax
cmove  %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @getushort(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @getc(i32* %6)
store i32 %7, i32* %4
%8 = load i32*, i32** %3
%9 = call i32 @getc(i32* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* @EOF
store i32 %14, i32* %2
br label %20
15: ; preds = %1
%16 = load i32, i32* %4
%17 = shl i32 %16, 8
%18 = load i32, i32* %5
%19 = or i32 %17, %18
store i32 %19, i32* %2
br label %20
20: ; preds = %15, %13
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getushort(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = shl i32 %2, 8
%7 = or i32 %6, %3
%8 = select i1 %5, i32 %4, i32 %7
ret i32 %8
}
/* Type definitions */
struct vm {
  int dummy;
};
struct op {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addr_dec(struct vm *);
void op_dec_addr(struct vm *vm, const struct op const *op) { addr_dec(vm); }


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

x86 assembly (clang, -O2):
<op_dec_addr>:
jmp    1030 <addr_dec@plt>

LLVM IR (-O0):
%struct.vm = type { i32 }
%struct.op = type { i32 }
define void @op_dec_addr(%struct.vm* %0, %struct.op* %1) {
%3 = alloca %struct.vm*
%4 = alloca %struct.op*
store %struct.vm* %0, %struct.vm** %3
store %struct.op* %1, %struct.op** %4
%5 = load %struct.vm*, %struct.vm** %3
%6 = call i32 @addr_dec(%struct.vm* %5)
ret void
}

LLVM IR (-O2):
%struct.vm = type { i32 }
%struct.op = type { i32 }
define void @op_dec_addr(%struct.vm* %0, %struct.op* nocapture readnone %1) {
%3 = tail call i32 @addr_dec(%struct.vm* %0)
ret void
}
/* Type definitions */
struct record {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pmf_print(int /*<<< orphan*/ *, struct record *);
struct record **record_find(int);
void pmf_write(FILE *f, int pid, int type) {
  struct record **r = record_find(pid);
  pmf_print(f, r[type]);
}


x86 assembly (clang, -O0):
<pmf_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <record_find@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <pmf_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmf_write>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <record_find@plt>
movslq %ebx,%rcx
mov    (%rax,%rcx,8),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pmf_print@plt>

LLVM IR (-O0):
%struct.record = type { i32 }
define void @pmf_write(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.record**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = call %struct.record** @record_find(i32 %8)
store %struct.record** %9, %struct.record*** %7
%10 = load i32*, i32** %4
%11 = load %struct.record**, %struct.record*** %7
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds %struct.record*, %struct.record** %11, i64 %13
%15 = load %struct.record*, %struct.record** %14
%16 = call i32 @pmf_print(i32* %10, %struct.record* %15)
ret void
}

LLVM IR (-O2):
%struct.record = type { i32 }
define void @pmf_write(i32* %0, i32 %1, i32 %2) {
%4 = tail call %struct.record** @record_find(i32 %1)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds %struct.record*, %struct.record** %4, i64 %5
%7 = load %struct.record*, %struct.record** %6
%8 = tail call i32 @pmf_print(i32* %0, %struct.record* %7)
ret void
}
/* Variables and functions */
int NumberOfNodes();
int NumberOfWaves();
int SizeOfMessage() {
  return (8 * (1 << 20)) / (NumberOfWaves() * (NumberOfNodes() - 1)) / 2;
}


x86 assembly (clang, -O0):
<SizeOfMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <NumberOfWaves@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <NumberOfNodes@plt>
mov    -0x4(%rbp),%ecx
sub    $0x1,%eax
imul   %eax,%ecx
mov    $0x800000,%eax
cltd
idiv   %ecx
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SizeOfMessage>:
push   %rbx
xor    %eax,%eax
call   1040 <NumberOfWaves@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <NumberOfNodes@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
imul   %ebx,%ecx
mov    $0x800000,%eax
xor    %edx,%edx
idiv   %ecx
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SizeOfMessage() {
%1 = call i32 (...) @NumberOfWaves()
%2 = call i32 (...) @NumberOfNodes()
%3 = sub nsw i32 %2, 1
%4 = mul nsw i32 %1, %3
%5 = sdiv i32 8388608, %4
%6 = sdiv i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @SizeOfMessage() {
%1 = tail call i32 (...) @NumberOfWaves()
%2 = tail call i32 (...) @NumberOfNodes()
%3 = add nsw i32 %2, -1
%4 = mul nsw i32 %3, %1
%5 = sdiv i32 8388608, %4
%6 = sdiv i32 %5, 2
ret i32 %6
}
void rop3_51_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = ~S;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_51_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_51_1_0>:
not    %sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_51_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = xor i32 %9, -1
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
%12 = load i8, i8* %7
%13 = zext i8 %12 to i32
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = xor i32 %15, -1
%17 = and i32 %13, %16
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = and i32 %20, %22
%24 = or i32 %17, %23
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
store i8 %25, i8* %26
ret void
}

LLVM IR (-O2):
define void @rop3_51_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_CC_VREN_OUTPUT() { set_io_bit(-6, 4); }


x86 assembly (clang, -O0):
<TOSH_MAKE_CC_VREN_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffa,%edi
mov    $0x4,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_CC_VREN_OUTPUT>:
mov    $0xfffffffa,%edi
mov    $0x4,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_CC_VREN_OUTPUT() {
%1 = call i32 @set_io_bit(i32 -6, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_CC_VREN_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 -6, i32 4)
ret void
}
char *eol(p)
register char *p;
{
  while (*p != '\n')
    p++;
  return (p);
}


x86 assembly (clang, -O0):
<eol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1129 <eol+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <eol+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @eol(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 10
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
x(x) { return 3 + x; }


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

x86 assembly (clang, -O2):
<x>:
lea    0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @x(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int write_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(17, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_target_solutions>:
mov    $0x11,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @write_target_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 17, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 17, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
scalar_t__ towupper(scalar_t__);
int iswlower(wint_t wc) { return towupper(wc) != wc; }


x86 assembly (clang, -O0):
<iswlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <towupper@plt>
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswlower>:
push   %rbx
mov    %rdi,%rbx
call   1030 <towupper@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iswlower(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @towupper(i64 %3)
%5 = load i64, i64* %2
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @iswlower(i64 %0) {
%2 = tail call i64 @towupper(i64 %0)
%3 = icmp ne i64 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xf2() {
  Assert_real((isdigit(242) == 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_isdigit.c",
              1215, ("isdigit should be 0 for 0xf2"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xf2>:
push   %rax
mov    $0xf2,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4bf,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf2\00"
define void @t_isdigit_0xf2() {
%1 = call i64 @isdigit(i32 242)
%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 1215, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xf2\00"
define void @t_isdigit_0xf2() {
%1 = tail call i64 @isdigit(i32 242)
%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 1215, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void add() {
  asm volatile("popq %%rax\n\t"
               "addq %%rax, (%%rsp)\n\t" ::
                   :);
}


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

x86 assembly (clang, -O2):
<add>:
pop    %rax
add    %rax,(%rsp)
ret

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

LLVM IR (-O2):
define void @add() {
tail call void asm sideeffect "popq %rax\0A\09addq %rax, (%rsp)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct comp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BrzSequenceOptimised_requp(struct comp *, int);
void BrzSequence_requp(struct comp *comp, int port) {
  BrzSequenceOptimised_requp(comp, port);
}


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

x86 assembly (clang, -O2):
<BrzSequence_requp>:
jmp    1030 <BrzSequenceOptimised_requp@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
define void @BrzSequence_requp(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%5 = load %struct.comp*, %struct.comp** %3
%6 = load i32, i32* %4
%7 = call i32 @BrzSequenceOptimised_requp(%struct.comp* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzSequence_requp(%struct.comp* %0, i32 %1) {
%3 = tail call i32 @BrzSequenceOptimised_requp(%struct.comp* %0, i32 %1)
ret void
}
void *f2(int *i) { return i ?: 0; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1127 <f2+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <f2+0x32>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1132 <f2+0x32>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @f2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = phi i32* [ %3, %5 ], [ null, %6 ]
%9 = bitcast i32* %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @f2(i32* readnone %0) {
%2 = bitcast i32* %0 to i8*
ret i8* %2
}
unsigned long MIN(unsigned long a, unsigned long b) {
  if (a < b) {
    return a;
  }
  return b;
}


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

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

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

LLVM IR (-O2):
define i64 @MIN(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int vn(unsigned char const *, unsigned char const *, int);
int crypto_verify_16_tweet(const unsigned char *x, const unsigned char *y) {
  return vn(x, y, 16);
}


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

x86 assembly (clang, -O2):
<crypto_verify_16_tweet>:
mov    $0x10,%edx
jmp    1030 <vn@plt>

LLVM IR (-O0):
define i32 @crypto_verify_16_tweet(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 @vn(i8* %5, i8* %6, i32 16)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crypto_verify_16_tweet(i8* %0, i8* %1) {
%3 = tail call i32 @vn(i8* %0, i8* %1, i32 16)
ret i32 %3
}
int ahd_patch0_func(struct ahd_softc *ahd) { return (0); }


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

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

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

LLVM IR (-O2):
%struct.ahd_softc = type opaque
define i32 @ahd_patch0_func(%struct.ahd_softc* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writeCommand1parm(char *, unsigned int);
void turnLeft(unsigned int speed) {
  if (speed <= 100) {
    writeCommand1parm("TL", speed);
  }
}


x86 assembly (clang, -O0):
<turnLeft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
ja     1134 <turnLeft+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <writeCommand1parm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turnLeft>:
cmp    $0x64,%edi
ja     1123 <turnLeft+0x13>
mov    %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <writeCommand1parm@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"TL\00"
define void @turnLeft(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 100
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @writeCommand1parm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"TL\00"
define void @turnLeft(i32 %0) {
%2 = icmp ult i32 %0, 101
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @writeCommand1parm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t decode_special2_opcode(uint32_t instruction) {
  return (instruction & 0x3f);
}


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

x86 assembly (clang, -O2):
<decode_special2_opcode>:
mov    %edi,%eax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @decode_special2_opcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 63
ret i32 %4
}

LLVM IR (-O2):
define i32 @decode_special2_opcode(i32 %0) {
%2 = and i32 %0, 63
ret i32 %2
}
void gtk_text_iter_set_offset() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_set_offset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cat_test_cleanup();
int /*<<< orphan*/ cmt_test_cleanup();
int /*<<< orphan*/ mba_test_cleanup();
int /*<<< orphan*/ mbm_test_cleanup();
void tests_cleanup(void) {
  mbm_test_cleanup();
  mba_test_cleanup();
  cmt_test_cleanup();
  cat_test_cleanup();
}


x86 assembly (clang, -O0):
<tests_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mbm_test_cleanup@plt>
mov    $0x0,%al
call   1040 <mba_test_cleanup@plt>
mov    $0x0,%al
call   1060 <cmt_test_cleanup@plt>
mov    $0x0,%al
call   1050 <cat_test_cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests_cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <mbm_test_cleanup@plt>
xor    %eax,%eax
call   1040 <mba_test_cleanup@plt>
xor    %eax,%eax
call   1060 <cmt_test_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cat_test_cleanup@plt>

LLVM IR (-O0):
define void @tests_cleanup() {
%1 = call i32 (...) @mbm_test_cleanup()
%2 = call i32 (...) @mba_test_cleanup()
%3 = call i32 (...) @cmt_test_cleanup()
%4 = call i32 (...) @cat_test_cleanup()
ret void
}

LLVM IR (-O2):
define void @tests_cleanup() {
%1 = tail call i32 (...) @mbm_test_cleanup()
%2 = tail call i32 (...) @mba_test_cleanup()
%3 = tail call i32 (...) @cmt_test_cleanup()
%4 = tail call i32 (...) @cat_test_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_incomp();
int /*<<< orphan*/ test_zero_size();
int main() {
  test_incomp();
  test_zero_size();
  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_incomp@plt>
mov    $0x0,%al
call   1040 <test_zero_size@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_incomp@plt>
xor    %eax,%eax
call   1040 <test_zero_size@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_incomp()
%3 = call i32 (...) @test_zero_size()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_incomp()
%2 = tail call i32 (...) @test_zero_size()
ret i32 0
}
void emit_type_definition_float32(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_type_definition_float32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_float32(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_float32(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}