xunge/DecIR huggingface dataset:
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ close(int);
int open(char *, int, int);
int touchfile(char *filename) {
  int fd;
  if ((fd = open(filename, O_RDWR | O_CREAT, 0600)) > 0)
    close(fd);
  return fd;
}


x86 assembly (clang, -O0):
<touchfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
or     (%rax),%esi
mov    $0x180,%edx
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jle    1160 <touchfile+0x40>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<touchfile>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x180,%edx
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    114a <touchfile+0x2a>
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @touchfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_CREAT
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7, i32 384)
store i32 %8, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_CREAT = global i32 0
define i32 @touchfile(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_CREAT
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 384)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @close(i32 %5)
br label %9
9: ; preds = %7, %1
ret i32 %5
}
/* Variables and functions */
int GetINCHIKeyFromINCHI(char const *, char *);
int GetStdINCHIKeyFromStdINCHI(const char *szINCHISource, char *szINCHIKey) {
  return GetINCHIKeyFromINCHI(szINCHISource, szINCHIKey);
}


x86 assembly (clang, -O0):
<GetStdINCHIKeyFromStdINCHI>:
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 <GetINCHIKeyFromINCHI@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetStdINCHIKeyFromStdINCHI>:
jmp    1030 <GetINCHIKeyFromINCHI@plt>

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

LLVM IR (-O2):
define i32 @GetStdINCHIKeyFromStdINCHI(i8* %0, i8* %1) {
%3 = tail call i32 @GetINCHIKeyFromINCHI(i8* %0, i8* %1)
ret i32 %3
}
unsigned chaos_of(unsigned accum) {
  accum += accum << 3;
  accum ^= accum >> 11;
  accum += accum << 15;
  return accum;
}


x86 assembly (clang, -O0):
<chaos_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xb,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaos_of>:
lea    (%rdi,%rdi,8),%eax
mov    %eax,%ecx
shr    $0xb,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shl    $0xf,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @chaos_of(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
%5 = load i32, i32* %2
%6 = add i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 11
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = shl i32 %11, 15
%13 = load i32, i32* %2
%14 = add i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @chaos_of(i32 %0) {
%2 = mul i32 %0, 9
%3 = lshr i32 %2, 11
%4 = xor i32 %3, %2
%5 = mul i32 %4, 32769
ret i32 %5
}
void _ZdlPv(void *unused) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_ZdlPv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    1108 <_ZdlPv+0x8>

x86 assembly (clang, -O2):
<_ZdlPv>:
jmp    1100 <_ZdlPv>

LLVM IR (-O0):
define void @_ZdlPv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_ZdlPv(i8* nocapture %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int read_flag(char *);
int is_efi_secure_boot(void) { return read_flag("SecureBoot"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"SecureBoot\00"
define i32 @is_efi_secure_boot() {
%1 = tail call i32 @read_flag(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ GetConsoleStringSize(char const *, int *, int *);
int ConsoleStringLen(const char *string) {
  int _width, _height;
  GetConsoleStringSize(string, &_width, &_height);
  return _width;
}


x86 assembly (clang, -O0):
<ConsoleStringLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <GetConsoleStringSize@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConsoleStringLen>:
push   %rax
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1030 <GetConsoleStringSize@plt>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ConsoleStringLen(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @GetConsoleStringSize(i8* %0, i32* %2, i32* %3)
%7 = load i32, i32* %2
ret i32 %7
}
int vrt_rdev_up(struct vrt_realdev *rdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.vrt_realdev = type opaque
define i32 @vrt_rdev_up(%struct.vrt_realdev* nocapture readnone %0) {
ret i32 0
}
int get_stack_id() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_stack_id() {
ret i32 0
}
void genj_out() {}


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

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

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

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

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
void next_line(FILE *fp) {
  char c;
  while ((c = getc(fp)) != '\n')
    ;
}


x86 assembly (clang, -O0):
<next_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1139 <next_line+0x29>
jmp    111c <next_line+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_line>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%al
jne    1120 <next_line+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @next_line(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 @getc(i32* %0)
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
int test_imm_EAint64_midword_reg(long long val) {
  return ((val >> 16) & (0xEA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EAint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xea,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EAint64_midword_reg(i64 %0) {
%2 = and i64 %0, 15335424
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void dm_dump_devres(void) {}


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

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

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

LLVM IR (-O2):
define void @dm_dump_devres() {
ret void
}
void ScaleRowDown4_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown4_AVX2() {
ret void
}
int test_imm_6Fint8_mem(signed char *val) {
  return ((*val) & (0x6F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Fint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x6f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Fint8_mem>:
testb  $0x6f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 111
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int core1_swap(char *, int);
int U_EMRPOLYBEZIERTO_swap(char *record, int torev) {
  return (core1_swap(record, torev));
}


x86 assembly (clang, -O0):
<U_EMRPOLYBEZIERTO_swap>:
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 <core1_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRPOLYBEZIERTO_swap>:
jmp    1030 <core1_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYBEZIERTO_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core1_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void boolean2c(int b) { printf("%d\n", b); }


x86 assembly (clang, -O0):
<boolean2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boolean2c>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @boolean2c(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void wkup_m3_set_cmd(struct wkup_m3_ipc_regs *ipc_regs) {}


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

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

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

LLVM IR (-O2):
%struct.wkup_m3_ipc_regs = type opaque
define void @wkup_m3_set_cmd(%struct.wkup_m3_ipc_regs* nocapture %0) {
ret void
}
/* Type definitions */
struct BlockDesc {
  int dummy;
};

/* Variables and functions */
size_t BlockDesc_freeBytes(struct BlockDesc *, size_t);
size_t BlockDesc_canAlloc(struct BlockDesc *bd, size_t size, size_t align) {
  return BlockDesc_freeBytes(bd, align) / size;
}


x86 assembly (clang, -O0):
<BlockDesc_canAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <BlockDesc_freeBytes@plt>
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlockDesc_canAlloc>:
push   %rbx
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <BlockDesc_freeBytes@plt>
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     112f <BlockDesc_canAlloc+0x1f>
xor    %edx,%edx
div    %rbx
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
%struct.BlockDesc = type { i32 }
define i64 @BlockDesc_canAlloc(%struct.BlockDesc* %0, i64 %1, i64 %2) {
%4 = alloca %struct.BlockDesc*
%5 = alloca i64
%6 = alloca i64
store %struct.BlockDesc* %0, %struct.BlockDesc** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load %struct.BlockDesc*, %struct.BlockDesc** %4
%8 = load i64, i64* %6
%9 = call i64 @BlockDesc_freeBytes(%struct.BlockDesc* %7, i64 %8)
%10 = load i64, i64* %5
%11 = udiv i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.BlockDesc = type { i32 }
define i64 @BlockDesc_canAlloc(%struct.BlockDesc* %0, i64 %1, i64 %2) {
%4 = tail call i64 @BlockDesc_freeBytes(%struct.BlockDesc* %0, i64 %2)
%5 = udiv i64 %4, %1
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ crc64_ecma_norm_base(int /*<<< orphan*/,
                                        int /*<<< orphan*/ const *,
                                        int /*<<< orphan*/);
uint64_t crc64_ecma_norm(uint64_t seed, const uint8_t *buf, uint64_t len) {
  return crc64_ecma_norm_base(seed, buf, len);
}


x86 assembly (clang, -O0):
<crc64_ecma_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <crc64_ecma_norm_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc64_ecma_norm>:
jmp    1030 <crc64_ecma_norm_base@plt>

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

LLVM IR (-O2):
define i32 @crc64_ecma_norm(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @crc64_ecma_norm_base(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct inctrie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct inctrie *);
int /*<<< orphan*/ ifree_sub(struct inctrie *);
int /*<<< orphan*/ inctrie_map(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/);
void inctrie_free(struct inctrie *ip) {
  if (ip) {
    ifree_sub(ip);
    inctrie_map(NULL, NULL, NULL, 0, NULL, NULL, NULL, 0);
    free(ip);
  }
}


x86 assembly (clang, -O0):
<inctrie_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1181 <inctrie_free+0x51>
mov    -0x8(%rbp),%rdi
call   1030 <ifree_sub@plt>
xor    %eax,%eax
mov    %eax,%r9d
xor    %ecx,%ecx
mov    %r9,%rdi
mov    %r9,%rsi
mov    %r9,%rdx
mov    %r9,%r8
movq   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1050 <inctrie_map@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inctrie_free>:
test   %rdi,%rdi
je     1162 <inctrie_free+0x32>
push   %rbx
mov    %rdi,%rbx
call   1030 <ifree_sub@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1050 <inctrie_map@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <free@plt>
ret

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

LLVM IR (-O2):
%struct.inctrie = type { i32 }
define void @inctrie_free(%struct.inctrie* %0) {
%2 = icmp eq %struct.inctrie* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @ifree_sub(%struct.inctrie* %0)
%5 = tail call i32 @inctrie_map(i32* null, i32* null, i32* null, i32 0, i32* null, i32* null, i32* null, i32 0)
%6 = tail call i32 @free(%struct.inctrie* %0)
br label %7
7: ; preds = %3, %1
ret void
}
double milesToMetres(double miles) { return miles * 1609.34; }


x86 assembly (clang, -O0):
<milesToMetres>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<milesToMetres>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @milesToMetres(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.609340e+03
ret double %4
}

LLVM IR (-O2):
define double @milesToMetres(double %0) {
%2 = fmul double %0, 1.609340e+03
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int i = 0;
  printf("%u\n", i - 1);
  printf("%d\n", i - 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ string_copy(char *, char *);
int main() {
  char s1[10] = "UMD";
  char s2[10];
  string_copy(s1, s2);
  printf("S2 is %s\n", s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <string_copy@plt>
lea    -0x18(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movw   $0x0,0x10(%rsp)
movq   $0x444d55,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x16(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <string_copy@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [10 x i8] c"UMD\00\00\00\00\00\00\00"
@.str = [10 x i8] c"S2 is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = call i32 @string_copy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [10 x i8] c"UMD\00\00\00\00\00\00\00"
@.str = [10 x i8] c"S2 is %s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @string_copy(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_POKETEXT;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ perror(char *);
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, void *, void *);
void ptrace_util_poke_text(pid_t pid, unsigned long target_address,
                           unsigned long data) {
  int result =
      ptrace(PTRACE_POKETEXT, pid, (void *)target_address, (void *)data);
  if (result != 0) {
    perror("PTRACE_POKETEXT: ");
    abort();
  }
}


x86 assembly (clang, -O0):
<ptrace_util_poke_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <ptrace@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     117c <ptrace_util_poke_text+0x4c>
lea    0xe90(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_util_poke_text>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <ptrace@plt>
test   %eax,%eax
jne    114d <ptrace_util_poke_text+0x1d>
pop    %rax
ret
lea    0xeac(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@PTRACE_POKETEXT = global i32 0
@.str = [18 x i8] c"PTRACE_POKETEXT: \00"
define void @ptrace_util_poke_text(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32, i32* @PTRACE_POKETEXT
%9 = load i32, i32* %4
%10 = load i64, i64* %5
%11 = inttoptr i64 %10 to i8*
%12 = load i64, i64* %6
%13 = inttoptr i64 %12 to i8*
%14 = call i32 @ptrace(i32 %8, i32 %9, i8* %11, i8* %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %3
ret void
}

LLVM IR (-O2):
@PTRACE_POKETEXT = global i32 0
@.str = [18 x i8] c"PTRACE_POKETEXT: \00"
define void @ptrace_util_poke_text(i32 %0, i64 %1, i64 %2) {
%4 = load i32, i32* @PTRACE_POKETEXT
%5 = inttoptr i64 %1 to i8*
%6 = inttoptr i64 %2 to i8*
%7 = tail call i32 @ptrace(i32 %4, i32 %0, i8* %5, i8* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %3
ret void
}
void RTLockValidatorRecSharedCheckBlocking(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorRecSharedCheckBlocking() {
ret void
}
/* Variables and functions */
int mult10(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int asm_val = mult10(2);
  printf("From ASM: %d\n", asm_val);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <mult10@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"From ASM: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @mult10(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ shuffle(int *, int);
int /*<<< orphan*/ sort(int *, int /*<<< orphan*/, int);
void quickSort(int a[], int size) {
  shuffle(a, size);
  sort(a, 0, size - 1);
}


x86 assembly (clang, -O0):
<quickSort>:
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 <shuffle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <shuffle@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sort@plt>

LLVM IR (-O0):
define void @quickSort(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 @shuffle(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = call i32 @sort(i32* %8, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1) {
%3 = tail call i32 @shuffle(i32* %0, i32 %1)
%4 = add nsw i32 %1, -1
%5 = tail call i32 @sort(i32* %0, i32 0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  double x = -.1;
  int i = x;
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store double -1.000000e-01, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

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


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

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

LLVM IR (-O0):
define i32 @E() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @E() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun2() {
  int i = 0;
  int b;
  while (i < 50) {
    i++;
    printf("fun2\n");
  }
}


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1143 <fun2+0x33>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <fun2+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun2>:
push   %rbp
push   %rbx
push   %rax
mov    $0x32,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1120 <fun2+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"fun2\00"
define void @fun2() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%5 = icmp eq i32 %3, 50
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nopop3();
int pop3_setfile(const char *server, int newmail, int isedit) {
  nopop3();
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @pop3_setfile(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 = call i32 (...) @nopop3()
ret i32 -1
}

LLVM IR (-O2):
define i32 @pop3_setfile(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @nopop3()
ret i32 -1
}
char max(char a, char b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
jle    112b <max+0x2b>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1131 <max+0x31>
mov    -0x3(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %al,%dil
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @max(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t byte_swap_8(uint8_t n) { return (n & 0xf0) >> 4 | (n & 0x0f) << 4; }


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

x86 assembly (clang, -O2):
<byte_swap_8>:
mov    %edi,%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
shl    $0x4,%edi
movzbl %dil,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @byte_swap_8(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = shl i32 %0, 4
%5 = and i32 %4, 240
%6 = or i32 %3, %5
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ SIGTRAP;
int /*<<< orphan*/ WIFSTOPPED(int);
scalar_t__ WSTOPSIG(int);
int TrapCause(uint32_t *w __attribute__((unused))) {
  if (!WIFSTOPPED(*w) || WSTOPSIG(*w) != SIGTRAP)
    return -1;
  return *w >> 16;
}


x86 assembly (clang, -O0):
<TrapCause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <WIFSTOPPED@plt>
cmp    $0x0,%eax
je     115b <TrapCause+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <WSTOPSIG@plt>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     1167 <TrapCause+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <TrapCause+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TrapCause>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <WIFSTOPPED@plt>
mov    $0xffffffff,%ebp
test   %eax,%eax
je     114d <TrapCause+0x2d>
mov    (%rbx),%edi
call   1040 <WSTOPSIG@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
jne    114d <TrapCause+0x2d>
movswl 0x2(%rbx),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SIGTRAP = global i64 0
define i32 @TrapCause(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = call i32 @WIFSTOPPED(i32 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i64 @WSTOPSIG(i32 %10)
%12 = load i64, i64* @SIGTRAP
%13 = icmp ne i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %8, %1
store i32 -1, i32* %2
br label %19
15: ; preds = %8
%16 = load i32*, i32** %3
%17 = load i32, i32* %16
%18 = ashr i32 %17, 16
store i32 %18, i32* %2
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@SIGTRAP = global i64 0
define i32 @TrapCause(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @WIFSTOPPED(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = load i32, i32* %0
%7 = tail call i64 @WSTOPSIG(i32 %6)
%8 = load i64, i64* @SIGTRAP
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %0
%12 = ashr i32 %11, 16
br label %13
13: ; preds = %1, %5, %10
%14 = phi i32 [ %12, %10 ], [ -1, %5 ], [ -1, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void sprint_soln(int n, double *soln) {
  int i;
  for (i = 0; i < n; i++)
    printf("\t%d: %.4f\n", i, soln[i]);
}


x86 assembly (clang, -O0):
<sprint_soln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115c <sprint_soln+0x4c>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <sprint_soln+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"\09%d: %.4f\0A\00"
define void @sprint_soln(i32 %0, double* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = load double, double* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10, double %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Type definitions */
struct rq_hashtable {
  int dummy;
};

/* Variables and functions */
struct rq_hashtable *rq_hashtable_init_with_size(int (*)(void *, void *),
                                                 unsigned int (*)(void *),
                                                 int /*<<< orphan*/);
struct rq_hashtable *rq_hashtable_init(int (*compfunc)(void *, void *),
                                       unsigned int (*hashfunc)(void *)) {
  return rq_hashtable_init_with_size(compfunc, hashfunc, 0);
}


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

x86 assembly (clang, -O2):
<rq_hashtable_init>:
xor    %edx,%edx
jmp    1030 <rq_hashtable_init_with_size@plt>

LLVM IR (-O0):
%struct.rq_hashtable = type { i32 }
define %struct.rq_hashtable* @rq_hashtable_init(i32 (i8*, i8*)* %0, i32 (i8*)* %1) {
%3 = alloca i32 (i8*, i8*)*
%4 = alloca i32 (i8*)*
store i32 (i8*, i8*)* %0, i32 (i8*, i8*)** %3
store i32 (i8*)* %1, i32 (i8*)** %4
%5 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %3
%6 = load i32 (i8*)*, i32 (i8*)** %4
%7 = call %struct.rq_hashtable* @rq_hashtable_init_with_size(i32 (i8*, i8*)* %5, i32 (i8*)* %6, i32 0)
ret %struct.rq_hashtable* %7
}

LLVM IR (-O2):
%struct.rq_hashtable = type { i32 }
define %struct.rq_hashtable* @rq_hashtable_init(i32 (i8*, i8*)* %0, i32 (i8*)* %1) {
%3 = tail call %struct.rq_hashtable* @rq_hashtable_init_with_size(i32 (i8*, i8*)* %0, i32 (i8*)* %1, i32 0)
ret %struct.rq_hashtable* %3
}
void test_ar_2_UINT(void *d, unsigned n) {
  if ((0x7fffffff * 2U + 1) - 2 <= n && n <= (0x7fffffff * 2U + 1) - 1)
    n = (0x7fffffff * 2U + 1) - 3;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_2_UINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xfffffffd,%eax
cmp    -0xc(%rbp),%eax
ja     113e <test_ar_2_UINT+0x2e>
cmpl   $0xfffffffe,-0xc(%rbp)
ja     113e <test_ar_2_UINT+0x2e>
movl   $0xfffffffc,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_2_UINT>:
lea    0x3(%rsi),%eax
cmp    $0x2,%eax
mov    $0xfffffffc,%edx
cmovae %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @test_ar_2_UINT(i8* nocapture writeonly %0, i32 %1) {
%3 = add i32 %1, 3
%4 = icmp ult i32 %3, 2
%5 = select i1 %4, i32 -4, i32 %1
%6 = zext i32 %5 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %6, i1 false)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *wuff_alloc(size_t size) { return malloc(size); }


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

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

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

LLVM IR (-O2):
define noalias i8* @wuff_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ avoid_os_int_sort(int *, int);
int /*<<< orphan*/ os_indices_sort_integers(int *, int, int *);
int /*<<< orphan*/ spr_indices_sort_integers(int *, int, int *);
void indices_sort_integers(int *iarr, int size, int *indices) {
  if (avoid_os_int_sort(iarr, size))
    spr_indices_sort_integers(iarr, size, indices);
  else
    os_indices_sort_integers(iarr, size, indices);
}


x86 assembly (clang, -O0):
<indices_sort_integers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <avoid_os_int_sort@plt>
cmp    $0x0,%rax
je     116e <indices_sort_integers+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <spr_indices_sort_integers@plt>
jmp    117e <indices_sort_integers+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1050 <os_indices_sort_integers@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indices_sort_integers>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <avoid_os_int_sort@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
test   %rax,%rax
je     1157 <indices_sort_integers+0x27>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <spr_indices_sort_integers@plt>
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <os_indices_sort_integers@plt>

LLVM IR (-O0):
define void @indices_sort_integers(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = call i64 @avoid_os_int_sort(i32* %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32*, i32** %6
%15 = call i32 @spr_indices_sort_integers(i32* %12, i32 %13, i32* %14)
br label %21
16: ; preds = %3
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32*, i32** %6
%20 = call i32 @os_indices_sort_integers(i32* %17, i32 %18, i32* %19)
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
define void @indices_sort_integers(i32* %0, i32 %1, i32* %2) {
%4 = tail call i64 @avoid_os_int_sort(i32* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @spr_indices_sort_integers(i32* %0, i32 %1, i32* %2)
br label %10
8: ; preds = %3
%9 = tail call i32 @os_indices_sort_integers(i32* %0, i32 %1, i32* %2)
br label %10
10: ; preds = %8, %6
ret void
}