xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char const *);
void *do_nofail(void *ptr, const char *expr) {
  if (!ptr) {
    fatal("modpost: Memory allocation failure: %s.\n", expr);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<do_nofail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113b <do_nofail+0x2b>
mov    -0x10(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_nofail>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1125 <do_nofail+0x15>
lea    0xee0(%rip),%rdi
call   1030 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"modpost: Memory allocation failure: %s.\0A\00"
define i8* @do_nofail(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 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [41 x i8] c"modpost: Memory allocation failure: %s.\0A\00"
define i8* @do_nofail(i8* readnone returned %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %6
6: ; preds = %4, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stderr;
void dmce_probe_body(unsigned int probenbr) {
  fprintf(stderr, "\nDMCE_PROBE(%u)\n ", probenbr);
}


x86 assembly (clang, -O0):
<dmce_probe_body>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmce_probe_body>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"\0ADMCE_PROBE(%u)\0A \00"
define void @dmce_probe_body(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"\0ADMCE_PROBE(%u)\0A \00"
define void @dmce_probe_body(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct port_queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_queue(struct port_queue *);
int /*<<< orphan*/ free(struct port_queue *);
scalar_t__ is_empty(struct port_queue *);
void free_queue(struct port_queue *pqueue) {
  if (is_empty(pqueue) == 0) {
    clear_queue(pqueue);
  }
  free(pqueue);
}


x86 assembly (clang, -O0):
<free_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <is_empty@plt>
cmp    $0x0,%rax
jne    1158 <free_queue+0x28>
mov    -0x8(%rbp),%rdi
call   1050 <clear_queue@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_queue>:
push   %rbx
mov    %rdi,%rbx
call   1040 <is_empty@plt>
test   %rax,%rax
jne    1146 <free_queue+0x16>
mov    %rbx,%rdi
call   1050 <clear_queue@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.port_queue = type { i32 }
define void @free_queue(%struct.port_queue* %0) {
%2 = alloca %struct.port_queue*
store %struct.port_queue* %0, %struct.port_queue** %2
%3 = load %struct.port_queue*, %struct.port_queue** %2
%4 = call i64 @is_empty(%struct.port_queue* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.port_queue*, %struct.port_queue** %2
%8 = call i32 @clear_queue(%struct.port_queue* %7)
br label %9
9: ; preds = %6, %1
%10 = load %struct.port_queue*, %struct.port_queue** %2
%11 = call i32 @free(%struct.port_queue* %10)
ret void
}

LLVM IR (-O2):
%struct.port_queue = type { i32 }
define void @free_queue(%struct.port_queue* %0) {
%2 = tail call i64 @is_empty(%struct.port_queue* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @clear_queue(%struct.port_queue* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @free(%struct.port_queue* %0)
ret void
}
/* Variables and functions */
size_t divup(size_t const a, size_t const b) { return (a + b - 1) / b; }


x86 assembly (clang, -O0):
<divup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<divup>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111a <divup+0x1a>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @divup(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 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = udiv i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @divup(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = udiv i64 %4, %1
ret i64 %5
}
/* Variables and functions */
bool starts_with(const char *str, const char *pre) {
  while (*pre) {
    if (*str++ != *pre++)
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <starts_with+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <starts_with+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <starts_with+0x5d>
jmp    110c <starts_with+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1127 <starts_with+0x27>
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <starts_with+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcrossing_type(void *_p) {
  return (int)((XEvent *)_p)->xcrossing.type;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcrossing_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xcrossing_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xcrossing_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __cpuid_count(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
void cpuid(uint32_t level, int32_t output[4]) {
  __cpuid_count(level, 0, output[0], output[1], output[2], output[3]);
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%r9d
xor    %esi,%esi
call   1030 <__cpuid_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    (%rsi),%edx
mov    0x4(%rsi),%ecx
mov    0x8(%rsi),%r8d
mov    0xc(%rsi),%r9d
xor    %esi,%esi
jmp    1030 <__cpuid_count@plt>

LLVM IR (-O0):
define void @cpuid(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 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
%18 = call i32 @__cpuid_count(i32 %5, i32 0, i32 %8, i32 %11, i32 %14, i32 %17)
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 3
%9 = load i32, i32* %8
%10 = tail call i32 @__cpuid_count(i32 %0, i32 0, i32 %3, i32 %5, i32 %7, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float, char);
int main() {
  int i;
  float n;
  char c;
  printf("Hello World!\n %d\n %2f \n %c", i, n, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
lea    0xed2(%rip),%rdi
movsbl -0xd(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"Hello World!\0A %d\0A %2f \0A %c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 undef, float undef, i8 signext undef)
ret i32 0
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, char const *, int);
int /*<<< orphan*/ skb_put(struct sk_buff *, int);
void h5_slip_msgdelim(struct sk_buff *skb) {
  const char pkt_delim = 0xc0;
  memcpy(skb_put(skb, 1), &pkt_delim, 1);
}


x86 assembly (clang, -O0):
<h5_slip_msgdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0xc0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <skb_put@plt>
mov    %eax,%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h5_slip_msgdelim>:
push   %rax
movb   $0xc0,0x7(%rsp)
mov    $0x1,%esi
call   1030 <skb_put@plt>
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1040 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
define void @h5_slip_msgdelim(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
%3 = alloca i8
store %struct.sk_buff* %0, %struct.sk_buff** %2
store i8 -64, i8* %3
%4 = load %struct.sk_buff*, %struct.sk_buff** %2
%5 = call i32 @skb_put(%struct.sk_buff* %4, i32 1)
%6 = call i32 @memcpy(i32 %5, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define void @h5_slip_msgdelim(%struct.sk_buff* %0) {
%2 = alloca i8
store i8 -64, i8* %2
%3 = tail call i32 @skb_put(%struct.sk_buff* %0, i32 1)
%4 = call i32 @memcpy(i32 %3, i8* %2, i32 1)
ret void
}
char *test_func_00(char *p, int c, int x) {
  do {
    *--p = (char)x;
  } while (--c);
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    110e <test_func_00+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
lea    -0x1(%rsi),%eax
mov    %rax,%rbx
not    %rbx
add    %rdi,%rbx
add    $0x1,%rax
mov    %rbx,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @test_func_00(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
br label %7
7: ; preds = %12, %3
%8 = load i32, i32* %6
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 -1
store i8* %11, i8** %4
store i8 %9, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %5
%14 = add nsw i32 %13, -1
store i32 %14, i32* %5
%15 = icmp ne i32 %14, 0
br i1 %15, label %7, label %16
16: ; preds = %12
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @test_func_00(i8* writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = xor i64 %6, -1
%8 = getelementptr i8, i8* %0, i64 %7
%9 = add nuw nsw i64 %6, 1
ret i8* %8
}
unsigned long CLK_GetClockFreq(void) { return 10000000UL; }


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

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

LLVM IR (-O0):
define i64 @CLK_GetClockFreq() {
ret i64 10000000
}

LLVM IR (-O2):
define i64 @CLK_GetClockFreq() {
ret i64 10000000
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t xorbits4(uint32_t b, int n) {
  (void)n;
  b ^= b >> 16;
  b ^= b >> 8;
  b ^= b >> 4;
  b ^= b >> 2;
  b ^= b >> 1;
  b &= 1;
  return b;
}


x86 assembly (clang, -O0):
<xorbits4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorbits4>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @xorbits4(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = xor i32 %3, %0
%5 = ashr i32 %4, 8
%6 = xor i32 %5, %4
%7 = ashr i32 %6, 4
%8 = xor i32 %7, %6
%9 = ashr i32 %8, 2
%10 = xor i32 %9, %8
%11 = lshr i32 %10, 1
%12 = xor i32 %11, %10
%13 = and i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, double);
int /*<<< orphan*/ stdout;
void update_progress(int current, int total) {
  double pct_done = (double)current * 100 / total;
  printf("Testing area %d/%d (%6.2f%% complete)\r", current, total, pct_done);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<update_progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
movsd  -0x10(%rbp),%xmm0
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_progress>:
push   %rax
mov    %edi,%eax
cvtsi2sd %edi,%xmm0
mulsd  0xed1(%rip),%xmm0
mov    %esi,%edx
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Testing area %d/%d (%6.2f%% complete)\0D\00"
@stdout = global i32 0
define void @update_progress(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 1.000000e+02
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
store double %11, double* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load double, double* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, double %14)
%16 = load i32, i32* @stdout
%17 = call i32 @fflush(i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Testing area %d/%d (%6.2f%% complete)\0D\00"
@stdout = global i32 0
define void @update_progress(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 1.000000e+02
%5 = sitofp i32 %1 to double
%6 = fdiv double %4, %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, double %6)
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
ret void
}
unsigned long align(unsigned long value, unsigned long algn) {
  return ((value + algn - 1) & ~(algn - 1));
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @align(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 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @align(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
void ignore(int unused) { (void)unused; }


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

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

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

LLVM IR (-O2):
define void @ignore(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void update(void) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @update() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_fileno(int /*<<< orphan*/ *);
int __wrap_fileno(FILE *stream) { return dll_fileno(stream); }


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

x86 assembly (clang, -O2):
<__wrap_fileno>:
jmp    1030 <dll_fileno@plt>

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

LLVM IR (-O2):
define i32 @__wrap_fileno(i32* %0) {
%2 = tail call i32 @dll_fileno(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *strdup(char const *);
char *iconv_convert(const char *input) { return strdup(input); }


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

x86 assembly (clang, -O2):
<iconv_convert>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @iconv_convert(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void panic_func(FILE *fp, char *file, int line, char *fmt, va_list ap) {
  fprintf(fp, "Panic!! file..%s line..%d\n", file, line);
  if (fmt) {
    vfprintf(fp, fmt, ap);
  }
}


x86 assembly (clang, -O0):
<panic_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
cmpq   $0x0,-0x20(%rbp)
je     116d <panic_func+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic_func>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbp
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     1155 <panic_func+0x35>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <vfprintf@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Panic!! file..%s line..%d\0A\00"
define void @panic_func(i32* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
%15 = load i8*, i8** %9
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %5
%18 = load i32*, i32** %6
%19 = load i8*, i8** %9
%20 = load i32, i32* %10
%21 = call i32 @vfprintf(i32* %18, i8* %19, i32 %20)
br label %22
22: ; preds = %17, %5
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Panic!! file..%s line..%d\0A\00"
define void @panic_func(i32* nocapture %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
%7 = icmp eq i8* %3, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @vfprintf(i32* %0, i8* %3, i32 %4)
br label %10
10: ; preds = %8, %5
ret void
}
int test_imm_F4int8_reg(signed char val) {
  return ((val) & (-0xF4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F4int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff0c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_F4int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -244
%6 = icmp ne i32 %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_F4int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -244
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct pgpool {
  int dummy;
};

/* Variables and functions */
long pgp_free(struct pgpool *, void *);
long __pgp_free_agent(void *alloc, void *p) {
  return pgp_free((struct pgpool *)alloc, p);
}


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

x86 assembly (clang, -O2):
<__pgp_free_agent>:
jmp    1030 <pgp_free@plt>

LLVM IR (-O0):
%struct.pgpool = type { i32 }
define i64 @__pgp_free_agent(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 = bitcast i8* %5 to %struct.pgpool*
%7 = load i8*, i8** %4
%8 = call i64 @pgp_free(%struct.pgpool* %6, i8* %7)
ret i64 %8
}

LLVM IR (-O2):
%struct.pgpool = type { i32 }
define i64 @__pgp_free_agent(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.pgpool*
%4 = tail call i64 @pgp_free(%struct.pgpool* %3, i8* %1)
ret i64 %4
}
/* Type definitions */
struct storage_info_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ storage_insert(struct storage_info_t *, void *, int);
void storage_insert_front(struct storage_info_t *info, void *new_node) {
  storage_insert(info, new_node, 1);
}


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

x86 assembly (clang, -O2):
<storage_insert_front>:
mov    $0x1,%edx
jmp    1030 <storage_insert@plt>

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

LLVM IR (-O2):
%struct.storage_info_t = type { i32 }
define void @storage_insert_front(%struct.storage_info_t* %0, i8* %1) {
%3 = tail call i32 @storage_insert(%struct.storage_info_t* %0, i8* %1, i32 1)
ret void
}
int test_imm_50uint16_mem(unsigned short *val) {
  return ((*val) & (0x50 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_50uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 80
%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_50uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 80
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_REQ_it;
X509_REQ *X509_REQ_new(void) { return (X509_REQ *)ASN1_item_new(&X509_REQ_it); }


x86 assembly (clang, -O0):
<X509_REQ_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_REQ_new>:
mov    0x2ee1(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@X509_REQ_it = global i32 0
define i32* @X509_REQ_new() {
%1 = call i64 @ASN1_item_new(i32* @X509_REQ_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@X509_REQ_it = global i32 0
define i32* @X509_REQ_new() {
%1 = tail call i64 @ASN1_item_new(i32* @X509_REQ_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void catch_segv(int sig) { printf("SEGV\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"SEGV\00"
define void @catch_segv(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int is_numa(char *method) {
  char *numa_string = method + strlen(method) - strlen("numa_multiply");
  if (strcmp(numa_string, "numa_multiply") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_numa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1194 <is_numa+0x74>
movl   $0x1,-0x4(%rbp)
jmp    119b <is_numa+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numa>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%rbx
add    %r14,%rbx
lea    0xec7(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
sub    %rax,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"numa_multiply\00"
define i32 @is_numa(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%11 = sext i32 %10 to i64
%12 = sub i64 0, %11
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %1
store i32 1, i32* %2
br label %19
18: ; preds = %1
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [14 x i8] c"numa_multiply\00"
define i32 @is_numa(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = sub nsw i64 0, %6
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ emit_cmovne_imm(int, int);
int /*<<< orphan*/ emit_cmovs_imm(int /*<<< orphan*/, int);
int /*<<< orphan*/ emit_set_gz32(int, int);
int /*<<< orphan*/ emit_test(int, int);
void emit_set_gz64_32(int rsh, int rsl, int rt) {
  emit_set_gz32(rsl, rt);
  emit_test(rsh, rsh);
  emit_cmovne_imm(1, rt);
  emit_cmovs_imm(0, rt);
}


x86 assembly (clang, -O0):
<emit_set_gz64_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <emit_set_gz32@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <emit_test@plt>
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1050 <emit_cmovne_imm@plt>
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1040 <emit_cmovs_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_set_gz64_32>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    %edx,%esi
call   1030 <emit_set_gz32@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1060 <emit_test@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1050 <emit_cmovne_imm@plt>
xor    %edi,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <emit_cmovs_imm@plt>

LLVM IR (-O0):
define void @emit_set_gz64_32(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* %5
%8 = load i32, i32* %6
%9 = call i32 @emit_set_gz32(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @emit_test(i32 %10, i32 %11)
%13 = load i32, i32* %6
%14 = call i32 @emit_cmovne_imm(i32 1, i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @emit_cmovs_imm(i32 0, i32 %15)
ret void
}

LLVM IR (-O2):
define void @emit_set_gz64_32(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit_set_gz32(i32 %1, i32 %2)
%5 = tail call i32 @emit_test(i32 %0, i32 %0)
%6 = tail call i32 @emit_cmovne_imm(i32 1, i32 %2)
%7 = tail call i32 @emit_cmovs_imm(i32 0, i32 %2)
ret void
}
void posix_class2P_GRAPH() {}


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

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

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

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

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int);
void slow_cat(FILE *source) {
  int c;
  while ((c = fgetc(source)) != EOF)
    putchar(c);
}


x86 assembly (clang, -O0):
<slow_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%eax
je     1154 <slow_cat+0x34>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
jmp    112c <slow_cat+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slow_cat>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <fgetc@plt>
mov    0x2eb5(%rip),%r14
cmp    (%r14),%eax
je     1154 <slow_cat+0x34>
nopl   0x0(%rax,%rax,1)
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <fgetc@plt>
cmp    (%r14),%eax
jne    1140 <slow_cat+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @slow_cat(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 @fgetc(i32* %0)
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %5
11: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int iopl(int);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
void set_iopl(void) {
  if (iopl(3) == -1) {
    perror(NULL);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<set_iopl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <iopl@plt>
cmp    $0xffffffff,%eax
jne    115a <set_iopl+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_iopl>:
push   %rax
mov    $0x3,%edi
call   1030 <iopl@plt>
cmp    $0xffffffff,%eax
je     1142 <set_iopl+0x12>
pop    %rax
ret
xor    %edi,%edi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @set_iopl() {
%1 = call i32 @iopl(i32 3)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @perror(i32* null)
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @set_iopl() {
%1 = tail call i32 @iopl(i32 3)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i32* null)
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}
unsigned hash_string(char *string, unsigned range_min, unsigned range_max) {
  unsigned hash = 31;
  char *curr = string;
  while (*curr) {
    hash = 31 * hash + *curr;
    curr++;
  }
  return (hash % (range_max - range_min)) + range_min;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1f,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <hash_string+0x4b>
imul   $0x1f,-0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111d <hash_string+0x1d>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    %edx,%r8d
mov    (%rdi),%dl
test   %dl,%dl
je     1139 <hash_string+0x39>
add    $0x1,%rdi
mov    $0x1f,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
shl    $0x5,%ecx
sub    %eax,%ecx
movsbl %dl,%eax
add    %ecx,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1120 <hash_string+0x20>
jmp    113e <hash_string+0x3e>
mov    $0x1f,%eax
sub    %esi,%r8d
xor    %edx,%edx
div    %r8d
add    %edx,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @hash_string(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 31, i32* %7
%9 = load i8*, i8** %4
store i8* %9, i8** %8
br label %10
10: ; preds = %14, %3
%11 = load i8*, i8** %8
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32, i32* %7
%16 = mul i32 31, %15
%17 = load i8*, i8** %8
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = add i32 %16, %19
store i32 %20, i32* %7
%21 = load i8*, i8** %8
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %8
br label %10
23: ; preds = %10
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = load i32, i32* %5
%27 = sub i32 %25, %26
%28 = urem i32 %24, %27
%29 = load i32, i32* %5
%30 = add i32 %28, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i8* [ %13, %6 ], [ %0, %3 ]
%9 = phi i32 [ %12, %6 ], [ 31, %3 ]
%10 = mul i32 %9, 31
%11 = sext i8 %7 to i32
%12 = add i32 %10, %11
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3
%17 = phi i32 [ 31, %3 ], [ %12, %6 ]
%18 = sub i32 %2, %1
%19 = urem i32 %17, %18
%20 = add i32 %19, %1
ret i32 %20
}
/* Variables and functions */
int chdir(char const *);
int /*<<< orphan*/ cond_printf(int, char *, char const *);
int change_directory(const char *path) {
  cond_printf(1, "change_directory:%s\n", path);
  return chdir(path);
}


x86 assembly (clang, -O0):
<change_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xec4(%rip),%rsi
call   1040 <cond_printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_directory>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <cond_printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <chdir@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"change_directory:%s\0A\00"
define i32 @change_directory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @cond_printf(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @chdir(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [21 x i8] c"change_directory:%s\0A\00"
define i32 @change_directory(i8* %0) {
%2 = tail call i32 @cond_printf(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @chdir(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int);
void CX4_op66(void) { CX4_immediate_reg(12); }


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

x86 assembly (clang, -O2):
<CX4_op66>:
mov    $0xc,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op66() {
%1 = call i32 @CX4_immediate_reg(i32 12)
ret void
}

LLVM IR (-O2):
define void @CX4_op66() {
%1 = tail call i32 @CX4_immediate_reg(i32 12)
ret void
}
int max(int a, int b) { return b > a ? b : a; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i_ = 3, *j_, k_;
  j_ = &i_;
  printf("%d \n", i_ * *j_ * i_ + *j_);
  return 0;
}


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

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

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

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