xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcat(char *, char *);
int main() {
  char string1[50] = "Hello, ";
  char string2[] = "world!\n";
  strcat(string1, string2);
  printf(string1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x32,%edx
call   1040 <memcpy@plt>
mov    0xed7(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x40(%rbp),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x40(%rsp)
movabs $0xa21646c726f77,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.string1 = [50 x i8] c"Hello, \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.string2 = [8 x i8] c"world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [8 x i8]
store i32 0, i32* %1
%4 = bitcast [50 x i8]* %2 to i8*
%5 = bitcast [8 x i8]* %3 to i8*
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcat(i8* %6, i8* %7)
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string1 = [50 x i8] c"Hello, \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 2851464966991735, i64* %2
%5 = call i32 @strcat(i8* %3, i8* %4)
%6 = call i32 @printf(i8* %3)
ret i32 0
}
/* Variables and functions */
double exp(double);
double AUX2bp1b(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<AUX2bp1b>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @AUX2bp1b(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ VIM_HAPI_StopCapture();
unsigned char V5H_Capture_Stop(void) {
  { return ((unsigned char)VIM_HAPI_StopCapture()); }
}


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

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

LLVM IR (-O0):
define zeroext i8 @V5H_Capture_Stop() {
%1 = call i64 (...) @VIM_HAPI_StopCapture()
%2 = trunc i64 %1 to i8
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @V5H_Capture_Stop() {
%1 = tail call i64 (...) @VIM_HAPI_StopCapture()
%2 = trunc i64 %1 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 10;
  int *p1, *p2;
  p1 = &x;
  p2 = p1;
  printf("Values at p1 and p2 is %d, %d\n", *p1, *p2);
  printf("Addresses pointed by p1 and p2 is "
         "%p %p\n",
         p1, p2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xa,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Values at p1 and p2 is %d, %d\0A\00"
@.str.1 = [41 x i8] c"Addresses pointed by p1 and p2 is %p %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
store i32* %5, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32*, i32** %3
%12 = load i32*, i32** %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32* %11, i32* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Values at p1 and p2 is %d, %d\0A\00"
@.str.1 = [41 x i8] c"Addresses pointed by p1 and p2 is %p %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 10, i32 10)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _xte_free(void *in_memory) { free(in_memory); }


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

x86 assembly (clang, -O2):
<_xte_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_xte_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int b = 14;
  printf("%d", (char *)(&b + 1) - (char *)(&b));
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @swap_buffer() {
%1 = tail call i32 (...) @changeBuffer()
ret void
}
int free_class(struct class_file *clazz) {}


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

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

LLVM IR (-O0):
%struct.class_file = type opaque
define i32 @free_class(%struct.class_file* %0) {
%2 = alloca i32
%3 = alloca %struct.class_file*
store %struct.class_file* %0, %struct.class_file** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.class_file = type opaque
define i32 @free_class(%struct.class_file* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bar0();
void foobar() {
  bar0();
  bar0();
  bar0();
}


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

x86 assembly (clang, -O2):
<foobar>:
push   %rax
xor    %eax,%eax
call   1030 <bar0@plt>
xor    %eax,%eax
call   1030 <bar0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar0@plt>

LLVM IR (-O0):
define void @foobar() {
%1 = call i32 (...) @bar0()
%2 = call i32 (...) @bar0()
%3 = call i32 (...) @bar0()
ret void
}

LLVM IR (-O2):
define void @foobar() {
%1 = tail call i32 (...) @bar0()
%2 = tail call i32 (...) @bar0()
%3 = tail call i32 (...) @bar0()
ret void
}
void check(int *Array, int start, int end, int incr, int value) {
  int ii = 0;
  for (ii = start; ii < end; ii = ii + incr)
    if (Array[ii] != value)
      __builtin_abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    116e <check+0x5e>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
je     115b <check+0x4b>
call   1030 <abort@plt>
jmp    1160 <check+0x50>
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1136 <check+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rax
cmp    %edx,%esi
jge    112e <check+0x1e>
movslq %esi,%rax
movslq %ecx,%rcx
movslq %edx,%rdx
xchg   %ax,%ax
cmp    %r8d,(%rdi,%rax,4)
jne    1130 <check+0x20>
add    %rcx,%rax
cmp    %rdx,%rax
jl     1120 <check+0x10>
pop    %rax
ret
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @check(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp slt i32 %1, %2
br i1 %6, label %7, label %20
7: ; preds = %5
%8 = sext i32 %1 to i64
%9 = sext i32 %3 to i64
%10 = sext i32 %2 to i64
br label %13
11: ; preds = %13
%12 = icmp slt i64 %18, %10
br i1 %12, label %13, label %20
13: ; preds = %7, %11
%14 = phi i64 [ %8, %7 ], [ %18, %11 ]
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, %4
%18 = add i64 %14, %9
br i1 %17, label %11, label %19
19: ; preds = %13
tail call void @abort()
unreachable
20: ; preds = %11, %5
ret void
}
void g_slist_sort() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_sort() {
ret void
}
/* Variables and functions */
size_t utf8size_lazy(void const *);
size_t utf8size(const void *str) { return utf8size_lazy(str) + 1; }


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

x86 assembly (clang, -O2):
<utf8size>:
push   %rax
call   1030 <utf8size_lazy@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @utf8size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @utf8size_lazy(i8* %3)
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @utf8size(i8* %0) {
%2 = tail call i64 @utf8size_lazy(i8* %0)
%3 = add i64 %2, 1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long strtol(char *, int /*<<< orphan*/ *, int);
void test4(char *array, char *endptr) {
  long r = strtol(array + 3, NULL, 1);
  assert(r == 0);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
add    $0x3,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <strtol@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test4(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = call i64 @strtol(i8* %7, i32* null, i32 1)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @test4(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = tail call i64 @strtol(i8* nocapture %3, i32* null, i32 1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xkeymap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xkeymap_send_event(void *_p) {
  return (int)((XEvent *)_p)->xkeymap.send_event;
}


x86 assembly (clang, -O0):
<get_XEvent_xkeymap_send_event>:
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_xkeymap_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xkeymap_send_event(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_xkeymap_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void signal_sigchld(int sig) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
  return;
}


x86 assembly (clang, -O0):
<signal_sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <signal_sigchld+0x31>
jmp    111b <signal_sigchld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_sigchld>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <signal_sigchld+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @signal_sigchld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @signal_sigchld(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_h48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h48_10_sse4() {
ret void
}
unsigned short min(unsigned short a, unsigned short b) {
  return (a < b) ? a : b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    112e <min+0x2e>
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <min+0x35>
movzwl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %ax,%di
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @min(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @min(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp ult i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double gettime() {
  struct timeval time[1];
  gettimeofday(time, 0);
  return ((double)time->tv_sec + (double)time->tv_usec / 1000000);
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x8(%rsp),%xmm1
cvtsi2sdq (%rsp),%xmm0
divsd  0xecd(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @gettime() {
%1 = alloca [1 x %struct.timeval]
%2 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+06
%13 = fadd double %7, %12
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @gettime() {
%1 = alloca [1 x %struct.timeval]
%2 = bitcast [1 x %struct.timeval]* %1 to i8*
%3 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds [1 x %struct.timeval], [1 x %struct.timeval]* %1, i64 0, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %11, %7
ret double %12
}
/* Type definitions */
struct ring_fifo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct ring_fifo *);
int /*<<< orphan*/ free(struct ring_fifo *);
void ring_fifo_free(struct ring_fifo *r) {
  assert(r);
  free(r);
}


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

x86 assembly (clang, -O2):
<ring_fifo_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ring_fifo = type { i32 }
define void @ring_fifo_free(%struct.ring_fifo* %0) {
%2 = alloca %struct.ring_fifo*
store %struct.ring_fifo* %0, %struct.ring_fifo** %2
%3 = load %struct.ring_fifo*, %struct.ring_fifo** %2
%4 = call i32 @assert(%struct.ring_fifo* %3)
%5 = load %struct.ring_fifo*, %struct.ring_fifo** %2
%6 = call i32 @free(%struct.ring_fifo* %5)
ret void
}

LLVM IR (-O2):
%struct.ring_fifo = type { i32 }
define void @ring_fifo_free(%struct.ring_fifo* %0) {
%2 = tail call i32 @assert(%struct.ring_fifo* %0)
%3 = tail call i32 @free(%struct.ring_fifo* %0)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char const *, int);
scalar_t__ strlen(char const *);
char *generate_subdir_name(const char *parent, int i) {
  char *subdir = malloc(strlen(parent) + 50);
  sprintf(subdir, "%s/benchdir.%d", parent, i);
  return subdir;
}


x86 assembly (clang, -O0):
<generate_subdir_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x32,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe96(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_subdir_name>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x32(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbp
lea    0xeae(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1050 <sprintf@plt>
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s/benchdir.%d\00"
define i8* @generate_subdir_name(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 50
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s/benchdir.%d\00"
define noalias i8* @generate_subdir_name(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = add nsw i64 %3, 50
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i8* %5
}
void does_not_give_error(char *w) { w[0] = 'a'; }


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

x86 assembly (clang, -O2):
<does_not_give_error>:
movb   $0x61,(%rdi)
ret

LLVM IR (-O0):
define void @does_not_give_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 97, i8* %4
ret void
}

LLVM IR (-O2):
define void @does_not_give_error(i8* nocapture writeonly %0) {
store i8 97, i8* %0
ret void
}
/* Variables and functions */
double __ocml_cospi_f64(double);
double cospi(double x) { return __ocml_cospi_f64(x); }


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

x86 assembly (clang, -O2):
<cospi>:
jmp    1030 <__ocml_cospi_f64@plt>

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

LLVM IR (-O2):
define double @cospi(double %0) {
%2 = tail call double @__ocml_cospi_f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strstr(char const *, char const *);
int main() {
  const char haystack[20] = "W3CSchool11111";
  const char needle[10] = "School";
  char *ret;
  ret = strstr(haystack, needle);
  printf("子字符串是： %s\n", ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x2a(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x22(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x2a(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xed6(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strstr@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.haystack = [20 x i8] c"W3CSchool11111\00\00\00\00\00\00"
@__const.main.needle = [10 x i8] c"School\00\00\00\00"
@.str = [23 x i8] c"\E5\AD\90\E5\AD\97\E7\AC\A6\E4\B8\B2\E6\98\AF\EF\BC\9A %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [10 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [20 x i8]* %2 to i8*
%6 = bitcast [10 x i8]* %3 to i8*
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.haystack = [20 x i8] c"W3CSchool11111\00\00\00\00\00\00"
@__const.main.needle = [10 x i8] c"School\00\00\00\00"
@.str = [23 x i8] c"\E5\AD\90\E5\AD\97\E7\AC\A6\E4\B8\B2\E6\98\AF\EF\BC\9A %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__const.main.needle, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
__attribute__((no, noclone)) signed __int128 t109_5mul(unsigned __int128 x) {
  signed __int128 r;
  if (__builtin_mul_overflow(x, (unsigned __int128)(65), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t109_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x41,%ecx
mul    %rcx
mov    %rax,%rsi
mov    -0x50(%rbp),%rax
seto   %dl
mov    %dl,-0x41(%rbp)
mul    %rcx
mov    %rax,%rcx
mov    -0x41(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
test   %rdx,%rdx
sets   %sil
or     %sil,%al
mov    %rcx,-0x40(%rbp)
mov    %rdx,-0x38(%rbp)
test   $0x1,%al
jne    1183 <t109_5mul+0x73>
jmp    118a <t109_5mul+0x7a>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t109_5mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    $0x41,%esi
mul    %rsi
mov    %rax,%rcx
mov    %rdi,%rax
seto   %dil
mul    %rsi
mov    %rax,%r14
mov    %rdx,%rbx
add    %rcx,%rbx
setb   %al
or     %dil,%al
jne    1142 <t109_5mul+0x32>
test   %rbx,%rbx
jns    1149 <t109_5mul+0x39>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t109_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %11, i128 65)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ugt i128 %14, 170141183460469231731687303715884105727
%16 = or i1 %13, %15
store i128 %14, i128* %6
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %6
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t109_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 65)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
%10 = icmp slt i128 %9, 0
%11 = or i1 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 (...) @bar()
br label %14
14: ; preds = %12, %2
%15 = trunc i128 %9 to i64
%16 = lshr i128 %9, 64
%17 = trunc i128 %16 to i64
%18 = insertvalue { i64, i64 } poison, i64 %15, 0
%19 = insertvalue { i64, i64 } %18, i64 %17, 1
ret { i64, i64 } %19
}
/* Variables and functions */
int /*<<< orphan*/ putcode(int, int /*<<< orphan*/);
void encode_end_dyn() { putcode(7, 0); }


x86 assembly (clang, -O0):
<encode_end_dyn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <putcode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_end_dyn>:
mov    $0x7,%edi
xor    %esi,%esi
jmp    1030 <putcode@plt>

LLVM IR (-O0):
define void @encode_end_dyn() {
%1 = call i32 @putcode(i32 7, i32 0)
ret void
}

LLVM IR (-O2):
define void @encode_end_dyn() {
%1 = tail call i32 @putcode(i32 7, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void print(char *words[]) {
  while (*words)
    printf("%s\n", *words++);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <print+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    111c <print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1144 <print+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %7, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %2
%10 = load i8*, i8** %8
%11 = ptrtoint i8* %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = ptrtoint i8* %5 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Type definitions */
struct btf_type {
  int dummy;
};

/* Variables and functions */
scalar_t__ BTF_KIND_FWD;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_fwd(const struct btf_type *t) {
  return btf_kind(t) == BTF_KIND_FWD;
}


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

x86 assembly (clang, -O2):
<btf_is_fwd>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ed3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_FWD = global i64 0
define i32 @btf_is_fwd(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = call i64 @btf_kind(%struct.btf_type* %3)
%5 = load i64, i64* @BTF_KIND_FWD
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_FWD = global i64 0
define i32 @btf_is_fwd(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_FWD
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ asm_func();
int main() {
  asm_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @asm_func()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_setr_epi16(short, short, short, short, short, short,
                                  short, short);
__m128i test_mm_setr_epi16(short A, short B, short C, short D, short E, short F,
                           short G, short H) {
  return _mm_setr_epi16(A, B, C, D, E, F, G, H);
}


x86 assembly (clang, -O0):
<test_mm_setr_epi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8d,-0x1c(%rbp)
mov    %ecx,%eax
mov    -0x1c(%rbp),%ecx
mov    %eax,-0x18(%rbp)
mov    %edx,%eax
mov    -0x18(%rbp),%edx
mov    %eax,-0x14(%rbp)
mov    %esi,%eax
mov    -0x14(%rbp),%esi
mov    %eax,-0x10(%rbp)
mov    %edi,%r8d
mov    -0x10(%rbp),%edi
mov    %r9w,%ax
mov    0x18(%rbp),%r9w
mov    0x10(%rbp),%r9w
mov    %r8w,-0x2(%rbp)
mov    %di,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x2(%rbp),%di
mov    -0x4(%rbp),%si
mov    -0x6(%rbp),%dx
mov    -0x8(%rbp),%cx
mov    -0xa(%rbp),%r8w
mov    -0xc(%rbp),%r9w
mov    0x10(%rbp),%ax
movswl %di,%edi
movswl %si,%esi
movswl %dx,%edx
movswl %cx,%ecx
movswl %r8w,%r8d
movswl %r9w,%r9d
cwtl
mov    %eax,(%rsp)
movswl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <_mm_setr_epi16@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_setr_epi16>:
jmp    1030 <_mm_setr_epi16@plt>

LLVM IR (-O0):
define i32 @test_mm_setr_epi16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7) {
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i16
%15 = alloca i16
%16 = alloca i16
store i16 %0, i16* %9
store i16 %1, i16* %10
store i16 %2, i16* %11
store i16 %3, i16* %12
store i16 %4, i16* %13
store i16 %5, i16* %14
store i16 %6, i16* %15
store i16 %7, i16* %16
%17 = load i16, i16* %9
%18 = load i16, i16* %10
%19 = load i16, i16* %11
%20 = load i16, i16* %12
%21 = load i16, i16* %13
%22 = load i16, i16* %14
%23 = load i16, i16* %15
%24 = load i16, i16* %16
%25 = call i32 @_mm_setr_epi16(i16 signext %17, i16 signext %18, i16 signext %19, i16 signext %20, i16 signext %21, i16 signext %22, i16 signext %23, i16 signext %24)
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_mm_setr_epi16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7) {
%9 = tail call i32 @_mm_setr_epi16(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16 signext %4, i16 signext %5, i16 signext %6, i16 signext %7)
ret i32 %9
}
int load(int *p) { return *p; }


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

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

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

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

/* Variables and functions */
uint32_t ADC_Four_In(void) {
  (*((volatile uint32_t *)0x400380A0)) =
      ((*((volatile uint32_t *)0x400380A0)) & 0xFFFFFFF0) + 0;
  uint32_t data;
  (*((volatile uint32_t *)0x40038028)) = 0x0008;
  while (((*((volatile uint32_t *)0x40038004)) & 0x08) == 0) {
  };
  data = (*((volatile uint32_t *)0x400380A8)) & 0xFFF;
  (*((volatile uint32_t *)0x4003800C)) = 0x0008;
  return data;
}


x86 assembly (clang, -O0):
<ADC_Four_In>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400380a0,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
add    $0x0,%ecx
mov    $0x400380a0,%eax
mov    %ecx,(%rax)
mov    $0x40038028,%eax
movl   $0x8,(%rax)
mov    $0x40038004,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    113b <ADC_Four_In+0x3b>
jmp    1123 <ADC_Four_In+0x23>
mov    $0x400380a8,%eax
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x4003800c,%eax
movl   $0x8,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_Four_In>:
andl   $0xfffffff0,0x400380a0
f0
movl   $0x8,0x40038028
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x8,0x40038004
je     1120 <ADC_Four_In+0x20>
mov    $0xfff,%eax
and    0x400380a8,%eax
movl   $0x8,0x4003800c
ret

LLVM IR (-O0):
define i32 @ADC_Four_In() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%3 = and i32 %2, -16
%4 = add i32 %3, 0
store volatile i32 %4, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %5
5: ; preds = %9, %0
%6 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%7 = and i32 %6, 8
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%12 = and i32 %11, 4095
store i32 %12, i32* %1
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @ADC_Four_In() {
%1 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%2 = and i32 %1, -16
store volatile i32 %2, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%5 = and i32 %4, 8
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%9 = and i32 %8, 4095
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
ret i32 %9
}
long long int potega(int n, int k) {
  if (k == 0) {
    return 1;
  } else {
  }
  return n * potega(n, k - 1);
}


x86 assembly (clang, -O0):
<potega>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1135 <potega+0x25>
movq   $0x1,-0x8(%rbp)
jmp    115f <potega+0x4f>
jmp    113a <potega+0x2a>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1030 <potega@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<potega>:
test   %esi,%esi
je     111b <potega+0x1b>
movslq %edi,%rcx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1121 <potega+0x21>
mov    $0x1,%eax
jmp    1155 <potega+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <potega+0x30>
test   %edx,%edx
je     1169 <potega+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <potega+0x60>
ret

LLVM IR (-O0):
define i64 @potega(i32 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 1, i64* %3
br label %18
9: ; preds = %2
br label %10
10: ; preds = %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = call i64 @potega(i32 %13, i32 %15)
%17 = mul nsw i64 %12, %16
store i64 %17, i64* %3
br label %18
18: ; preds = %10, %8
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @potega(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %34, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
unsigned int and_product(unsigned int a, unsigned int b) {
  unsigned int c = b - a;
  unsigned int max = 0x80000000;
  unsigned int d = 1;
  if (c > max) {
    d = 0xFFFFFFFF;
  } else {
    while (d < c) {
      d *= 2;
    }
    d--;
  }
  return a & b & (0xFFFFFFFF ^ d);
}


x86 assembly (clang, -O0):
<and_product>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x80000000,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jbe    1139 <and_product+0x39>
movl   $0xffffffff,-0x14(%rbp)
jmp    1161 <and_product+0x61>
jmp    113e <and_product+0x3e>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1158 <and_product+0x58>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <and_product+0x3e>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_product>:
mov    %esi,%eax
mov    %esi,%edx
sub    %edi,%edx
xor    %ecx,%ecx
cmp    $0x80000000,%edx
ja     112b <and_product+0x2b>
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %esi,%ecx
lea    (%rcx,%rcx,1),%esi
cmp    %edx,%ecx
jb     1120 <and_product+0x20>
neg    %ecx
and    %edi,%eax
and    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @and_product(i32 %0, i32 %1) {
%3 = sub i32 %1, %0
%4 = icmp ugt i32 %3, -2147483648
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 1, %2 ]
%7 = icmp ult i32 %6, %3
%8 = shl i32 %6, 1
br i1 %7, label %5, label %9
9: ; preds = %5
%10 = sub i32 0, %6
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ %10, %9 ], [ 0, %2 ]
%13 = and i32 %1, %0
%14 = and i32 %13, %12
ret i32 %14
}