xunge/DecIR huggingface dataset:
unsigned char cast_long_uchar_fast(long int x) { return (unsigned char)x; }


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

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

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

LLVM IR (-O2):
define zeroext i8 @cast_long_uchar_fast(i64 %0) {
%2 = trunc i64 %0 to i8
ret i8 %2
}
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int signal(int semid) {
  struct sembuf operacion;
  operacion.sem_num = 0;
  operacion.sem_op = 1;
  operacion.sem_flg = 0;
  if (semop(semid, &operacion, 1) == -1) {
    return (-1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    1158 <signal+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <signal+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal>:
sub    $0x18,%rsp
movl   $0x1,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i64, i64 }
define i32 @signal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sembuf
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 0
store i32 1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 1
store i64 0, i64* %7
%8 = load i32, i32* %3
%9 = call i32 @semop(i32 %8, %struct.sembuf* %4, i32 1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
define i32 @signal(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %6
%7 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
ret i32 %9
}
void stror80(char *t) {
  while (*t) {
    if ((*t & 0x7f) >= 0x20) {
      *t |= 0x80;
    }
    t++;
  }
}


x86 assembly (clang, -O0):
<stror80>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <stror80+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x7f,%eax
cmp    $0x20,%eax
jl     1137 <stror80+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x80,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <stror80+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stror80>:
mov    (%rdi),%al
test   %al,%al
je     1126 <stror80+0x26>
add    $0x1,%rdi
jmp    111b <stror80+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1126 <stror80+0x26>
test   $0x60,%al
je     1110 <stror80+0x10>
or     $0x80,%al
mov    %al,-0x1(%rdi)
jmp    1110 <stror80+0x10>
ret

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

LLVM IR (-O2):
define void @stror80(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = and i8 %5, 96
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = or i8 %5, -128
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
int PAPI_num_counters();
void papif_num_counters_(int *numevents) { *numevents = PAPI_num_counters(); }


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

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

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

LLVM IR (-O2):
define void @papif_num_counters_(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_num_counters()
store i32 %2, i32* %0
ret void
}
double sec2deg(double angle) { return angle / 3600; }


x86 assembly (clang, -O0):
<sec2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec2deg>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sec2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.600000e+03
ret double %4
}

LLVM IR (-O2):
define double @sec2deg(double %0) {
%2 = fdiv double %0, 3.600000e+03
ret double %2
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long member_0;
  long long member_1;
  long long member_2;
  long long member_3;
};
typedef TYPE_1__ __v4di;

/* Variables and functions */
__v4di foo_8(long long c) {
  __v4di v1 = {c, c, c, c};
  return v1;
}


x86 assembly (clang, -O0):
<foo_8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rax
mov    %rsi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    %rcx,(%rdi)
mov    -0x8(%rbp),%rcx
mov    %rcx,0x8(%rdi)
mov    -0x8(%rbp),%rcx
mov    %rcx,0x10(%rdi)
mov    -0x8(%rbp),%rcx
mov    %rcx,0x18(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_8>:
mov    %rdi,%rax
mov    %rsi,(%rdi)
mov    %rsi,0x8(%rdi)
mov    %rsi,0x10(%rdi)
mov    %rsi,0x18(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64, i64, i64 }
define void @foo_8(%struct.TYPE_3__* noalias sret(%struct.TYPE_3__) align 8 %0, i64 %1) {
%3 = alloca i64
store i64 %1, i64* %3
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 0
%5 = load i64, i64* %3
store i64 %5, i64* %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 1
%7 = load i64, i64* %3
store i64 %7, i64* %6
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 2
%9 = load i64, i64* %3
store i64 %9, i64* %8
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i32 0, i32 3
%11 = load i64, i64* %3
store i64 %11, i64* %10
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64, i64, i64 }
define void @foo_8(%struct.TYPE_3__* noalias nocapture writeonly sret(%struct.TYPE_3__) align 8 %0, i64 %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i64 %1, i64* %3
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
store i64 %1, i64* %4
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 2
store i64 %1, i64* %5
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 3
store i64 %1, i64* %6
ret void
}
int main(void) {
  char s[] = "Goodbye, cruel world";
  printf("Before:\n\t[%s]\n", s);
  s[9] = "doggy";
  printf("After:\n\t[%s]\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed0(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rax
mov    %al,-0x17(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x646c726f77206c,%rax
mov    %rax,0xd(%rsp)
lea    0xedf(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rax
mov    %al,0x9(%rsp)
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [21 x i8] c"Goodbye, cruel world\00"
@.str = [15 x i8] c"Before:\0A\09[%s]\0A\00"
@.str.1 = [6 x i8] c"doggy\00"
@.str.2 = [14 x i8] c"After:\0A\09[%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [21 x i8]
store i32 0, i32* %1
%3 = bitcast [21 x i8]* %2 to i8*
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 9
store i8 ptrtoint ([6 x i8]* @.str.1 to i8), i8* %6
%7 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [21 x i8] c"Goodbye, cruel world\00"
@.str = [15 x i8] c"Before:\0A\09[%s]\0A\00"
@.str.1 = [6 x i8] c"doggy\00"
@.str.2 = [14 x i8] c"After:\0A\09[%s]\0A\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 9
store i8 ptrtoint ([6 x i8]* @.str.1 to i8), i8* %4
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
float magnitude_v3f(float *);
int /*<<< orphan*/ scale_v3f(int, float *);
void normalize_v3f(float *x) {
  float magnitude = magnitude_v3f(x);
  if (magnitude == 0.f) {
    return;
  }
  scale_v3f(1 / magnitude, x);
}


x86 assembly (clang, -O0):
<normalize_v3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <magnitude_v3f@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1156 <normalize_v3f+0x36>
jp     1156 <normalize_v3f+0x36>
jmp    1170 <normalize_v3f+0x50>
movss  0xea2(%rip),%xmm0
divss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%edi
mov    -0x8(%rbp),%rsi
call   1040 <scale_v3f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_v3f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <magnitude_v3f@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1135 <normalize_v3f+0x15>
jp     1135 <normalize_v3f+0x15>
pop    %rbx
ret
movss  0xec3(%rip),%xmm1
divss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scale_v3f@plt>

LLVM IR (-O0):
define void @normalize_v3f(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = call float @magnitude_v3f(float* %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = fcmp oeq float %6, 0.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
br label %15
9: ; preds = %1
%10 = load float, float* %3
%11 = fdiv float 1.000000e+00, %10
%12 = fptosi float %11 to i32
%13 = load float*, float** %2
%14 = call i32 @scale_v3f(i32 %12, float* %13)
br label %15
15: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @normalize_v3f(float* %0) {
%2 = tail call float @magnitude_v3f(float* %0)
%3 = fcmp oeq float %2, 0.000000e+00
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = fdiv float 1.000000e+00, %2
%6 = fptosi float %5 to i32
%7 = tail call i32 @scale_v3f(i32 %6, float* %0)
br label %8
8: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "usage: %s [-x <file>.xml | -p <file>.pl] /path/to/command [args]\n",
          name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s [-x <file>.xml | -p <file>.pl] /path/to/command [args]\0A\00"
define void @usage(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 ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"usage: %s [-x <file>.xml | -p <file>.pl] /path/to/command [args]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vswprintf(int /*<<< orphan*/ *, size_t,
                             int /*<<< orphan*/ const *, int /*<<< orphan*/);
void uninitvar_vswprintf(void) {
  wchar_t *s;
  size_t n;
  const wchar_t *format;
  va_list arg;
  (void)vswprintf(s, n, format, arg);
}


x86 assembly (clang, -O0):
<uninitvar_vswprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vswprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_vswprintf>:
jmp    1030 <vswprintf@plt>

LLVM IR (-O0):
define void @uninitvar_vswprintf() {
%1 = alloca i32*
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i32
%5 = load i32*, i32** %1
%6 = load i64, i64* %2
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @vswprintf(i32* %5, i64 %6, i32* %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_vswprintf() {
%1 = tail call i32 @vswprintf(i32* undef, i64 undef, i32* undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quicksort_algo(int *, int /*<<< orphan*/, int);
void quicksort(int *array, int size) {
  quicksort_algo(array, 0, size - 1);
  return;
}


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

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

LLVM IR (-O0):
define void @quicksort(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 @quicksort_algo(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @quicksort_algo(i32* %0, i32 0, i32 %3)
ret void
}
void g_queue_copy() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_copy() {
ret void
}
long main() {
  {}
}


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

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

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_scalarDiv_new(float *, float const *, float const,
                                       int);
void vec4f_scalarDiv_new(float result[4], const float v[4],
                         const float scalar) {
  vecNf_scalarDiv_new(result, v, scalar, 4);
}


x86 assembly (clang, -O0):
<vec4f_scalarDiv_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
mov    $0x4,%edx
call   1030 <vecNf_scalarDiv_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4f_scalarDiv_new>:
mov    $0x4,%edx
jmp    1030 <vecNf_scalarDiv_new@plt>

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

LLVM IR (-O2):
define void @vec4f_scalarDiv_new(float* %0, float* %1, float %2) {
%4 = tail call i32 @vecNf_scalarDiv_new(float* %0, float* %1, float %2, i32 4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int _fread_str(uint8_t *str, uint16_t size, FILE *fp) {
  return fread(str, 1, size, fp);
}


x86 assembly (clang, -O0):
<_fread_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fread_str>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <fread@plt>

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

LLVM IR (-O2):
define i32 @_fread_str(i32* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fread(i32* %0, i32 1, i32 %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int func(int x, int y) { printf("\nnum1: %d\nnum2: %d\n", x, y); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\0Anum1: %d\0Anum2: %d\0A\00"
define i32 @func(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* %4
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0Anum1: %d\0Anum2: %d\0A\00"
define i32 @func(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
/* Type definitions */
struct Vec4 {
  int dummy;
};

/* Variables and functions */
float sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vec4_dot(struct Vec4 const *, struct Vec4 const *);
float vec4_length(const struct Vec4 *v) { return sqrt(vec4_dot(v, v)); }


x86 assembly (clang, -O0):
<vec4_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec4_dot@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4_length>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec4_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
%struct.Vec4 = type { i32 }
define float @vec4_length(%struct.Vec4* %0) {
%2 = alloca %struct.Vec4*
store %struct.Vec4* %0, %struct.Vec4** %2
%3 = load %struct.Vec4*, %struct.Vec4** %2
%4 = load %struct.Vec4*, %struct.Vec4** %2
%5 = call i32 @vec4_dot(%struct.Vec4* %3, %struct.Vec4* %4)
%6 = call float @sqrt(i32 %5)
ret float %6
}

LLVM IR (-O2):
%struct.Vec4 = type { i32 }
define float @vec4_length(%struct.Vec4* %0) {
%2 = tail call i32 @vec4_dot(%struct.Vec4* %0, %struct.Vec4* %0)
%3 = tail call float @sqrt(i32 %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char const *, int);
void glb_fatal(const char *message) { error(1, "FATAL", message, 1); }


x86 assembly (clang, -O0):
<glb_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%ecx
lea    0xed4(%rip),%rsi
mov    %ecx,%edi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glb_fatal>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%ecx
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"FATAL\00"
define void @glb_fatal(i8* %0) {
%2 = tail call i32 @error(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
__attribute__((always_)) void auto_freechar(char **x) {
  if ((x) && (*x)) {
    free(*(char **)x);
  }
}


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

x86 assembly (clang, -O2):
<auto_freechar>:
test   %rdi,%rdi
je     1122 <auto_freechar+0x12>
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1122 <auto_freechar+0x12>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @auto_freechar(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
br label %8
8: ; preds = %6, %3, %1
ret void
}
int main() {
  int volatile a;
  int *volatile b;
  float *const c;
  long double d;
  static const int kDuration = 3;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
@main.kDuration = internal constant i32 3
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca float*
%5 = alloca x86_fp80
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glColor3usv(unsigned short *);
void Color3usv(unsigned short v[3]) { glColor3usv(v); }


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

x86 assembly (clang, -O2):
<Color3usv>:
jmp    1030 <glColor3usv@plt>

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

LLVM IR (-O2):
define void @Color3usv(i16* %0) {
%2 = tail call i32 @glColor3usv(i16* %0)
ret void
}
unsigned string_hash(const void *key) {
  unsigned hash = 5381;
  const signed char *c;
  for (c = key; *c != '\0'; c++) {
    hash = (hash << 5) + hash + (unsigned)*c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <string_hash+0x4d>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <string_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <string_hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <string_hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
int compute_unsigned_dec_width(unsigned int value) {
  int width = 0;
  do {
    width++;
    value /= 10;
  } while (value);
  return width;
}


x86 assembly (clang, -O0):
<compute_unsigned_dec_width>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    110e <compute_unsigned_dec_width+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_unsigned_dec_width>:
xor    %eax,%eax
mov    $0xcccccccd,%ecx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <compute_unsigned_dec_width+0x10>
ret

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

LLVM IR (-O2):
define i32 @compute_unsigned_dec_width(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = udiv i32 %3, 10
%7 = icmp ult i32 %3, 10
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %5
}
int isspace(int c) {
  if ((c >= 9) && (c <= 13)) {
    return (1);
  } else if (c == 32) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jl     1127 <isspace+0x27>
cmpl   $0xd,-0x8(%rbp)
jg     1127 <isspace+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1149 <isspace+0x49>
cmpl   $0x20,-0x8(%rbp)
jne    113d <isspace+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1149 <isspace+0x49>
jmp    1142 <isspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
lea    -0x9(%rdi),%eax
cmp    $0x5,%eax
setb   %al
cmp    $0x20,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 5
%4 = icmp eq i32 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  if (!(y == x))
    return 0;
  while (1) {
    x++;
    y++;
    assert(x == y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1133 <main+0x23>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1138 <main+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
mov    %al,-0xd(%rbp)
movzbl %al,%edi
call   1030 <assert@plt>
jmp    1138 <main+0x28>

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ gethostname(char *, int);
int str_len(char *);
int /*<<< orphan*/ str_print(char *, char *, int);
int /*<<< orphan*/ sys_die(char *);
extern void sys_address(char *result, int port) {
  if (gethostname(result, 64) < 0)
    sys_die("sys: cannot lookup the local host name\n");
  str_print(result + str_len(result), ":%d", port);
}


x86 assembly (clang, -O0):
<sys_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1050 <gethostname@plt>
cmp    $0x0,%rax
jge    1173 <sys_address+0x33>
lea    0xe92(%rip),%rdi
call   1030 <sys_die@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <str_len@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0xc(%rbp),%edx
lea    0xe91(%rip),%rsi
call   1040 <str_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_address>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x40,%esi
call   1050 <gethostname@plt>
test   %rax,%rax
jns    1163 <sys_address+0x23>
lea    0xea2(%rip),%rdi
call   1030 <sys_die@plt>
mov    %rbx,%rdi
call   1060 <str_len@plt>
movslq %eax,%rdi
add    %rbx,%rdi
lea    0xeb0(%rip),%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <str_print@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"sys: cannot lookup the local host name\0A\00"
@.str.1 = [4 x i8] c":%d\00"
define void @sys_address(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i64 @gethostname(i8* %5, i32 64)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @sys_die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @str_len(i8* %12)
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i32, i32* %4
%17 = call i32 @str_print(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"sys: cannot lookup the local host name\0A\00"
@.str.1 = [4 x i8] c":%d\00"
define void @sys_address(i8* %0, i32 %1) {
%3 = tail call i64 @gethostname(i8* %0, i32 64)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @sys_die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = tail call i32 @str_len(i8* %0)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = tail call i32 @str_print(i8* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void string_ncopy_do(char *dst, size_t dstlen, const char *src, size_t srclen) {
  if (srclen > dstlen - 1)
    srclen = dstlen - 1;
  strncpy(dst, src, srclen);
  dst[srclen] = 0;
}


x86 assembly (clang, -O0):
<string_ncopy_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    1149 <string_ncopy_do+0x39>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_ncopy_do>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0xffffffffffffffff,%rbx
cmp    %rcx,%rbx
cmovae %rcx,%rbx
mov    %rdx,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @string_ncopy_do(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = add i64 %1, -1
%6 = icmp ult i64 %5, %3
%7 = select i1 %6, i64 %5, i64 %3
%8 = tail call i32 @strncpy(i8* %0, i8* %2, i64 %7)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_test(int, char **);
int /*<<< orphan*/ test_multiple_jumps_to_same_label();
int /*<<< orphan*/ test_simple_jump();
int main(int argc, char *argv[]) {
  init_test(argc, argv);
  test_simple_jump();
  test_multiple_jumps_to_same_label();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <init_test@plt>
mov    $0x0,%al
call   1030 <test_simple_jump@plt>
mov    $0x0,%al
call   1040 <test_multiple_jumps_to_same_label@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %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
%7 = call i32 @init_test(i32 %5, i8** %6)
%8 = call i32 (...) @test_simple_jump()
%9 = call i32 (...) @test_multiple_jumps_to_same_label()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init_test(i32 %0, i8** %1)
%4 = tail call i32 (...) @test_simple_jump()
%5 = tail call i32 (...) @test_multiple_jumps_to_same_label()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ temp;

/* Variables and functions */
unsigned char inportb(int);
void clear_keyboard_buffers() {
  unsigned char temp;
  do {
    temp = inportb(0x64);
    if (((temp) & (1 << (0))) != 0)
      inportb(0x60);
  } while (((temp) & (1 << (1))) != 0);
}


x86 assembly (clang, -O0):
<clear_keyboard_buffers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
call   1030 <inportb@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113f <clear_keyboard_buffers+0x2f>
mov    $0x60,%edi
call   1030 <inportb@plt>
jmp    1144 <clear_keyboard_buffers+0x34>
movzbl -0x1(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1118 <clear_keyboard_buffers+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_keyboard_buffers>:
push   %rbx
jmp    1125 <clear_keyboard_buffers+0x15>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   $0x2,%bl
je     1141 <clear_keyboard_buffers+0x31>
mov    $0x64,%edi
call   1030 <inportb@plt>
mov    %eax,%ebx
test   $0x1,%al
je     1120 <clear_keyboard_buffers+0x10>
mov    $0x60,%edi
call   1030 <inportb@plt>
jmp    1120 <clear_keyboard_buffers+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @clear_keyboard_buffers() {
%1 = alloca i8
br label %2
2: ; preds = %11, %0
%3 = call zeroext i8 @inportb(i32 100)
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call zeroext i8 @inportb(i32 96)
br label %10
10: ; preds = %8, %2
br label %11
11: ; preds = %10
%12 = load i8, i8* %1
%13 = zext i8 %12 to i32
%14 = and i32 %13, 2
%15 = icmp ne i32 %14, 0
br i1 %15, label %2, label %16
16: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @clear_keyboard_buffers() {
br label %1
1: ; preds = %8, %0
%2 = tail call zeroext i8 @inportb(i32 100)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call zeroext i8 @inportb(i32 96)
br label %8
8: ; preds = %1, %6
%9 = and i32 %3, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %1
11: ; preds = %8
ret void
}
void imp() {}


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

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

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

LLVM IR (-O2):
define void @imp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_http_error(int, char *, char const *);
void send_500_internal_server_error(int clientsock, const char *msg) {
  send_http_error(clientsock, "500 Internal Server Error", msg);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rsi
call   1030 <send_http_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <send_http_error@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"500 Internal Server Error\00"
define void @send_500_internal_server_error(i32 %0, i8* %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
%7 = call i32 @send_http_error(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"500 Internal Server Error\00"
define void @send_500_internal_server_error(i32 %0, i8* %1) {
%3 = tail call i32 @send_http_error(i32 %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
extern __attribute__((__gnu___)) float __attribute__((__const__))
cimagf(float _Complex _Z) {
  return __imag__ _Z;
}


x86 assembly (clang, -O0):
<cimagf>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cimagf>:
shufps $0x55,%xmm0,%xmm0
ret

LLVM IR (-O0):
define float @cimagf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %3
%4 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @cimagf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 1
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int readlink(char const *, char *, int);
int is_symlink(char const *s) {
  char result[256];
  int len;
  len = readlink(s, result, sizeof(result));
  if (len == -1)
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<is_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1030 <readlink@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0xffffffff,-0x114(%rbp)
jne    1153 <is_symlink+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_symlink+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_symlink>:
sub    $0x108,%rsp
mov    %rsp,%rsi
mov    $0x100,%edx
call   1030 <readlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @is_symlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = call i32 @readlink(i8* %6, i8* %7, i32 256)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_symlink(i8* nocapture %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @readlink(i8* %0, i8* %3, i32 256)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int flistxattr(int fd, char *list, size_t size) { return 0; }


x86 assembly (clang, -O0):
<flistxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flistxattr>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @flistxattr(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @flistxattr(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
void swift_initEnumMetadataSinglePayload(void) {}


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

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

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

LLVM IR (-O2):
define void @swift_initEnumMetadataSinglePayload() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("size of a short is %1d\n", sizeof(short));
  printf("size of a int is %1d\n", sizeof(int));
  printf("size of a long is %1d\n", sizeof(long));
  printf("size of a char is %1d\n", sizeof(char));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"size of a short is %1d\0A\00"
@.str.1 = [22 x i8] c"size of a int is %1d\0A\00"
@.str.2 = [23 x i8] c"size of a long is %1d\0A\00"
@.str.3 = [23 x i8] c"size of a char is %1d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"size of a short is %1d\0A\00"
@.str.1 = [22 x i8] c"size of a int is %1d\0A\00"
@.str.2 = [23 x i8] c"size of a long is %1d\0A\00"
@.str.3 = [23 x i8] c"size of a char is %1d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}