xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ESPIPE;
int /*<<< orphan*/ errno;
long int ftell(FILE *stream) {
  errno = ESPIPE;
  return -1;
}


x86 assembly (clang, -O0):
<ftell>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftell>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@ESPIPE = global i32 0
@errno = global i32 0
define i64 @ftell(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ESPIPE
store i32 %3, i32* @errno
ret i64 -1
}

LLVM IR (-O2):
@ESPIPE = global i32 0
@errno = global i32 0
define i64 @ftell(i32* nocapture readnone %0) {
%2 = load i32, i32* @ESPIPE
store i32 %2, i32* @errno
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
char *get_item_field_id(int class_num, int field_num, int item_num) {
  static char name[32];
  sprintf(name, "%d.%d.%d", class_num, field_num + 1, item_num);
  return name;
}


x86 assembly (clang, -O0):
<get_item_field_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    -0xc(%rbp),%r8d
lea    0x2f0b(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_item_field_id>:
push   %rbx
mov    %edx,%r8d
mov    %edi,%edx
lea    0x1(%rsi),%ecx
lea    0x2f20(%rip),%rbx
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_item_field_id.name = internal global [32 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @get_item_field_id(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 = add nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_id.name, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %10)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_id.name, i64 0, i64 0)
}

LLVM IR (-O2):
@get_item_field_id.name = internal global [32 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @get_item_field_id(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_id.name, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4, i32 %2)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @get_item_field_id.name, i64 0, i64 0)
}
int C(int x, int y) { return ~x + ~y + 1 == ~(x + y); }


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
mov    %esi,%ecx
not    %ecx
sub    %edi,%ecx
add    %edi,%esi
not    %esi
xor    %eax,%eax
cmp    %esi,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @C(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
%14 = xor i32 %13, -1
%15 = icmp eq i32 %10, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @C(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = sub i32 %3, %0
%5 = add nsw i32 %1, %0
%6 = xor i32 %5, -1
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int specialBits(void) { return 4291444735; }


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

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

LLVM IR (-O0):
define i32 @specialBits() {
ret i32 -3522561
}

LLVM IR (-O2):
define i32 @specialBits() {
ret i32 -3522561
}
void PKCS8_set_broken(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS8_set_broken() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void init_doc() {
  write("msproject.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", NULL);
  write("msproject.xml",
        "<Project xmlns=\"http://schemas.microsoft.com/project\">\n", NULL);
}


x86 assembly (clang, -O0):
<init_doc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
lea    0xece(%rip),%rdi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_doc>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xeef(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <write@plt>
lea    0xf06(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.2 = [56 x i8] c"<Project xmlns=\22http://schemas.microsoft.com/project\22>\0A\00"
define void @init_doc() {
%1 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.2 = [56 x i8] c"<Project xmlns=\22http://schemas.microsoft.com/project\22>\0A\00"
define void @init_doc() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i32* null)
ret void
}
int test_imm_72int64_lowword_reg(long long val) {
  return ((val) & (0x72 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_72int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 114
%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_72int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 114
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Start();
int /*<<< orphan*/ Stop();
void main(void) {
  Start();
  Stop();
  return;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <Start@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <Stop@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @Start()
%2 = tail call i32 (...) @Stop()
ret void
}
void sh_css_dump_sp_dmem(void) {}


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

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

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

LLVM IR (-O2):
define void @sh_css_dump_sp_dmem() {
ret void
}
/* Variables and functions */
int sqrt(int);
int isprime(int n) {
  for (int d = 3; d < sqrt(n) + 1; d++) {
    if (n % d == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%ecx
cmp    %ecx,%eax
jge    116f <isprime+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    115c <isprime+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1176 <isprime+0x66>
jmp    1161 <isprime+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <isprime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x3,%ecx
jl     1152 <isprime+0x42>
mov    $0x2,%ebx
nopl   (%rax)
add    $0x1,%ebx
mov    %r14d,%eax
cltd
idiv   %ebx
mov    %edx,%ebp
test   %edx,%edx
je     114b <isprime+0x3b>
mov    %r14d,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <isprime+0x20>
xor    %eax,%eax
test   %ebp,%ebp
setne  %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp slt i32 %2, 3
br i1 %3, label %15, label %8
4: ; preds = %8
%5 = add nuw nsw i32 %9, 1
%6 = tail call i32 @sqrt(i32 %0)
%7 = icmp slt i32 %9, %6
br i1 %7, label %8, label %12
8: ; preds = %1, %4
%9 = phi i32 [ %5, %4 ], [ 3, %1 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %8, %4
%13 = xor i1 %11, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %1
%16 = phi i32 [ 1, %1 ], [ %14, %12 ]
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ftell(int /*<<< orphan*/ *);
off_t ftello(FILE *file) { return ftell(file); }


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

x86 assembly (clang, -O2):
<ftello>:
jmp    1030 <ftell@plt>

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

LLVM IR (-O2):
define i32 @ftello(i32* nocapture %0) {
%2 = tail call i32 @ftell(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *ft_memcpy(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ ft_strlen(char const *);
char *ft_strcpy(char *dst, const char *src) {
  return (ft_memcpy(dst, src, ft_strlen(src)));
}


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

x86 assembly (clang, -O2):
<ft_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <ft_strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ft_memcpy@plt>

LLVM IR (-O0):
define i8* @ft_strcpy(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 = load i8*, i8** %4
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i8* @ft_memcpy(i8* %5, i8* %6, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @ft_strcpy(i8* %0, i8* %1) {
%3 = tail call i32 @ft_strlen(i8* %1)
%4 = tail call i8* @ft_memcpy(i8* %0, i8* %1, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x44_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x44_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x44_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x44_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x44_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
struct elf32_hdr {
  scalar_t__ e_machine;
  int e_entry;
};

/* Variables and functions */
scalar_t__ EM_UNICORE;
int elf_check_arch(const struct elf32_hdr *x) {
  if (x->e_machine != EM_UNICORE)
    return 0;
  if (x->e_entry & 3)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<elf_check_arch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
je     112b <elf_check_arch+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1151 <elf_check_arch+0x51>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     114a <elf_check_arch+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <elf_check_arch+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_check_arch>:
mov    (%rdi),%rcx
mov    0x2ede(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
jne    111a <elf_check_arch+0x1a>
xor    %eax,%eax
testb  $0x3,0x8(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.elf32_hdr = type { i64, i32 }
@EM_UNICORE = global i64 0
define i32 @elf_check_arch(%struct.elf32_hdr* %0) {
%2 = alloca i32
%3 = alloca %struct.elf32_hdr*
store %struct.elf32_hdr* %0, %struct.elf32_hdr** %3
%4 = load %struct.elf32_hdr*, %struct.elf32_hdr** %3
%5 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @EM_UNICORE
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %18
10: ; preds = %1
%11 = load %struct.elf32_hdr*, %struct.elf32_hdr** %3
%12 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = and i32 %13, 3
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 0, i32* %2
br label %18
17: ; preds = %10
store i32 1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.elf32_hdr = type { i64, i32 }
@EM_UNICORE = global i64 0
define i32 @elf_check_arch(%struct.elf32_hdr* nocapture %0) {
%2 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @EM_UNICORE
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.elf32_hdr, %struct.elf32_hdr* %0, i64 0, i32 1
%8 = load i32, i32* %7
%9 = and i32 %8, 3
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
int test_imm_EBint8_mem(signed char *val) {
  return ((*val) & (-0xEB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EBint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff15,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EBint8_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, -235
%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_EBint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -235
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
struct statfs64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __statfs64(const char *file, struct statfs64 *buf) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__statfs64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__statfs64>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs64 = type { i32 }
@ENOSYS = global i32 0
define i32 @__statfs64(i8* %0, %struct.statfs64* %1) {
%3 = alloca i8*
%4 = alloca %struct.statfs64*
store i8* %0, i8** %3
store %struct.statfs64* %1, %struct.statfs64** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.statfs64 = type { i32 }
@ENOSYS = global i32 0
define i32 @__statfs64(i8* nocapture readnone %0, %struct.statfs64* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ b_pawn_defenders_from_east(int);
void b_pawn_defenders_from_east_test(void **state) {
  assert_int_equal(0x0000100000000000ul,
                   b_pawn_defenders_from_east(0x0000100800000000ul));
}


x86 assembly (clang, -O0):
<b_pawn_defenders_from_east_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <b_pawn_defenders_from_east@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_pawn_defenders_from_east_test>:
push   %rax
xor    %edi,%edi
call   1030 <b_pawn_defenders_from_east@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

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

LLVM IR (-O2):
define void @b_pawn_defenders_from_east_test(i8** nocapture readnone %0) {
%2 = tail call i32 @b_pawn_defenders_from_east(i32 0)
%3 = tail call i32 @assert_int_equal(i32 0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ COLOR_MATRIX_STRINGS;

/* Variables and functions */
int /*<<< orphan*/ print_enum(char *, char const **, int);
void print_color_matrix() {
  static const char *COLOR_MATRIX_STRINGS[] = {
      "HDTV",
      "SDTV",
      "Reversible",
      "RGB",
  };
  print_enum(
      "color_matrix", COLOR_MATRIX_STRINGS,
      (sizeof(COLOR_MATRIX_STRINGS) / sizeof((COLOR_MATRIX_STRINGS)[0])));
}


x86 assembly (clang, -O0):
<print_color_matrix>:
push   %rbp
mov    %rsp,%rbp
lea    0xefe(%rip),%rdi
lea    0x2f0e(%rip),%rsi
mov    $0x4,%edx
call   1030 <print_enum@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_color_matrix>:
lea    0xf02(%rip),%rdi
lea    0x2f12(%rip),%rsi
mov    $0x4,%edx
jmp    1030 <print_enum@plt>

LLVM IR (-O0):
@print_color_matrix.COLOR_MATRIX_STRINGS = internal global [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0)]
@.str = [5 x i8] c"HDTV\00"
@.str.1 = [5 x i8] c"SDTV\00"
@.str.2 = [11 x i8] c"Reversible\00"
@.str.3 = [4 x i8] c"RGB\00"
@.str.4 = [13 x i8] c"color_matrix\00"
define void @print_color_matrix() {
%1 = call i32 @print_enum(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @print_color_matrix.COLOR_MATRIX_STRINGS, i64 0, i64 0), i32 4)
ret void
}

LLVM IR (-O2):
@print_color_matrix.COLOR_MATRIX_STRINGS = internal global [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0)]
@.str = [5 x i8] c"HDTV\00"
@.str.1 = [5 x i8] c"SDTV\00"
@.str.2 = [11 x i8] c"Reversible\00"
@.str.3 = [4 x i8] c"RGB\00"
@.str.4 = [13 x i8] c"color_matrix\00"
define void @print_color_matrix() {
%1 = tail call i32 @print_enum(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @print_color_matrix.COLOR_MATRIX_STRINGS, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x05() {
  Assert_real((isodigit(5) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              30, ("isodigit should be 0 for 0x05"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x05>:
push   %rax
mov    $0x5,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x05\00"
define void @t_isodigit_0x05() {
%1 = call i64 @isodigit(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x05\00"
define void @t_isodigit_0x05() {
%1 = tail call i64 @isodigit(i32 5)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void XFillArcs() {}


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

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

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

LLVM IR (-O2):
define void @XFillArcs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void f5(char *source) {
  char *destination1 = 0;
  char *destination2 = destination1 + 0;
  memcpy(destination2, source, 10);
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xa,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0xa,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @f5(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %2
%9 = call i32 @memcpy(i8* %7, i8* %8, i32 10)
ret void
}

LLVM IR (-O2):
define void @f5(i8* %0) {
%2 = tail call i32 @memcpy(i8* null, i8* %0, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int main() {
  test1();
  printf("PASS\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int rot_r_asm(int x, unsigned count) {
  asm("ror %%cl, %[x]" : [x] "+r"(x) : "c"(count) : "cc");
  return x;
}


x86 assembly (clang, -O0):
<rot_r_asm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
ror    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot_r_asm>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rot_r_asm(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 asm "ror %cl, $0", "=r,{cx},0,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %5)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @rot_r_asm(i32 %0, i32 %1) {
%3 = tail call i32 asm "ror %cl, $0", "=r,{cx},0,~{cc},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %0)
ret i32 %3
}
int ptrcmp(const void *a, const void *b) {
  if (a < b)
    return -1;
  if (a > b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ptrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <ptrcmp+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <ptrcmp+0x47>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1140 <ptrcmp+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <ptrcmp+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrcmp>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ptrcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sqrt(int);
int main() {
  int a = sqrt(4);
  printf("%d", a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <sqrt@plt>
lea    0xece(%rip),%rdi
mov    %eax,%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 = call i32 @sqrt(i32 4)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @sqrt(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int quit() { exit(0); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @quit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @quit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int hash(char *, int);
int rehash(char *c, int size, int i) {
  return (hash(c, size) + (i - 1) * (i - 1)) % size;
}


x86 assembly (clang, -O0):
<rehash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <hash@plt>
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
add    %ecx,%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rehash>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <hash@plt>
add    $0xffffffff,%ebx
imul   %ebx,%ebx
add    %ebx,%eax
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rehash(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @hash(i8* %7, i32 %8)
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = mul nsw i32 %11, %13
%15 = add nsw i32 %9, %14
%16 = load i32, i32* %5
%17 = srem i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @rehash(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @hash(i8* %0, i32 %1)
%5 = add nsw i32 %2, -1
%6 = mul nsw i32 %5, %5
%7 = add nsw i32 %4, %6
%8 = srem i32 %7, %1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ unfixed_code();
int main(void) {
  printf("Before non-validating instruction\n");
  fflush(stdout);
  unfixed_code();
  printf("After non-validating instruction\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <unfixed_code@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <unfixed_code@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Before non-validating instruction\0A\00"
@stdout = global i32 0
@.str.1 = [34 x i8] c"After non-validating instruction\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = call i32 (...) @unfixed_code()
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [34 x i8] c"Before non-validating instruction\00"
@str.2 = [33 x i8] c"After non-validating instruction\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @unfixed_code()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int ucharGreaterThan(void const *, void const *);
int ucharLessThan(const void *a, const void *b) {
  return ucharGreaterThan(b, a);
}


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

x86 assembly (clang, -O2):
<ucharLessThan>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <ucharGreaterThan@plt>

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

LLVM IR (-O2):
define i32 @ucharLessThan(i8* %0, i8* %1) {
%3 = tail call i32 @ucharGreaterThan(i8* %1, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ne_safefree(void *p) {
  if (p) {
    free(p);
  }
}


x86 assembly (clang, -O0):
<ne_safefree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ne_safefree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_safefree>:
test   %rdi,%rdi
je     111a <ne_safefree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ne_safefree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ne_safefree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_D3int64_highword_reg(long long val) {
  return ((val >> 32) & (0xD3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D3int64_highword_reg>:
movabs $0xd300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D3int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 211
%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_D3int64_highword_reg(i64 %0) {
%2 = and i64 %0, 906238099456
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned int setBit(unsigned int, int);
unsigned int *setBitBV(unsigned int *bitVector, int pos) {
  int vectorIndex = pos / 32;
  int relativePos = pos % 32;
  bitVector[vectorIndex] = setBit(bitVector[vectorIndex], relativePos);
  return bitVector;
}


x86 assembly (clang, -O0):
<setBitBV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x14(%rbp),%esi
call   1030 <setBit@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBitBV>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x1f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
and    $0xffffffe0,%ecx
sub    %ecx,%esi
sar    $0x5,%eax
movslq %eax,%rbx
mov    (%rdi,%rbx,4),%edi
call   1030 <setBit@plt>
mov    %eax,(%r14,%rbx,4)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @setBitBV(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sdiv i32 %7, 32
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = srem i32 %9, 32
store i32 %10, i32* %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = load i32, i32* %6
%17 = call i32 @setBit(i32 %15, i32 %16)
%18 = load i32*, i32** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32*, i32** %3
ret i32* %22
}

LLVM IR (-O2):
define i32* @setBitBV(i32* returned %0, i32 %1) {
%3 = sdiv i32 %1, 32
%4 = srem i32 %1, 32
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @setBit(i32 %7, i32 %4)
store i32 %8, i32* %6
ret i32* %0
}
/* Variables and functions */
int Button1Mask;
int up_buttonmap(int state) { return ((state & Button1Mask) != 0) ? 1 : 0; }


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

x86 assembly (clang, -O2):
<up_buttonmap>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
test   %edi,(%rcx)
setne  %al
ret

LLVM IR (-O0):
@Button1Mask = global i32 0
define i32 @up_buttonmap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @Button1Mask
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
@Button1Mask = global i32 0
define i32 @up_buttonmap(i32 %0) {
%2 = load i32, i32* @Button1Mask
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) { printf("The value is %d\n", 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x2,%esi
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    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"The value is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
void keyb_none_all_get(unsigned keyboard, unsigned char *code_map) {
  unsigned i;
  log_f("keyb:none: keyb_none_all_get()\n");
  for (i = 0; i < 256; ++i) {
    code_map[i] = 0;
  }
}


x86 assembly (clang, -O0):
<keyb_none_all_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <log_f@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jae    1158 <keyb_none_all_get+0x48>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <keyb_none_all_get+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyb_none_all_get>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <log_f@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rbx)
movups %xmm0,0x10(%rbx)
movups %xmm0,0x20(%rbx)
movups %xmm0,0x30(%rbx)
movups %xmm0,0x40(%rbx)
movups %xmm0,0x50(%rbx)
movups %xmm0,0x60(%rbx)
movups %xmm0,0x70(%rbx)
movups %xmm0,0x80(%rbx)
movups %xmm0,0x90(%rbx)
movups %xmm0,0xa0(%rbx)
movups %xmm0,0xb0(%rbx)
movups %xmm0,0xc0(%rbx)
movups %xmm0,0xd0(%rbx)
movups %xmm0,0xe0(%rbx)
movups %xmm0,0xf0(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"keyb:none: keyb_none_all_get()\0A\00"
define void @keyb_none_all_get(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 @log_f(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %5
%9 = icmp ult i32 %8, 256
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8 0, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"keyb:none: keyb_none_all_get()\0A\00"
define void @keyb_none_all_get(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @log_f(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ feed_sig(char);
void srelay_exit() { feed_sig('T'); }


x86 assembly (clang, -O0):
<srelay_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x54,%edi
call   1030 <feed_sig@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<srelay_exit>:
mov    $0x54,%edi
jmp    1030 <feed_sig@plt>

LLVM IR (-O0):
define void @srelay_exit() {
%1 = call i32 @feed_sig(i8 signext 84)
ret void
}

LLVM IR (-O2):
define void @srelay_exit() {
%1 = tail call i32 @feed_sig(i8 signext 84)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int w5100_readSn(unsigned int, int, int /*<<< orphan*/ *, int);
unsigned readSnDIPR(unsigned sock, uint8_t *buf) {
  return w5100_readSn(sock, 0x000C, buf, 4);
}


x86 assembly (clang, -O0):
<readSnDIPR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xc,%esi
mov    $0x4,%ecx
call   1030 <w5100_readSn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readSnDIPR>:
mov    %rsi,%rdx
mov    $0xc,%esi
mov    $0x4,%ecx
jmp    1030 <w5100_readSn@plt>

LLVM IR (-O0):
define i32 @readSnDIPR(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 @w5100_readSn(i32 %5, i32 12, i32* %6, i32 4)
ret i32 %7
}

LLVM IR (-O2):
define i32 @readSnDIPR(i32 %0, i32* %1) {
%3 = tail call i32 @w5100_readSn(i32 %0, i32 12, i32* %1, i32 4)
ret i32 %3
}