xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;

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


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

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

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

LLVM IR (-O2):
define i64 @bmin_uint8(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets_or_exit(char *, int, int /*<<< orphan*/ *);
void skip_headers(FILE *client) {
  char buffer[1024];
  while (buffer[0] != '\r' && buffer[0] != '\n')
    fgets_or_exit(buffer, 1024, client);
}


x86 assembly (clang, -O0):
<skip_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
movsbl -0x410(%rbp),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x411(%rbp)
je     114a <skip_headers+0x3a>
movsbl -0x410(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x411(%rbp)
mov    -0x411(%rbp),%al
test   $0x1,%al
jne    115d <skip_headers+0x4d>
jmp    1177 <skip_headers+0x67>
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets_or_exit@plt>
jmp    111f <skip_headers+0xf>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_headers>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
cmp    $0xa,%al
je     114c <skip_headers+0x3c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0xd,%al
je     114c <skip_headers+0x3c>
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1030 <fgets_or_exit@plt>
movzbl (%rsp),%eax
cmp    $0xa,%al
jne    1130 <skip_headers+0x20>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @skip_headers(i32* %0) {
%2 = alloca i32*
%3 = alloca [1024 x i8]
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 13
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%18 = load i32*, i32** %2
%19 = call i32 @fgets_or_exit(i8* %17, i32 1024, i32* %18)
br label %4
20: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @skip_headers(i32* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %6, %1
%5 = phi i8 [ %8, %6 ], [ undef, %1 ]
switch i8 %5, label %6 [
i8 13, label %9
i8 10, label %9
]
6: ; preds = %4
%7 = call i32 @fgets_or_exit(i8* %3, i32 1024, i32* %0)
%8 = load i8, i8* %3
br label %4
9: ; preds = %4, %4
ret void
}
void foo747(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo747(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int dlclose(void *__handle) {
  free(__handle);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dlclose(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ss2qsd(int *, int *);
void ss2qsd_(int *x, int *y) { ss2qsd(x, y); }


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

x86 assembly (clang, -O2):
<ss2qsd_>:
jmp    1030 <ss2qsd@plt>

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

LLVM IR (-O2):
define void @ss2qsd_(i32* %0, i32* %1) {
%3 = tail call i32 @ss2qsd(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void WriteString(char *s, int handle) { write(handle, s, strlen(s)); }


x86 assembly (clang, -O0):
<WriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @WriteString(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 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @WriteString(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void console() { perror("Default called!\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Default called!\0A\00"
define void @console() {
%1 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Default called!\0A\00"
define void @console() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void M68KDummySync(void) {}


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

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

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

LLVM IR (-O2):
define void @M68KDummySync() {
ret void
}
/* Variables and functions */
int auth_userdb_pre_common(char const *, char const *, int /*<<< orphan*/,
                           int (*)(struct authinfo *, void *), void *);
int auth_userdb_pre(const char *userid, const char *service,
                    int (*callback)(struct authinfo *, void *), void *arg) {
  return (auth_userdb_pre_common(userid, service, 0, callback, arg));
}


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

x86 assembly (clang, -O2):
<auth_userdb_pre>:
mov    %rcx,%r8
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <auth_userdb_pre_common@plt>

LLVM IR (-O0):
%struct.authinfo = type opaque
%struct.authinfo.0 = type opaque
define i32 @auth_userdb_pre(i8* %0, i8* %1, i32 (%struct.authinfo*, i8*)* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32 (%struct.authinfo*, i8*)*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 (%struct.authinfo*, i8*)* %2, i32 (%struct.authinfo*, i8*)** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32 (%struct.authinfo*, i8*)*, i32 (%struct.authinfo*, i8*)** %7
%12 = bitcast i32 (%struct.authinfo*, i8*)* %11 to i32 (%struct.authinfo.0*, i8*)*
%13 = load i8*, i8** %8
%14 = call i32 @auth_userdb_pre_common(i8* %9, i8* %10, i32 0, i32 (%struct.authinfo.0*, i8*)* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.authinfo = type opaque
%struct.authinfo.0 = type opaque
define i32 @auth_userdb_pre(i8* %0, i8* %1, i32 (%struct.authinfo*, i8*)* %2, i8* %3) {
%5 = bitcast i32 (%struct.authinfo*, i8*)* %2 to i32 (%struct.authinfo.0*, i8*)*
%6 = tail call i32 @auth_userdb_pre_common(i8* %0, i8* %1, i32 0, i32 (%struct.authinfo.0*, i8*)* %5, i8* %3)
ret i32 %6
}
int precision(double value) {
  if (value < 100)
    return 2;
  else if (value < 100000)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<precision>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1128 <precision+0x28>
movl   $0x2,-0x4(%rbp)
jmp    1153 <precision+0x53>
movsd  0xed8(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1147 <precision+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1153 <precision+0x53>
jmp    114c <precision+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<precision>:
movsd  0xef8(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
movsd  0xeef(%rip),%xmm1
ucomisd %xmm0,%xmm1
mov    $0x2,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @precision(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 1.000000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 2, i32* %2
br label %13
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 1.000000e+05
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %13
11: ; preds = %7
br label %12
12: ; preds = %11
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @precision(double %0) {
%2 = fcmp olt double %0, 1.000000e+02
%3 = fcmp olt double %0, 1.000000e+05
%4 = zext i1 %3 to i32
%5 = select i1 %2, i32 2, i32 %4
ret i32 %5
}
/* Variables and functions */
int _read(int, void *, unsigned int);
int read(int handle, void *buffer, unsigned int count) {
  return _read(handle, buffer, count);
}


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

x86 assembly (clang, -O2):
<read>:
jmp    1030 <_read@plt>

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

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

/* Variables and functions */
void ploop_unlock_di(struct ploop_disk_images_data *);
void ploop_unlock_dd(struct ploop_disk_images_data *di) {
  return ploop_unlock_di(di);
}


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

x86 assembly (clang, -O2):
<ploop_unlock_dd>:
jmp    1030 <ploop_unlock_di@plt>

LLVM IR (-O0):
%struct.ploop_disk_images_data = type { i32 }
define void @ploop_unlock_dd(%struct.ploop_disk_images_data* %0) {
%2 = alloca %struct.ploop_disk_images_data*
store %struct.ploop_disk_images_data* %0, %struct.ploop_disk_images_data** %2
%3 = load %struct.ploop_disk_images_data*, %struct.ploop_disk_images_data** %2
ret void
}

LLVM IR (-O2):
%struct.ploop_disk_images_data = type { i32 }
define void @ploop_unlock_dd(%struct.ploop_disk_images_data* %0) {
tail call void @ploop_unlock_di(%struct.ploop_disk_images_data* %0)
ret void
}
void big(long long u) {}


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

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

LLVM IR (-O0):
define void @big(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
ret void
}

LLVM IR (-O2):
define void @big(i64 %0) {
ret void
}
/* Variables and functions */
int imin(int, int);
int imin3(int a, int b, int c) { return ((a) < (b)) ? imin(a, c) : imin(b, c); }


x86 assembly (clang, -O0):
<imin3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1140 <imin3+0x30>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <imin@plt>
mov    %eax,-0x10(%rbp)
jmp    114e <imin3+0x3e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <imin@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin3>:
cmp    %esi,%edi
cmovge %esi,%edi
mov    %edx,%esi
jmp    1030 <imin@plt>

LLVM IR (-O0):
define i32 @imin3(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 = icmp slt i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = call i32 @imin(i32 %11, i32 %12)
br label %18
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @imin(i32 %15, i32 %16)
br label %18
18: ; preds = %14, %10
%19 = phi i32 [ %13, %10 ], [ %17, %14 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @imin3(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = tail call i32 @imin(i32 %5, i32 %2)
ret i32 %6
}
int security_quotactl(int cmds, int type, int id, struct super_block *sb) {
  return 0;
}


x86 assembly (clang, -O0):
<security_quotactl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.super_block = type opaque
define i32 @security_quotactl(i32 %0, i32 %1, i32 %2, %struct.super_block* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.super_block*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.super_block* %3, %struct.super_block** %8
ret i32 0
}

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @security_quotactl(i32 %0, i32 %1, i32 %2, %struct.super_block* nocapture readnone %3) {
ret i32 0
}
int test_imm_30uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x30 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_30uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x30,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_30uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 48
%7 = icmp ne i64 %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_30uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 206158430208
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void term_curoff(void) { printf("\033[?25l"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @term_curoff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @term_curoff() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __RBIT(uint32_t value) {
  uint32_t result;
  uint32_t s = (4U * 8U) - 1U;
  result = value;
  for (value >>= 1U; value != 0U; value >>= 1U) {
    result <<= 1U;
    result |= value & 1U;
    s--;
  }
  result <<= s;
  return result;
}


x86 assembly (clang, -O0):
<__RBIT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1153 <__RBIT+0x53>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111d <__RBIT+0x1d>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__RBIT>:
mov    $0x1f,%ecx
cmp    $0x2,%edi
jae    110e <__RBIT+0xe>
mov    %edi,%eax
jmp    1134 <__RBIT+0x34>
mov    $0x1f,%ecx
mov    %edi,%eax
mov    %edi,%edx
nopw   0x0(%rax,%rax,1)
shr    %edx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%eax
add    $0xffffffff,%ecx
cmp    $0x3,%edi
mov    %edx,%edi
ja     1120 <__RBIT+0x20>
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @__RBIT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 31, i32* %4
%5 = load i32, i32* %2
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = lshr i32 %6, 1
store i32 %7, i32* %2
br label %8
8: ; preds = %20, %1
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32, i32* %3
%13 = shl i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = and i32 %14, 1
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = add i32 %18, -1
store i32 %19, i32* %4
br label %20
20: ; preds = %11
%21 = load i32, i32* %2
%22 = lshr i32 %21, 1
store i32 %22, i32* %2
br label %8
23: ; preds = %8
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = shl i32 %25, %24
store i32 %26, i32* %3
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @__RBIT(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 31, %1 ]
%6 = phi i32 [ %10, %3 ], [ %0, %1 ]
%7 = lshr i32 %4, 1
%8 = shl i32 %6, 1
%9 = and i32 %7, 1
%10 = or i32 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i32 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ %0, %1 ], [ %10, %3 ]
%15 = phi i32 [ 31, %1 ], [ %11, %3 ]
%16 = shl i32 %14, %15
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __fsetlocking(FILE *f, int type) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__fsetlocking(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @__fsetlocking(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void DESConfigSet(uint32_t ui32Base, uint32_t ui32Config) {
  ;
  ui32Config |=
      ((*((volatile uint32_t *)(ui32Base + 0x00000020))) & 0x80000000);
  (*((volatile uint32_t *)(ui32Base + 0x00000020))) = ui32Config;
}


x86 assembly (clang, -O0):
<DESConfigSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
and    $0x80000000,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESConfigSet>:
movslq %edi,%rax
mov    $0x80000000,%ecx
and    0x20(%rax),%ecx
or     %esi,%ecx
mov    %ecx,0x20(%rax)
ret

LLVM IR (-O0):
define void @DESConfigSet(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 = add nsw i32 %5, 32
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -2147483648
%11 = load i32, i32* %4
%12 = or i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 32
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %13, i32* %17
ret void
}

LLVM IR (-O2):
define void @DESConfigSet(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 32
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -2147483648
%8 = or i32 %7, %1
store volatile i32 %8, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __tuntap_close(int, char const *);
void tapdev_close(int fd, const char *name) { __tuntap_close(fd, name); }


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

x86 assembly (clang, -O2):
<tapdev_close>:
jmp    1030 <__tuntap_close@plt>

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

LLVM IR (-O2):
define void @tapdev_close(i32 %0, i8* %1) {
%3 = tail call i32 @__tuntap_close(i32 %0, i8* %1)
ret void
}
/* Variables and functions */
float cos(float);
float dg(float x) { return cos(x); }


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

x86 assembly (clang, -O2):
<dg>:
jmp    1030 <cos@plt>

LLVM IR (-O0):
define float @dg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @cos(float %3)
ret float %4
}

LLVM IR (-O2):
define float @dg(float %0) {
%2 = tail call float @cos(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ start_game();
int main() {
  start_game();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start_game()
ret i32 0
}
int close(int fd) {
  long __res, dummy;
  __asm__ __volatile__("int $0x80"
                       : "=a"(__res), "=&b"(dummy)
                       : "0"(6), "1"((long)(fd)));
  return (int)__res;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
movslq -0xc(%rbp),%rbx
mov    $0x6,%eax
int    $0x80
mov    %rax,-0x18(%rbp)
mov    %rbx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
movslq %edi,%rbx
mov    $0x6,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,~{dirflag},~{fpsr},~{flags}"(i64 6, i64 %6)
%8 = extractvalue { i64, i64 } %7, 0
%9 = extractvalue { i64, i64 } %7, 1
store i64 %8, i64* %3
store i64 %9, i64* %4
%10 = load i64, i64* %3
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call { i64, i64 } asm sideeffect "int $$0x80", "={ax},=&{bx},0,1,~{dirflag},~{fpsr},~{flags}"(i64 6, i64 %2)
%4 = extractvalue { i64, i64 } %3, 0
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int ya_pthread_mutex_lock(pthread_mutex_t *mutex, const char *file, int line) {
  int ret;
  ret = pthread_mutex_lock(mutex);
  return ret;
}


x86 assembly (clang, -O0):
<ya_pthread_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_lock@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ya_pthread_mutex_lock>:
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @ya_pthread_mutex_lock(i32* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @pthread_mutex_lock(i32* %0)
ret i32 %4
}
/* Variables and functions */
int Tql2(int, double *, double *, double **);
int /*<<< orphan*/ Tred2(int, double **, double *, double *, double **);
int EigenRealSymmetric(int n, double **a, double *w, double **z, double *fv) {
  int rc;
  Tred2(n, a, w, fv, z);
  rc = Tql2(n, w, fv, z);
  return rc;
}


x86 assembly (clang, -O0):
<EigenRealSymmetric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <Tred2@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <Tql2@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EigenRealSymmetric>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %r8,%rcx
mov    %r14,%r8
call   1030 <Tred2@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <Tql2@plt>

LLVM IR (-O0):
define i32 @EigenRealSymmetric(i32 %0, double** %1, double* %2, double** %3, double* %4) {
%6 = alloca i32
%7 = alloca double**
%8 = alloca double*
%9 = alloca double**
%10 = alloca double*
%11 = alloca i32
store i32 %0, i32* %6
store double** %1, double*** %7
store double* %2, double** %8
store double** %3, double*** %9
store double* %4, double** %10
%12 = load i32, i32* %6
%13 = load double**, double*** %7
%14 = load double*, double** %8
%15 = load double*, double** %10
%16 = load double**, double*** %9
%17 = call i32 @Tred2(i32 %12, double** %13, double* %14, double* %15, double** %16)
%18 = load i32, i32* %6
%19 = load double*, double** %8
%20 = load double*, double** %10
%21 = load double**, double*** %9
%22 = call i32 @Tql2(i32 %18, double* %19, double* %20, double** %21)
store i32 %22, i32* %11
%23 = load i32, i32* %11
ret i32 %23
}

LLVM IR (-O2):
define i32 @EigenRealSymmetric(i32 %0, double** %1, double* %2, double** %3, double* %4) {
%6 = tail call i32 @Tred2(i32 %0, double** %1, double* %2, double* %4, double** %3)
%7 = tail call i32 @Tql2(i32 %0, double* %2, double* %4, double** %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
double squareRoot(int);
int main() {
  int num;
  printf("Enter a number :\n");
  scanf("%d", &num);
  printf("Square root of %d is %f", num, squareRoot(num));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <squareRoot@plt>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1060 <squareRoot@plt>
lea    0xe8f(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a number :\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Square root of %d is %f\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = load i32, i32* %1
%6 = call double @squareRoot(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %4, double %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Square root of %d is %f\00"
@str = [17 x i8] c"Enter a number :\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call double @squareRoot(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mem_free(char **);
char **sys_list(char const *, int *);
extern int sys_empty(const char *dir) {
  int num_files;
  char **files = sys_list(dir, &num_files);
  int res = num_files == 0;
  mem_free(files);
  return res;
}


x86 assembly (clang, -O0):
<sys_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <sys_list@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <mem_free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_empty>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
call   1040 <sys_list@plt>
xor    %ebx,%ebx
cmpl   $0x0,0xc(%rsp)
sete   %bl
mov    %rax,%rdi
call   1030 <mem_free@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sys_empty(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8** @sys_list(i8* %6, i32* %3)
store i8** %7, i8*** %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i8**, i8*** %4
%12 = call i32 @mem_free(i8** %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @sys_empty(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i8** @sys_list(i8* %0, i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @mem_free(i8** %4)
ret i32 %7
}
char __SubStrings__ASCII__UpperC(const char C) {
  if (C >= 'a' && C <= 'z')
    return C - ('a' - 'A');
  else
    return C;
}


x86 assembly (clang, -O0):
<__SubStrings__ASCII__UpperC>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <__SubStrings__ASCII__UpperC+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <__SubStrings__ASCII__UpperC+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <__SubStrings__ASCII__UpperC+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SubStrings__ASCII__UpperC>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @__SubStrings__ASCII__UpperC(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @__SubStrings__ASCII__UpperC(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
double Dsub(double x, double y) { return x - y; }


x86 assembly (clang, -O0):
<Dsub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dsub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Dsub(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Dsub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
int largest(int num1, int num2, int num3) {
  if (num1 > num2) {
    if (num1 > num3) {
      return num1;
    } else {
      return num3;
    }
  }
  if (num2 > num3)
    return num2;
  return num3;
}


x86 assembly (clang, -O0):
<largest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <largest+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <largest+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <largest+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <largest+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <largest+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <largest+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<largest>:
mov    %edx,%eax
cmp    %edx,%edi
cmovg  %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @largest(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Variables and functions */
int _sapi_inet_tcp_receive(int, void *, int);
int sapi_unix_tcp_receive(int sock, void *data, int datalen) {
  return _sapi_inet_tcp_receive(sock, data, datalen);
}


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

x86 assembly (clang, -O2):
<sapi_unix_tcp_receive>:
jmp    1030 <_sapi_inet_tcp_receive@plt>

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

LLVM IR (-O2):
define i32 @sapi_unix_tcp_receive(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @_sapi_inet_tcp_receive(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
unsigned long __VERIFIER_nondet_ulong(void) {
  unsigned long ul;
  { return (ul); }
}


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

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

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

LLVM IR (-O2):
define i64 @__VERIFIER_nondet_ulong() {
ret i64 undef
}
/* Type definitions */
struct mainwindow {
  int dummy;
};

/* Variables and functions */
int download_item(struct mainwindow *);
int handle_download(struct mainwindow *mw) { return download_item(mw); }


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

x86 assembly (clang, -O2):
<handle_download>:
jmp    1030 <download_item@plt>

LLVM IR (-O0):
%struct.mainwindow = type { i32 }
define i32 @handle_download(%struct.mainwindow* %0) {
%2 = alloca %struct.mainwindow*
store %struct.mainwindow* %0, %struct.mainwindow** %2
%3 = load %struct.mainwindow*, %struct.mainwindow** %2
%4 = call i32 @download_item(%struct.mainwindow* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.mainwindow = type { i32 }
define i32 @handle_download(%struct.mainwindow* %0) {
%2 = tail call i32 @download_item(%struct.mainwindow* %0)
ret i32 %2
}
int test_imm_B9uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 185
%5 = icmp ne i64 %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_B9uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 185
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void oops(void) {
  printf("oops!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<oops>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<oops>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"oops!\0A\00"
define void @oops() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [6 x i8] c"oops!\00"
define void @oops() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void qcom_variant_init(struct mmci_host *host) {}


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

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

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

LLVM IR (-O2):
%struct.mmci_host = type opaque
define void @qcom_variant_init(%struct.mmci_host* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x4f() {
  Assert_real((isprint(79)),
              "/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_isprint.c",
              400, ("isprint should be 1 for O"));
}


x86 assembly (clang, -O0):
<t_isprint_0x4f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4f,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x190,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x4f>:
push   %rax
mov    $0x4f,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x190,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for O\00"
define void @t_isprint_0x4f() {
%1 = call i32 @isprint(i32 79)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for O\00"
define void @t_isprint_0x4f() {
%1 = tail call i32 @isprint(i32 79)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ find_track_regex(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rstrip(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  char search_for[80];
  printf("Search for: ");
  fgets(search_for, 80, stdin);
  rstrip(search_for);
  find_track(search_for);
  find_track_regex(search_for);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
lea    -0x60(%rbp),%rdi
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1060 <fgets@plt>
lea    -0x60(%rbp),%rdi
call   1030 <rstrip@plt>
lea    -0x60(%rbp),%rdi
call   1040 <find_track@plt>
lea    -0x60(%rbp),%rdi
call   1070 <find_track_regex@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1030 <rstrip@plt>
mov    %rbx,%rdi
call   1040 <find_track@plt>
mov    %rbx,%rdi
call   1070 <find_track_regex@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 80, i32 %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%12 = call i32 @rstrip(i8* %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%14 = call i32 @find_track(i8* %13)
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%16 = call i32 @find_track_regex(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %4, i32 80, i32 %6)
%8 = call i32 @rstrip(i8* %4)
%9 = call i32 @find_track(i8* %4)
%10 = call i32 @find_track_regex(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_bufferoverflow();
int /*<<< orphan*/ test_compress();
int main(void) {
  test_compress();
  test_bufferoverflow();
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_compress@plt>
mov    $0x0,%al
call   1040 <test_bufferoverflow@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_compress@plt>
xor    %eax,%eax
call   1040 <test_bufferoverflow@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_compress()
%3 = call i32 (...) @test_bufferoverflow()
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_compress()
%2 = tail call i32 (...) @test_bufferoverflow()
%3 = tail call i32 @_exit(i32 0)
unreachable
}