xunge/DecIR huggingface dataset:
/* Variables and functions */
int ackermann_iter(int, int);
int ackermann(int m, int n) { return ackermann_iter(m, n); }


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

x86 assembly (clang, -O2):
<ackermann>:
jmp    1030 <ackermann_iter@plt>

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

LLVM IR (-O2):
define i32 @ackermann(i32 %0, i32 %1) {
%3 = tail call i32 @ackermann_iter(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Die(char *);
void *calloc(size_t, size_t);
void *Scalloc(size_t nmemb, size_t size) {
  void *ptr = NULL;
  if ((ptr = calloc(nmemb, size)) == NULL)
    Die("memory allocation failure");
  return ptr;
}


x86 assembly (clang, -O0):
<Scalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115f <Scalloc+0x3f>
lea    0xea6(%rip),%rdi
call   1040 <Die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Scalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <Die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"memory allocation failure\00"
define i8* @Scalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @Die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [26 x i8] c"memory allocation failure\00"
define noalias i8* @Scalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ mmap_chunks_higher(int, int /*<<< orphan*/);
int /*<<< orphan*/ mmap_chunks_lower(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void alloc_64k_full() {
  printf("Allocating 64k pages < 128TB \n");
  mmap_chunks_lower(8191, 0);
  printf("Allocating 64k pages > 128TB \n");
  mmap_chunks_higher(24575, 0);
}


x86 assembly (clang, -O0):
<alloc_64k_full>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1fff,%edi
xor    %esi,%esi
call   1050 <mmap_chunks_lower@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5fff,%edi
xor    %esi,%esi
call   1040 <mmap_chunks_higher@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_64k_full>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1fff,%edi
xor    %esi,%esi
call   1050 <mmap_chunks_lower@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5fff,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <mmap_chunks_higher@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Allocating 64k pages < 128TB \0A\00"
@.str.1 = [31 x i8] c"Allocating 64k pages > 128TB \0A\00"
define void @alloc_64k_full() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @mmap_chunks_lower(i32 8191, i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @mmap_chunks_higher(i32 24575, i32 0)
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Allocating 64k pages < 128TB \00"
@str.2 = [30 x i8] c"Allocating 64k pages > 128TB \00"
define void @alloc_64k_full() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @mmap_chunks_lower(i32 8191, i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @mmap_chunks_higher(i32 24575, i32 0)
ret void
}
double didotprod(double *a, int *b) {
  return a[0] * (double)b[0] + a[1] * (double)b[1] + a[2] * (double)b[2];
}


x86 assembly (clang, -O0):
<didotprod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdl 0x8(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<didotprod>:
cvtsi2sdl (%rsi),%xmm1
cvtsi2sdl 0x4(%rsi),%xmm2
mulsd  0x8(%rdi),%xmm2
mulsd  (%rdi),%xmm1
cvtsi2sdl 0x8(%rsi),%xmm0
addsd  %xmm2,%xmm1
mulsd  0x10(%rdi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @didotprod(double* %0, i32* %1) {
%3 = alloca double*
%4 = alloca i32*
store double* %0, double** %3
store i32* %1, i32** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = sitofp i32 %17 to double
%19 = fmul double %14, %18
%20 = call double @llvm.fmuladd.f64(double %7, double %11, double %19)
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 2
%23 = load double, double* %22
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
%27 = sitofp i32 %26 to double
%28 = call double @llvm.fmuladd.f64(double %23, double %27, double %20)
ret double %28
}

LLVM IR (-O2):
define double @didotprod(double* nocapture %0, i32* nocapture %1) {
%3 = load double, double* %0
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = fmul double %7, %10
%12 = tail call double @llvm.fmuladd.f64(double %3, double %5, double %11)
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds i32, i32* %1, i64 2
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to double
%18 = tail call double @llvm.fmuladd.f64(double %14, double %17, double %12)
ret double %18
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c += 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <ft_tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <ft_tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int get_in_nr();
int wrap_get_in_nr(struct activity *a) { return (get_in_nr()); }


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

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

LLVM IR (-O0):
%struct.activity = type { i32 }
define i32 @wrap_get_in_nr(%struct.activity* %0) {
%2 = alloca %struct.activity*
store %struct.activity* %0, %struct.activity** %2
%3 = call i32 (...) @get_in_nr()
ret i32 %3
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define i32 @wrap_get_in_nr(%struct.activity* nocapture readnone %0) {
%2 = tail call i32 (...) @get_in_nr()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ai_discard(int, int);
scalar_t__ data_isai(int);
int /*<<< orphan*/ trade_routine_other(int, int, int);
void robber_discardhandler(int player, int num) {
  if (data_isai(player))
    ai_discard(player, num);
  else {
    trade_routine_other(player, num * -1, 2);
  }
}


x86 assembly (clang, -O0):
<robber_discardhandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <data_isai@plt>
cmp    $0x0,%rax
je     1160 <robber_discardhandler+0x30>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <ai_discard@plt>
jmp    1171 <robber_discardhandler+0x41>
mov    -0x4(%rbp),%edi
imul   $0xffffffff,-0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <trade_routine_other@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<robber_discardhandler>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <data_isai@plt>
test   %rax,%rax
je     1150 <robber_discardhandler+0x20>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <ai_discard@plt>
neg    %ebx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x2,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <trade_routine_other@plt>

LLVM IR (-O0):
define void @robber_discardhandler(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 = call i64 @data_isai(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @ai_discard(i32 %9, i32 %10)
br label %17
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, -1
%16 = call i32 @trade_routine_other(i32 %13, i32 %15, i32 2)
br label %17
17: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
define void @robber_discardhandler(i32 %0, i32 %1) {
%3 = tail call i64 @data_isai(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @ai_discard(i32 %0, i32 %1)
br label %10
7: ; preds = %2
%8 = sub nsw i32 0, %1
%9 = tail call i32 @trade_routine_other(i32 %0, i32 %8, i32 2)
br label %10
10: ; preds = %7, %5
ret void
}
void vpoke(unsigned int address, unsigned char value) {
  address;
  value;
}


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

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

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

LLVM IR (-O2):
define void @vpoke(i32 %0, i8 zeroext %1) {
ret void
}
int *__errno_location(void) {
  static int e;
  return &e;
}


x86 assembly (clang, -O0):
<__errno_location>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f19(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__errno_location>:
lea    0x2f1d(%rip),%rax
ret

LLVM IR (-O0):
@__errno_location.e = internal global i32 0
define i32* @__errno_location() {
ret i32* @__errno_location.e
}

LLVM IR (-O2):
@__errno_location.e = internal global i32 0
define i32* @__errno_location() {
ret i32* @__errno_location.e
}
/* Type definitions */
struct expression {
  int dummy;
};

/* Variables and functions */
long long __get_expression_value(struct expression *, int);
long long get_expression_value_silent(struct expression *expr) {
  return __get_expression_value(expr, 2);
}


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

x86 assembly (clang, -O2):
<get_expression_value_silent>:
mov    $0x2,%esi
jmp    1030 <__get_expression_value@plt>

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

LLVM IR (-O2):
%struct.expression = type { i32 }
define i64 @get_expression_value_silent(%struct.expression* %0) {
%2 = tail call i64 @__get_expression_value(%struct.expression* %0, i32 2)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
void yxml_setchar(char *dest, unsigned ch) {
  unsigned char _ch = ch;
  memcpy(dest, &_ch, 1);
}


x86 assembly (clang, -O0):
<yxml_setchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yxml_setchar>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @yxml_setchar(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 i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i8*, i8** %3
%9 = call i32 @memcpy(i8* %8, i8* %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @yxml_setchar(i8* %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = call i32 @memcpy(i8* %0, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char const,
                           unsigned char const, unsigned char const,
                           unsigned char const);
void mkptr4(char *s, const unsigned char *ip) {
  sprintf(s, "%d.%d.%d.%d.in-addr.arpa", ip[3], ip[2], ip[1], ip[0]);
}


x86 assembly (clang, -O0):
<mkptr4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%dl
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%r8b
mov    -0x10(%rbp),%rax
lea    0xebb(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl (%rax),%r9d
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkptr4>:
movzbl 0x3(%rsi),%edx
movzbl 0x2(%rsi),%ecx
movzbl 0x1(%rsi),%r8d
movzbl (%rsi),%r9d
lea    0xed8(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%d.%d.%d.%d.in-addr.arpa\00"
define void @mkptr4(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i8 zeroext %11, i8 zeroext %14, i8 zeroext %17)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%d.%d.%d.%d.in-addr.arpa\00"
define void @mkptr4(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 3
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %1, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 1
%8 = load i8, i8* %7
%9 = load i8, i8* %1
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %4, i8 zeroext %6, i8 zeroext %8, i8 zeroext %9)
ret void
}
/* Variables and functions */
char *create_string(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *create_string2(const char *s, size_t len) {
  char *res = create_string(len);
  strncpy(res, s, len);
  res[len] = '\0';
  return res;
}


x86 assembly (clang, -O0):
<create_string2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <create_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_string2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <create_string@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @create_string2(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @create_string(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = call i32 @strncpy(i8* %8, i8* %9, i64 %10)
%12 = load i8*, i8** %5
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @create_string2(i8* %0, i64 %1) {
%3 = tail call i8* @create_string(i64 %1)
%4 = tail call i32 @strncpy(i8* %3, i8* %0, i64 %1)
%5 = getelementptr inbounds i8, i8* %3, i64 %1
store i8 0, i8* %5
ret i8* %3
}
/* Type definitions */
struct uv__mmsghdr {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct uv__mmsghdr *, unsigned int, int /*<<< orphan*/);
int uv__sendmmsg(int fd, struct uv__mmsghdr *mmsg, unsigned int vlen) {
  return syscall(307, fd, mmsg, vlen, 0);
}


x86 assembly (clang, -O0):
<uv__sendmmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x133,%edi
xor    %r8d,%r8d
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__sendmmsg>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x133,%edi
xor    %r8d,%r8d
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.uv__mmsghdr = type { i32 }
define i32 @uv__sendmmsg(i32 %0, %struct.uv__mmsghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.uv__mmsghdr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.uv__mmsghdr* %1, %struct.uv__mmsghdr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.uv__mmsghdr*, %struct.uv__mmsghdr** %5
%9 = load i32, i32* %6
%10 = call i32 @syscall(i32 307, i32 %7, %struct.uv__mmsghdr* %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.uv__mmsghdr = type { i32 }
define i32 @uv__sendmmsg(i32 %0, %struct.uv__mmsghdr* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 307, i32 %0, %struct.uv__mmsghdr* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ string(char *);
void oid_1005(void) { string("Hardware build date"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hardware build date\00"
define void @oid_1005() {
%1 = call i32 @string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hardware build date\00"
define void @oid_1005() {
%1 = tail call i32 @string(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
int maxArea(int *height, int heightSize) {}


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

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

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

LLVM IR (-O2):
define i32 @maxArea(i32* nocapture readnone %0, i32 %1) {
ret i32 undef
}
callrts(sname) char *sname;
{
  ot("call ");
  outasm(sname);
  nl();
}


x86 assembly (clang, -O0):
<callrts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outasm@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callrts>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outasm@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"call \00"
define i32 @callrts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (...) @nl()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"call \00"
define i32 @callrts(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outasm to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int net_dont_block(int fd) {
  return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<net_dont_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_dont_block>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @net_dont_block(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
%10 = call i32 @fcntl(i32 %3, i32 %4, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @net_dont_block(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 0)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void sig_handler() {
  printf("Interrupted by SIGALRM\n");
  printf("Test Fail: block on pthread_barrier_wait()\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Interrupted by SIGALRM\0A\00"
@.str.1 = [44 x i8] c"Test Fail: block on pthread_barrier_wait()\0A\00"
define void @sig_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"Interrupted by SIGALRM\00"
@str.2 = [43 x i8] c"Test Fail: block on pthread_barrier_wait()\00"
define void @sig_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void dummyrsp_RomClosed(void) {}


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

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

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

LLVM IR (-O2):
define void @dummyrsp_RomClosed() {
ret void
}
void ScaleARGBRowDown2Linear_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDown2Linear_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *why) {
  fprintf(stderr, "gen_art_config: %s\n", why);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"gen_art_config: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"gen_art_config: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
OP(dd, cc) {
  illegal_1();
  op_cc();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_cc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_cc()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_cc()
ret i32 undef
}
void VMR3ReqCallNoWaitU(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3ReqCallNoWaitU() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
void *scheduler2(void *variables2) {
  int vars;
  int *p_vars = (int *)variables2;
  vars = *p_vars;
  while (1) {
    system("netstat -anp | grep python | awk '{print $7}' | cut -d / -f1 | "
           "xargs kill");
    sleep(vars);
  }
}


x86 assembly (clang, -O0):
<scheduler2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
jmp    113d <scheduler2+0x1d>

x86 assembly (clang, -O2):
<scheduler2>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <system@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
jmp    1130 <scheduler2+0x10>

LLVM IR (-O0):
@.str = [74 x i8] c"netstat -anp | grep python | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define i8* @scheduler2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %3
br label %9
9: ; preds = %1, %9
%10 = call i32 @system(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @sleep(i32 %11)
br label %9
}

LLVM IR (-O2):
@.str = [74 x i8] c"netstat -anp | grep python | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define noalias i8* @scheduler2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 %3)
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __swahw32p(int /*<<< orphan*/ *);
void __swahw32s(uint32_t *p) { *p = __swahw32p(p); }


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

x86 assembly (clang, -O2):
<__swahw32s>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__swahw32p@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__swahw32s(i32* %0) {
%2 = tail call i32 @__swahw32p(i32* %0)
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  int arr[10];
  arr[10] = 1;
  printf("%d\n", arr[10]);
  char brr[10];
  brr[10] = '!';
  printf("%c\n", brr[10]);
  char *crr[10];
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @test_succeeded() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(void) { test(2147395599); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7ffea80f,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7ffea80f,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @test(i32 2147395599)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 2147395599)
ret i32 0
}
/* Variables and functions */
char *skip_arg(char const *);
char *skip_spaces(char const *);
int count_argc(const char *str) {
  int count = 0;
  while (*str) {
    str = skip_spaces(str);
    if (*str) {
      count++;
      str = skip_arg(str);
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<count_argc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1175 <count_argc+0x55>
mov    -0x8(%rbp),%rdi
call   1040 <skip_spaces@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1170 <count_argc+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <skip_arg@plt>
mov    %rax,-0x8(%rbp)
jmp    1133 <count_argc+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_argc>:
push   %rbx
cmpb   $0x0,(%rdi)
je     114f <count_argc+0x2f>
mov    %rdi,%rax
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1040 <skip_spaces@plt>
cmpb   $0x0,(%rax)
je     1151 <count_argc+0x31>
add    $0x1,%ebx
mov    %rax,%rdi
call   1030 <skip_arg@plt>
cmpb   $0x0,(%rax)
jne    1130 <count_argc+0x10>
jmp    1151 <count_argc+0x31>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @count_argc(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %10
%5 = phi i32 [ %11, %10 ], [ 0, %1 ]
%6 = phi i8* [ %12, %10 ], [ %0, %1 ]
%7 = tail call i8* @skip_spaces(i8* %6)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %4
%11 = add nuw nsw i32 %5, 1
%12 = tail call i8* @skip_arg(i8* %7)
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %10, %1
%16 = phi i32 [ 0, %1 ], [ %5, %4 ], [ %11, %10 ]
ret i32 %16
}
/* Variables and functions */
int ssgl_connect_to_lobby(char *, int /*<<< orphan*/);
int ssgl_gameserver_connect_to_lobby(char *ssgl_hostname) {
  return ssgl_connect_to_lobby(ssgl_hostname, 0);
}


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

x86 assembly (clang, -O2):
<ssgl_gameserver_connect_to_lobby>:
xor    %esi,%esi
jmp    1030 <ssgl_connect_to_lobby@plt>

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

LLVM IR (-O2):
define i32 @ssgl_gameserver_connect_to_lobby(i8* %0) {
%2 = tail call i32 @ssgl_connect_to_lobby(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int max(int, int);
int min(int, int);
int rand(int);
int random(int lower, int upper) {
  int v1 = max(upper, lower), v2 = min(upper, lower);
  return (rand(v1 - v2) + v2);
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <max@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <min@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1050 <rand@plt>
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %esi,%edi
mov    %ebp,%esi
call   1040 <max@plt>
mov    %eax,%ebx
mov    %r14d,%edi
mov    %ebp,%esi
call   1030 <min@plt>
mov    %eax,%ebp
sub    %eax,%ebx
mov    %ebx,%edi
call   1050 <rand@plt>
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @max(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i32 @min(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
%16 = call i32 @rand(i32 %15)
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @random(i32 %0, i32 %1) {
%3 = tail call i32 @max(i32 %1, i32 %0)
%4 = tail call i32 @min(i32 %1, i32 %0)
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @rand(i32 %5)
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ rlHello();
int /*<<< orphan*/ rlMatrixMode(int);
int main() {
  rlHello();
  rlMatrixMode(0x1700);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rlHello@plt>
mov    $0x1700,%edi
call   1030 <rlMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rlHello()
%2 = tail call i32 @rlMatrixMode(i32 5888)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t mvni(uint32_t x) { return 0xffffffff - x; }


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

x86 assembly (clang, -O2):
<mvni>:
mov    $0xffffffff,%eax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @mvni(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 4294967295, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @mvni(i64 %0) {
%2 = sub nsw i64 4294967295, %0
ret i64 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool sixlowpan_nalp(uint8_t disp) { return ((disp & 0xc0) == 0); }


x86 assembly (clang, -O0):
<sixlowpan_nalp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc0,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sixlowpan_nalp>:
xor    %eax,%eax
test   $0xc0,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @sixlowpan_nalp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @sixlowpan_nalp(i32 %0) {
%2 = and i32 %0, 192
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ processingThread(int /*<<< orphan*/);
void *processingThreadPthreads(void *param) {
  processingThread((uint8_t)(uintptr_t)param);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @processingThreadPthreads(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = trunc i64 %4 to i32
%6 = call i32 @processingThread(i32 %5)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @processingThreadPthreads(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @processingThread(i32 %3)
ret i8* null
}
/* Variables and functions */
int forwline(int, int, int /*<<< orphan*/);
bforwline(int f, int n) { return (forwline(f, n, 0)); }


x86 assembly (clang, -O0):
<bforwline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <forwline@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bforwline(i32 %0, i32 %1) {
%3 = tail call i32 @forwline(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ svga_writel_common(int /*<<< orphan*/, int /*<<< orphan*/,
                                      int /*<<< orphan*/, void *);
void svga_writel(uint32_t addr, uint32_t val, void *p) {
  svga_writel_common(addr, val, 0, p);
}


x86 assembly (clang, -O0):
<svga_writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1030 <svga_writel_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @svga_writel(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @svga_writel_common(i32 %0, i32 %1, i32 0, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_unisys_acpi_oem_table(unsigned long *, int *);
int /*<<< orphan*/ parse_unisys_oem(char *, int);
void acpi_madt_oem_check(char *oem_id, char *oem_table_id) {
  unsigned long oem_addr;
  int oem_entries;
  if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries))
    parse_unisys_oem((char *)oem_addr, oem_entries);
}


x86 assembly (clang, -O0):
<acpi_madt_oem_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <find_unisys_acpi_oem_table@plt>
cmp    $0x0,%eax
jne    1152 <acpi_madt_oem_check+0x32>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <parse_unisys_oem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acpi_madt_oem_check>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <find_unisys_acpi_oem_table@plt>
test   %eax,%eax
je     113c <acpi_madt_oem_check+0x1c>
add    $0x18,%rsp
ret
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
call   1040 <parse_unisys_oem@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @acpi_madt_oem_check(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i32
%5 = bitcast i64* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @find_unisys_acpi_oem_table(i64* %3, i32* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %3
%11 = inttoptr i64 %10 to i8*
%12 = load i32, i32* %4
%13 = call i32 @parse_unisys_oem(i8* %11, i32 %12)
br label %14
14: ; preds = %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, int, int);
void puts(char *str) { print(str, -1, -1); }


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

x86 assembly (clang, -O2):
<puts>:
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <print@plt>

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

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @print(i8* %0, i32 -1, i32 -1)
ret void
}