xunge/DecIR huggingface dataset:
void gll_coordinates_order6_square(double *out_5275473663835076437) {
  out_5275473663835076437[0] = -1.0;
  out_5275473663835076437[1] = -0.830223896278567;
  out_5275473663835076437[2] = -0.468848793470714;
  out_5275473663835076437[3] = 0.0;
  out_5275473663835076437[4] = 0.468848793470714;
  out_5275473663835076437[5] = 0.830223896278567;
  out_5275473663835076437[6] = 1.0;
}


x86 assembly (clang, -O0):
<gll_coordinates_order6_square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xf14(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
movsd  0xebe(%rip),%xmm0
movsd  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gll_coordinates_order6_square>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movsd  0xf0e(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xef3(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x30(%rdi)
ret

LLVM IR (-O0):
define void @gll_coordinates_order6_square(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
store double -1.000000e+00, double* %4
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 1
store double 0xBFEA9131B45BF8F7, double* %6
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 2
store double 0xBFDE019E5EAE7319, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 3
store double 0.000000e+00, double* %10
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 4
store double 0x3FDE019E5EAE7319, double* %12
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 5
store double 0x3FEA9131B45BF8F7, double* %14
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 6
store double 1.000000e+00, double* %16
ret void
}

LLVM IR (-O2):
define void @gll_coordinates_order6_square(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to <2 x double>*
store <2 x double> <double -1.000000e+00, double 0xBFEA9131B45BF8F7>, <2 x double>* %2
%3 = getelementptr inbounds double, double* %0, i64 2
%4 = bitcast double* %3 to <2 x double>*
store <2 x double> <double 0xBFDE019E5EAE7319, double 0.000000e+00>, <2 x double>* %4
%5 = getelementptr inbounds double, double* %0, i64 4
%6 = bitcast double* %5 to <2 x double>*
store <2 x double> <double 0x3FDE019E5EAE7319, double 0x3FEA9131B45BF8F7>, <2 x double>* %6
%7 = getelementptr inbounds double, double* %0, i64 6
store double 1.000000e+00, double* %7
ret void
}
/* Variables and functions */
int abs(unsigned int);
int /*<<< orphan*/ printf(char *, int);
void scroll_up(unsigned int lines) { printf("\e[%dS", abs(lines)); }


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

x86 assembly (clang, -O2):
<scroll_up>:
mov    %edi,%esi
neg    %esi
cmovs  %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dS\00"
define void @scroll_up(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dS\00"
define void @scroll_up(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int dot_prod(int a[2], int b[2]) { return a[0] * b[0] + a[1] * b[1]; }


x86 assembly (clang, -O0):
<dot_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   0x4(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_prod>:
mov    (%rsi),%ecx
imul   (%rdi),%ecx
mov    0x4(%rsi),%eax
imul   0x4(%rdi),%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dot_prod(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %3
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %7
%11 = add nsw i32 %10, %5
ret i32 %11
}
const char *GC_Brief(void) { return "Garbage Collector"; }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Garbage Collector\00"
define i8* @GC_Brief() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"Garbage Collector\00"
define i8* @GC_Brief() {
ret i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ AL_readStatus();
void AL_writeDelay(int delay) {
  while (delay-- > 0) {
    AL_readStatus();
  }
}


x86 assembly (clang, -O0):
<AL_writeDelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    113b <AL_writeDelay+0x2b>
mov    $0x0,%al
call   1030 <AL_readStatus@plt>
jmp    111b <AL_writeDelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AL_writeDelay>:
push   %rbx
test   %edi,%edi
jle    112f <AL_writeDelay+0x1f>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <AL_readStatus@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <AL_writeDelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @AL_writeDelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @AL_readStatus()
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @AL_writeDelay(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @AL_readStatus()
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
int HEX_IsHex(char c) {
  if ((c >= '0') && (c <= '9')) {
    return 1;
  } else if ((c >= 'A') && (c <= 'F')) {
    return 1;
  } else if ((c >= 'a') && (c <= 'f')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<HEX_IsHex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <HEX_IsHex+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <HEX_IsHex+0x30>
movl   $0x1,-0x4(%rbp)
jmp    118d <HEX_IsHex+0x8d>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <HEX_IsHex+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1156 <HEX_IsHex+0x56>
movl   $0x1,-0x4(%rbp)
jmp    118d <HEX_IsHex+0x8d>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     117c <HEX_IsHex+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     117c <HEX_IsHex+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    118d <HEX_IsHex+0x8d>
jmp    1181 <HEX_IsHex+0x81>
jmp    1186 <HEX_IsHex+0x86>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HEX_IsHex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @HEX_IsHex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %33
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 70
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %33
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 102
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %2
br label %33
30: ; preds = %25, %21
br label %31
31: ; preds = %30
br label %32
32: ; preds = %31
store i32 0, i32* %2
br label %33
33: ; preds = %32, %29, %20, %11
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @HEX_IsHex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ quick_sort_r(int *, int /*<<< orphan*/, int);
void quick_sort_random(register int a[], register int length) {
  quick_sort_r(a, 0, length - 1);
}


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

x86 assembly (clang, -O2):
<quick_sort_random>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <quick_sort_r@plt>

LLVM IR (-O0):
define void @quick_sort_random(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 = sub nsw i32 %6, 1
%8 = call i32 @quick_sort_r(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort_random(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @quick_sort_r(i32* %0, i32 0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ m5_checkpoint(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ parse_int_args(int, char **, int /*<<< orphan*/ *, int);
void do_checkpoint(int argc, char *argv[]) {
  uint64_t ints[2];
  parse_int_args(argc, argv, ints, 2);
  m5_checkpoint(ints[0], ints[1]);
}


x86 assembly (clang, -O0):
<do_checkpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <m5_checkpoint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_checkpoint>:
push   %rax
mov    %rsp,%rdx
mov    $0x2,%ecx
call   1040 <parse_int_args@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1030 <m5_checkpoint@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @do_checkpoint(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%9 = call i32 @parse_int_args(i32 %6, i8** %7, i32* %8, i32 2)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%13 = load i32, i32* %12
%14 = call i32 @m5_checkpoint(i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @do_checkpoint(i32 %0, i8** %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = call i32 @parse_int_args(i32 %0, i8** %1, i32* %5, i32 2)
%7 = load i32, i32* %5
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%9 = load i32, i32* %8
%10 = call i32 @m5_checkpoint(i32 %7, i32 %9)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};
struct lf_pq_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mem_incr_ref(struct node *);
struct lf_pq_node *COPY_NODE(void *_n) {
  struct lf_pq_node *n = _n;
  mem_incr_ref((struct node *)n);
  return n;
}


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

x86 assembly (clang, -O2):
<COPY_NODE>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mem_incr_ref@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.lf_pq_node = type { i32 }
%struct.node = type { i32 }
define %struct.lf_pq_node* @COPY_NODE(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.lf_pq_node*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.lf_pq_node*
store %struct.lf_pq_node* %5, %struct.lf_pq_node** %3
%6 = load %struct.lf_pq_node*, %struct.lf_pq_node** %3
%7 = bitcast %struct.lf_pq_node* %6 to %struct.node*
%8 = call i32 @mem_incr_ref(%struct.node* %7)
%9 = load %struct.lf_pq_node*, %struct.lf_pq_node** %3
ret %struct.lf_pq_node* %9
}

LLVM IR (-O2):
%struct.lf_pq_node = type { i32 }
%struct.node = type { i32 }
define %struct.lf_pq_node* @COPY_NODE(i8* %0) {
%2 = bitcast i8* %0 to %struct.lf_pq_node*
%3 = bitcast i8* %0 to %struct.node*
%4 = tail call i32 @mem_incr_ref(%struct.node* %3)
ret %struct.lf_pq_node* %2
}
int heap_maximum(int *A) { return A[1]; }


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

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

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

LLVM IR (-O2):
define i32 @heap_maximum(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct dive_site {
  int dummy;
};

/* Variables and functions */
scalar_t__ compare_sites(struct dive_site const *, struct dive_site const *);
int site_less_than(const struct dive_site *a, const struct dive_site *b) {
  return compare_sites(a, b) < 0;
}


x86 assembly (clang, -O0):
<site_less_than>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <compare_sites@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<site_less_than>:
push   %rax
call   1030 <compare_sites@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dive_site = type { i32 }
define i32 @site_less_than(%struct.dive_site* %0, %struct.dive_site* %1) {
%3 = alloca %struct.dive_site*
%4 = alloca %struct.dive_site*
store %struct.dive_site* %0, %struct.dive_site** %3
store %struct.dive_site* %1, %struct.dive_site** %4
%5 = load %struct.dive_site*, %struct.dive_site** %3
%6 = load %struct.dive_site*, %struct.dive_site** %4
%7 = call i64 @compare_sites(%struct.dive_site* %5, %struct.dive_site* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.dive_site = type { i32 }
define i32 @site_less_than(%struct.dive_site* %0, %struct.dive_site* %1) {
%3 = tail call i64 @compare_sites(%struct.dive_site* %0, %struct.dive_site* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ perror(char *);
void c_perror_(char *str, int *errc) {
  errno = *errc;
  perror(str);
}


x86 assembly (clang, -O0):
<c_perror_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    0x2eb3(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_perror_>:
mov    (%rsi),%eax
mov    0x2ec7(%rip),%rcx
mov    %eax,(%rcx)
jmp    1030 <perror@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define void @c_perror_(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* @errno
%4 = tail call i32 @perror(i8* %0)
ret void
}
void caller_2_2_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_2_1_2_2_1() {
ret void
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
scalar_t__ change_uid(struct passwd const *);
scalar_t__ setup_groups(struct passwd const *);
int setup_uid_gid(const struct passwd *info, int is_console) {
  if (setup_groups(info) < 0)
    return -1;
  if (change_uid(info) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<setup_uid_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <setup_groups@plt>
cmp    $0x0,%rax
jge    114e <setup_uid_gid+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <setup_uid_gid+0x54>
mov    -0x10(%rbp),%rdi
call   1030 <change_uid@plt>
cmp    $0x0,%rax
jge    116d <setup_uid_gid+0x4d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <setup_uid_gid+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_uid_gid>:
push   %rbx
mov    %rdi,%rbx
call   1040 <setup_groups@plt>
test   %rax,%rax
js     113c <setup_uid_gid+0x1c>
mov    %rbx,%rdi
call   1030 <change_uid@plt>
sar    $0x3f,%rax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @setup_uid_gid(%struct.passwd* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.passwd*
%5 = alloca i32
store %struct.passwd* %0, %struct.passwd** %4
store i32 %1, i32* %5
%6 = load %struct.passwd*, %struct.passwd** %4
%7 = call i64 @setup_groups(%struct.passwd* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %16
10: ; preds = %2
%11 = load %struct.passwd*, %struct.passwd** %4
%12 = call i64 @change_uid(%struct.passwd* %11)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 -1, i32* %3
br label %16
15: ; preds = %10
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @setup_uid_gid(%struct.passwd* %0, i32 %1) {
%3 = tail call i64 @setup_groups(%struct.passwd* %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @change_uid(%struct.passwd* %0)
%7 = ashr i64 %6, 63
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
unsigned xrop3_159_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_159_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_159_1_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%esi
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_159_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_159_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ memcpy(void *, char *, size_t);
char *copy(void *dest, char *src, char s) {
  if (!memcpy(dest, src, (size_t)s))
    die("Could not copy memory");
  return src + s;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsbq -0x11(%rbp),%rdx
call   1030 <memcpy@plt>
cmp    $0x0,%eax
jne    115c <copy+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
movsbl -0x11(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
movslq %edx,%r14
mov    %r14,%rdx
call   1030 <memcpy@plt>
test   %eax,%eax
jne    1142 <copy+0x22>
lea    0xec3(%rip),%rdi
call   1040 <die@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"Could not copy memory\00"
define i8* @copy(i8* %0, i8* %1, i8 signext %2) {
%4 = sext i8 %2 to i64
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @die(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = getelementptr inbounds i8, i8* %1, i64 %4
ret i8* %10
}
/* Variables and functions */
scalar_t__ geteuid();
scalar_t__ getuid();
int is_prog_runas_root() {
  if (getuid() == 0 || geteuid() == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_prog_runas_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%rax
je     114a <is_prog_runas_root+0x2a>
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
jne    1156 <is_prog_runas_root+0x36>
movl   $0x1,-0x4(%rbp)
jmp    115d <is_prog_runas_root+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prog_runas_root>:
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
test   %rax,%rax
je     1141 <is_prog_runas_root+0x21>
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_prog_runas_root() {
%1 = alloca i32
%2 = call i64 (...) @getuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @geteuid()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4, %0
store i32 1, i32* %1
br label %9
8: ; preds = %4
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_prog_runas_root() {
%1 = tail call i64 (...) @getuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @geteuid()
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct page_context {
  int dummy;
};

/* Variables and functions */
void *vmm_alloc_block(struct page_context *, int);
void *vmm_alloc_block_user(struct page_context *ctx) {
  return vmm_alloc_block(ctx, 1);
}


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

x86 assembly (clang, -O2):
<vmm_alloc_block_user>:
mov    $0x1,%esi
jmp    1030 <vmm_alloc_block@plt>

LLVM IR (-O0):
%struct.page_context = type { i32 }
define i8* @vmm_alloc_block_user(%struct.page_context* %0) {
%2 = alloca %struct.page_context*
store %struct.page_context* %0, %struct.page_context** %2
%3 = load %struct.page_context*, %struct.page_context** %2
%4 = call i8* @vmm_alloc_block(%struct.page_context* %3, i32 1)
ret i8* %4
}

LLVM IR (-O2):
%struct.page_context = type { i32 }
define i8* @vmm_alloc_block_user(%struct.page_context* %0) {
%2 = tail call i8* @vmm_alloc_block(%struct.page_context* %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int NumberOnly();
int /*<<< orphan*/ WriteInstruction(char *);
int /*<<< orphan*/ WriteNumber(unsigned short);
void CR_Spawn(void) {
  unsigned short int nNum = NumberOnly();
  WriteInstruction("ld bc,");
  nNum = 256 * NumberOnly() + nNum;
  WriteNumber(nNum);
  WriteInstruction("call spawn");
}


x86 assembly (clang, -O0):
<CR_Spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <NumberOnly@plt>
mov    %ax,-0x2(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <WriteInstruction@plt>
mov    $0x0,%al
call   1050 <NumberOnly@plt>
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <WriteNumber@plt>
lea    0xe94(%rip),%rdi
call   1040 <WriteInstruction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CR_Spawn>:
push   %rbx
xor    %eax,%eax
call   1050 <NumberOnly@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
call   1040 <WriteInstruction@plt>
xor    %eax,%eax
call   1050 <NumberOnly@plt>
shl    $0x8,%eax
add    %ebx,%eax
movzwl %ax,%edi
call   1030 <WriteNumber@plt>
lea    0xea6(%rip),%rdi
pop    %rbx
jmp    1040 <WriteInstruction@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ld bc,\00"
@.str.1 = [11 x i8] c"call spawn\00"
define void @CR_Spawn() {
%1 = alloca i16
%2 = call i32 (...) @NumberOnly()
%3 = trunc i32 %2 to i16
store i16 %3, i16* %1
%4 = call i32 @WriteInstruction(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @NumberOnly()
%6 = mul nsw i32 256, %5
%7 = load i16, i16* %1
%8 = zext i16 %7 to i32
%9 = add nsw i32 %6, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %1
%11 = load i16, i16* %1
%12 = call i32 @WriteNumber(i16 zeroext %11)
%13 = call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld bc,\00"
@.str.1 = [11 x i8] c"call spawn\00"
define void @CR_Spawn() {
%1 = tail call i32 (...) @NumberOnly()
%2 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @NumberOnly()
%4 = shl nsw i32 %3, 8
%5 = add i32 %4, %1
%6 = trunc i32 %5 to i16
%7 = tail call i32 @WriteNumber(i16 zeroext %6)
%8 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo_1_2_1_1_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_2_2_2_1_2() {
ret void
}
int test_imm_8Duint32_mem(unsigned int *val) {
  return ((*val) & (0x8D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Duint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 141
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void p_memset(char *buffer, char value, int size) {
  while (size--)
    *buffer++ = value;
}


x86 assembly (clang, -O0):
<p_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     113e <p_memset+0x3e>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1111 <p_memset+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_memset>:
test   %edx,%edx
je     1124 <p_memset+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @p_memset(i8* %0, i8 signext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %5
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %4
store i8 %12, i8* %13
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @p_memset(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
int /*<<< orphan*/ strlen(char const *);
char *xstrdup(const char *str) {
  char *s = strdup(str);
  if (!s) {
    fprintf(stderr,
            "failed to duplicate string of size "
            "%zd.\n",
            strlen(str));
    exit(1);
  }
  return s;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1194 <xstrdup+0x54>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe7b(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <strdup@plt>
test   %rax,%rax
je     1157 <xstrdup+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e82(%rip),%rax
mov    (%rax),%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe91(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"failed to duplicate string of size %zd.\0A\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"failed to duplicate string of size %zd.\0A\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Type definitions */
struct ast_sockaddr {
  int dummy;
};

/* Variables and functions */
char *ast_sockaddr_stringify_fmt(struct ast_sockaddr const *, int);
char *ast_sockaddr_stringify_port(const struct ast_sockaddr *addr) {
  return ast_sockaddr_stringify_fmt(addr, (1 << 1));
}


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

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

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

LLVM IR (-O2):
%struct.ast_sockaddr = type { i32 }
define i8* @ast_sockaddr_stringify_port(%struct.ast_sockaddr* %0) {
%2 = tail call i8* @ast_sockaddr_stringify_fmt(%struct.ast_sockaddr* %0, i32 2)
ret i8* %2
}
/* Type definitions */
struct rusage {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_wait4;
int /*<<< orphan*/ syscall4(int /*<<< orphan*/, int /*<<< orphan*/, uintptr_t,
                            int, uintptr_t);
pid_t sys_wait4(pid_t pid, int *wstatus, int options, struct rusage *rusage) {
  return syscall4(SYS_wait4, pid, (uintptr_t)wstatus, options,
                  (uintptr_t)rusage);
}


x86 assembly (clang, -O0):
<sys_wait4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <syscall4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_wait4>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall4@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
@SYS_wait4 = global i32 0
define i32 @sys_wait4(i32 %0, i32* %1, i32 %2, %struct.rusage* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca %struct.rusage*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store %struct.rusage* %3, %struct.rusage** %8
%9 = load i32, i32* @SYS_wait4
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = load i32, i32* %7
%14 = load %struct.rusage*, %struct.rusage** %8
%15 = ptrtoint %struct.rusage* %14 to i64
%16 = call i32 @syscall4(i32 %9, i32 %10, i64 %12, i32 %13, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@SYS_wait4 = global i32 0
define i32 @sys_wait4(i32 %0, i32* %1, i32 %2, %struct.rusage* %3) {
%5 = load i32, i32* @SYS_wait4
%6 = ptrtoint i32* %1 to i64
%7 = ptrtoint %struct.rusage* %3 to i64
%8 = tail call i32 @syscall4(i32 %5, i32 %0, i64 %6, i32 %2, i64 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _tap_ok(char *, int, int, char *);
int /*<<< orphan*/ tap_plan(int);
int main(void) {
  tap_plan(1);
  _tap_ok("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/andrewgregory/pacutils/refs/heads/master/"
          "ext/globdir.c/ext/tap.c/t/01-sanity.c",
          7, 1, "compilation successful");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <tap_plan@plt>
lea    0xec0(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
lea    0xf58(%rip),%rcx
call   1040 <_tap_ok@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <tap_plan@plt>
lea    0xece(%rip),%rdi
lea    0xf70(%rip),%rcx
mov    $0x7,%esi
mov    $0x1,%edx
call   1040 <_tap_ok@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andrewgregory/pacutils/refs/heads/master/ext/globdir.c/ext/tap.c/t/01-sanity.c\00"
@.str.1 = [23 x i8] c"compilation successful\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @tap_plan(i32 1)
%3 = call i32 @_tap_ok(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 7, i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andrewgregory/pacutils/refs/heads/master/ext/globdir.c/ext/tap.c/t/01-sanity.c\00"
@.str.1 = [23 x i8] c"compilation successful\00"
define i32 @main() {
%1 = tail call i32 @tap_plan(i32 1)
%2 = tail call i32 @_tap_ok(i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 7, i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void d2i_X509_REQ_INFO(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_X509_REQ_INFO() {
ret void
}
/* Variables and functions */
uintptr_t default_hash_fnc(void *key) { return (uintptr_t)key; }


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

x86 assembly (clang, -O2):
<default_hash_fnc>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @default_hash_fnc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @default_hash_fnc(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Variables and functions */
char const *strong_l1();
const char *call_strong_l1(void) { return strong_l1() + 1; }


x86 assembly (clang, -O0):
<call_strong_l1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <strong_l1@plt>
add    $0x1,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @call_strong_l1() {
%1 = call i8* (...) @strong_l1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_strong_l1() {
%1 = tail call i8* (...) @strong_l1()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, double);
void startpump(char *mssge) {
  double x = 10.00;
  printf("%s.\nPrice is $%5.2f per gallon.\n", mssge, x);
}


x86 assembly (clang, -O0):
<startpump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startpump>:
mov    %rdi,%rsi
lea    0xeee(%rip),%rdi
movsd  0xede(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"%s.\0APrice is $%5.2f per gallon.\0A\00"
define void @startpump(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
store double 1.000000e+01, double* %3
%4 = load i8*, i8** %2
%5 = load double, double* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4, double %5)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s.\0APrice is $%5.2f per gallon.\0A\00"
define void @startpump(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, double 1.000000e+01)
ret void
}
void ServerDebug(text, a, b, c, d, e) char *text;
int a, b, c, d, e;
{
  printf("Hydra : ");
  printf(text, a, b, c, d, e);
  putchar('\n');
}


x86 assembly (clang, -O0):
<ServerDebug>:
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)
mov    %r9d,-0x1c(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ServerDebug>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %rdi,%rbp
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Hydra : \00"
define void @ServerDebug(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = call i32 (i8*, ...) @printf(i8* %14, i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
%21 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Hydra : \00"
define void @ServerDebug(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret void
}