xunge/DecIR huggingface dataset:
int is_dot_or_dotdot(char const *name) {
  return name[0] == '.' &&
         (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'));
}


x86 assembly (clang, -O0):
<is_dot_or_dotdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1166 <is_dot_or_dotdot+0x66>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1160 <is_dot_or_dotdot+0x60>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0xb(%rbp)
jne    115a <is_dot_or_dotdot+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dot_or_dotdot>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    111c <is_dot_or_dotdot+0x1c>
mov    0x1(%rdi),%cl
test   %cl,%cl
je     111d <is_dot_or_dotdot+0x1d>
cmp    $0x2e,%cl
jne    111c <is_dot_or_dotdot+0x1c>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_dot_or_dotdot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %30
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %28, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 46
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 0
br label %26
26: ; preds = %20, %14
%27 = phi i1 [ false, %14 ], [ %25, %20 ]
br label %28
28: ; preds = %26, %8
%29 = phi i1 [ true, %8 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %1
%31 = phi i1 [ false, %1 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @is_dot_or_dotdot(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %12 [
i8 0, label %13
i8 46, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %13
12: ; preds = %4
br label %13
13: ; preds = %4, %12, %7, %1
%14 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %7 ], [ 0, %12 ]
ret i32 %14
}
/* Variables and functions */
double sqrt(double const);
double len3(const double c[]) {
  return sqrt(c[0] * c[0] + c[1] * c[1] + c[2] * c[2]);
}


x86 assembly (clang, -O0):
<len3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<len3>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <len3+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @len3(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
_Bool QuietUnordered(double f1, double f2) {
  return __builtin_isunordered(f1, f2);
}


x86 assembly (clang, -O0):
<QuietUnordered>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuietUnordered>:
ucomisd %xmm1,%xmm0
setp   %al
ret

LLVM IR (-O0):
define zeroext i1 @QuietUnordered(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp uno double %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @QuietUnordered(double %0, double %1) {
%3 = fcmp uno double %0, %1
ret i1 %3
}
/* Variables and functions */
int tst_run_cmd_fds_(void (*)(), char const *const *, int, int, int);
int tst_run_cmd_fds(void(cleanup_fn)(void), const char *const argv[],
                    int stdout_fd, int stderr_fd, int pass_exit_val) {
  return tst_run_cmd_fds_(cleanup_fn, argv, stdout_fd, stderr_fd,
                          pass_exit_val);
}


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

x86 assembly (clang, -O2):
<tst_run_cmd_fds>:
jmp    1030 <tst_run_cmd_fds_@plt>

LLVM IR (-O0):
define i32 @tst_run_cmd_fds(void ()* %0, i8** %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca void ()*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store void ()* %0, void ()** %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load void ()*, void ()** %6
%12 = bitcast void ()* %11 to void (...)*
%13 = load i8**, i8*** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @tst_run_cmd_fds_(void (...)* %12, i8** %13, i32 %14, i32 %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @tst_run_cmd_fds(void ()* %0, i8** %1, i32 %2, i32 %3, i32 %4) {
%6 = bitcast void ()* %0 to void (...)*
%7 = tail call i32 @tst_run_cmd_fds_(void (...)* %6, i8** %1, i32 %2, i32 %3, i32 %4)
ret i32 %7
}
/* Variables and functions */
scalar_t__ alloca(int);
void *test4a(char *);
void __attribute__((no)) * test4(void) {
  char *save = (char *)alloca(4);
  return test4a(save);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <test4a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
mov    $0x4,%edi
call   1030 <alloca@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <test4a@plt>

LLVM IR (-O0):
define i8* @test4() {
%1 = alloca i8*
%2 = call i64 @alloca(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @test4a(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @test4() {
%1 = tail call i64 @alloca(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @test4a(i8* %2)
ret i8* %3
}
float _Complex div_float_cc(float _Complex a, float _Complex b) {
  return a / b;
}


x86 assembly (clang, -O0):
<div_float_cc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x10(%rbp)
movlpd %xmm1,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
call   1150 <__divsc3>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret
nop

x86 assembly (clang, -O2):
<div_float_cc>:
movaps %xmm0,%xmm4
shufps $0x55,%xmm0,%xmm4
movaps %xmm1,%xmm3
shufps $0x55,%xmm1,%xmm3
movaps %xmm1,%xmm2
movaps %xmm4,%xmm1
jmp    1120 <__divsc3>
nopl   0x0(%rax)

LLVM IR (-O0):
define <2 x float> @div_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = alloca { float, float }
%7 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %0, <2 x float>* %7
%8 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %1, <2 x float>* %8
%9 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%12 = load float, float* %11
%13 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%14 = load float, float* %13
%15 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%16 = load float, float* %15
%17 = call <2 x float> @__divsc3(float %10, float %12, float %14, float %16)
%18 = bitcast { float, float }* %6 to <2 x float>*
store <2 x float> %17, <2 x float>* %18
%19 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 0
%20 = load float, float* %19
%21 = getelementptr inbounds { float, float }, { float, float }* %6, i32 0, i32 1
%22 = load float, float* %21
%23 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%24 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %20, float* %23
store float %22, float* %24
%25 = bitcast { float, float }* %3 to <2 x float>*
%26 = load <2 x float>, <2 x float>* %25
ret <2 x float> %26
}

LLVM IR (-O2):
define <2 x float> @div_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = extractelement <2 x float> %0, i64 0
%4 = extractelement <2 x float> %0, i64 1
%5 = extractelement <2 x float> %1, i64 0
%6 = extractelement <2 x float> %1, i64 1
%7 = tail call <2 x float> @__divsc3(float %3, float %4, float %5, float %6)
ret <2 x float> %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
void *malloc_safe(size_t size) {
  void *memory = malloc(size);
  assert(memory != NULL && "Out of memory.");
  if (memory == NULL)
    exit(EXIT_FAILURE);
  return memory;
}


x86 assembly (clang, -O0):
<malloc_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1163 <malloc_safe+0x33>
mov    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    1163 <malloc_safe+0x33>
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
jne    1189 <malloc_safe+0x59>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_safe>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
test   %rbx,%rbx
je     1151 <malloc_safe+0x21>
mov    %rbx,%rax
pop    %rbx
ret
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory.\00"
@EXIT_FAILURE = global i32 0
define i8* @malloc_safe(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
%10 = phi i1 [ false, %1 ], [ true, %8 ]
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %3
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @malloc_safe(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i8* %2, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret i8* %2
}
AR0I1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[10000000]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x21,0x2625a00(%rax)
jg     1135 <AR0I1+0x35>
movl   $0x1,-0x4(%rbp)
jmp    113c <AR0I1+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0I1>:
xor    %eax,%eax
cmpl   $0x22,0x2625a00(%r8)
22
setl   %al
ret

LLVM IR (-O0):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = getelementptr inbounds i32, i32* %14, i64 10000000
%16 = load i32, i32* %15
%17 = icmp sle i32 %16, 33
br i1 %17, label %18, label %19
18: ; preds = %6
store i32 1, i32* %7
br label %20
19: ; preds = %6
store i32 0, i32* %7
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = getelementptr inbounds i32, i32* %4, i64 10000000
%8 = load i32, i32* %7
%9 = icmp slt i32 %8, 34
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int delaysym(char c) {
  if (c && strchr("$~", c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<delaysym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1151 <delaysym+0x41>
lea    0xece(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1151 <delaysym+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <delaysym+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delaysym>:
test   %dil,%dil
je     1139 <delaysym+0x29>
push   %rax
movsbl %dil,%esi
lea    0xedf(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
lea    0x8(%rsp),%rsp
je     1139 <delaysym+0x29>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"$~\00"
define i32 @delaysym(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 ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"$~\00"
define i32 @delaysym(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
OP(fd, a3) {
  illegal_1();
  op_a3();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_a3()
ret i32 undef
}
/* Variables and functions */
unsigned int htonl(int);
unsigned int mc_ipv4_submask(unsigned int prefixlen) {
  return htonl(~((1 << (32 - prefixlen)) - 1));
}


x86 assembly (clang, -O0):
<mc_ipv4_submask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
mov    $0x1,%edi
shl    %cl,%edi
sub    $0x1,%edi
xor    $0xffffffff,%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_ipv4_submask>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%edi
shl    %cl,%edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @mc_ipv4_submask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 32, %3
%5 = shl i32 1, %4
%6 = sub nsw i32 %5, 1
%7 = xor i32 %6, -1
%8 = call i32 @htonl(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @mc_ipv4_submask(i32 %0) {
%2 = sub i32 32, %0
%3 = shl nsw i32 -1, %2
%4 = tail call i32 @htonl(i32 %3)
ret i32 %4
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
scalar_t__ fileExists(char *);
int /*<<< orphan*/ stat(char *, struct stat *);
int isDirectory(char *name) {
  struct stat st;
  if (fileExists(name)) {
    stat(name, &st);
    if (st.st_mode & S_IFDIR) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileExists@plt>
cmp    $0x0,%rax
je     1172 <isDirectory+0x52>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x18(%rbp),%eax
mov    0x2e82(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     116d <isDirectory+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1179 <isDirectory+0x59>
jmp    1172 <isDirectory+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDirectory>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <fileExists@plt>
test   %rax,%rax
je     1153 <isDirectory+0x33>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%eax
test   %ecx,0x8(%rsp)
jne    1155 <isDirectory+0x35>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isDirectory(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @fileExists(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @stat(i8* %9, %struct.stat* %4)
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i32, i32* @S_IFDIR
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %8
store i32 1, i32* %2
br label %19
17: ; preds = %8
br label %18
18: ; preds = %17, %1
store i32 0, i32* %2
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isDirectory(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i64 @fileExists(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = call i32 @stat(i8* %0, %struct.stat* %2)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = load i32, i32* @S_IFDIR
%11 = and i32 %10, %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6, %1
br label %14
14: ; preds = %6, %13
%15 = phi i32 [ 0, %13 ], [ 1, %6 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_int8_t(int8_t *const dest) { (void)dest; }


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_int8_t(i32* nocapture %0) {
ret void
}
void foo_1_1_1_2_1_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_1_1_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  register void *result = realloc(p, size);
  if (result == NULL) {
    die("Out of memory (realloc)\n");
  }
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"Out of memory (realloc)\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t signum(int64_t a) { return a > 0 ? 1 : a < 0 ? -1 : 0; }


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <signum+0x20>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <signum+0x35>
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovl  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
xor    %ecx,%ecx
test   %rdi,%rdi
setne  %cl
neg    %rcx
test   %rdi,%rdi
mov    $0x1,%eax
cmovle %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @signum(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = sext i1 %2 to i64
%4 = icmp slt i64 %0, 1
%5 = select i1 %4, i64 %3, i64 1
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (sizeof(void *) != 8) {
    printf("\x1b[31;1m");
    printf("\n\nERROR: Premake must be compiled in 64-bit.\n");
    printf("Start a 'x64 Native Tools Command Prompt'.\n");
    printf("or run 'vcvarsall.bat x64'.\n\n");
    printf("\x1b[0m");
    return -1;
  }
  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):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_75(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_75() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_75() {
ret i32 0
}
unsigned int hash_max(unsigned int x, unsigned int max) {
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x) * 0x45d9f3b;
  x = ((x >> 16) ^ x);
  return x % max;
}


x86 assembly (clang, -O0):
<hash_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_max>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
imul   $0x45d9f3b,%eax,%eax
mov    %eax,%ecx
shr    $0x10,%ecx
xor    %eax,%ecx
imul   $0x45d9f3b,%ecx,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
xor    %ecx,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hash_max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 16
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = mul i32 %8, 73244475
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = lshr i32 %10, 16
%12 = load i32, i32* %3
%13 = xor i32 %11, %12
%14 = mul i32 %13, 73244475
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = lshr i32 %15, 16
%17 = load i32, i32* %3
%18 = xor i32 %16, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = urem i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @hash_max(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = xor i32 %3, %0
%5 = mul i32 %4, 73244475
%6 = lshr i32 %5, 16
%7 = xor i32 %6, %5
%8 = mul i32 %7, 73244475
%9 = lshr i32 %8, 16
%10 = xor i32 %9, %8
%11 = urem i32 %10, %1
ret i32 %11
}
void remove_metadata_from_list() {}


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

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

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

LLVM IR (-O2):
define void @remove_metadata_from_list() {
ret void
}
int test_imm_F9uint8_reg(unsigned char val) {
  return ((val) & (-0xF9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F9uint8_reg>:
test   $0x7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F9uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -249
%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_F9uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 7
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FaultSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void FaultSettingsUpdated() { UAVObjUpdated(FaultSettingsHandle()); }


x86 assembly (clang, -O0):
<FaultSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FaultSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FaultSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <FaultSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @FaultSettingsUpdated() {
%1 = call i32 (...) @FaultSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FaultSettingsUpdated() {
%1 = tail call i32 (...) @FaultSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c(double, double, double);
double fmin(int /*<<< orphan*/, int /*<<< orphan*/);
double fa(double x, double y) {
  return fmin(c(x, y, 0.5), c(x * 0.47 + 0.15, y + 0.25, 0.3));
}


x86 assembly (clang, -O0):
<fa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xedc(%rip),%xmm2
call   1040 <c@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe97(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe82(%rip),%xmm2
call   1040 <c@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <fmin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movsd  0xec8(%rip),%xmm2
call   1040 <c@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
mulsd  0xebc(%rip),%xmm0
addsd  0xebc(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  0xeb6(%rip),%xmm1
movsd  0xeb6(%rip),%xmm2
call   1040 <c@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fmin@plt>

LLVM IR (-O0):
define double @fa(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @c(double %5, double %6, double 5.000000e-01)
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %8, double 4.700000e-01, double 1.500000e-01)
%10 = load double, double* %4
%11 = fadd double %10, 2.500000e-01
%12 = call i32 @c(double %9, double %11, double 3.000000e-01)
%13 = call double @fmin(i32 %7, i32 %12)
ret double %13
}

LLVM IR (-O2):
define double @fa(double %0, double %1) {
%3 = tail call i32 @c(double %0, double %1, double 5.000000e-01)
%4 = tail call double @llvm.fmuladd.f64(double %0, double 4.700000e-01, double 1.500000e-01)
%5 = fadd double %1, 2.500000e-01
%6 = tail call i32 @c(double %4, double %5, double 3.000000e-01)
%7 = tail call double @fmin(i32 %3, i32 %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ _SC_LINE_MAX;
int /*<<< orphan*/ printf(char *, long, int);
long sysconf(int /*<<< orphan*/);
int main(void) {
  long line_max;
  line_max = sysconf(_SC_LINE_MAX);
  printf("line_max: %ld\tLINE_MAX: %d\n", line_max, 1024);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x400,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
mov    $0x400,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_LINE_MAX = global i32 0
@.str = [28 x i8] c"line_max: %ld\09LINE_MAX: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = load i32, i32* @_SC_LINE_MAX
%4 = call i64 @sysconf(i32 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %5, i32 1024)
ret i32 0
}

LLVM IR (-O2):
@_SC_LINE_MAX = global i32 0
@.str = [28 x i8] c"line_max: %ld\09LINE_MAX: %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @_SC_LINE_MAX
%2 = tail call i64 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %2, i32 1024)
ret i32 0
}
__attribute__((unused)) char *strrchr(const char *s, int c) {
  const char *ret = ((void *)0);
  while (*s) {
    if (*s == (char)c)
      ret = s;
    s++;
  }
  return (char *)ret;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strrchr+0x4e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <strrchr+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strrchr+0x26>
movsbl %sil,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %16, %8 ]
%10 = phi i8* [ null, %5 ], [ %14, %8 ]
%11 = phi i8* [ %0, %5 ], [ %15, %8 ]
%12 = sext i8 %9 to i32
%13 = icmp eq i32 %7, %12
%14 = select i1 %13, i8* %11, i8* %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8* [ null, %2 ], [ %14, %8 ]
ret i8* %19
}
int Scl_Flt2Int(float w) { return 1000 * w; }


x86 assembly (clang, -O0):
<Scl_Flt2Int>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_Flt2Int>:
mulss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @Scl_Flt2Int(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 1.000000e+03, %3
%5 = fptosi float %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @Scl_Flt2Int(float %0) {
%2 = fmul float %0, 1.000000e+03
%3 = fptosi float %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char s[6] = {71, 0, 71, 65, 89, 0};
  printf("%s %s\n", s, &s[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rsi
lea    -0xa(%rbp),%rdx
add    $0x2,%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x59,0x4(%rsp)
movl   $0x41470047,(%rsp)
lea    0x2(%rsp),%rdx
lea    0xedb(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.s = [6 x i8] c"G\00GAY\00"
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [6 x i8] c"G\00GAY\00"
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret i32 0
}
/* Variables and functions */
long math___Int_bor___impl(long, long);
long core__math___Int___bor(long self, long p0) {
  long var;
  long var1;
  var1 = math___Int_bor___impl(self, p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core__math___Int___bor>:
jmp    1030 <math___Int_bor___impl@plt>

LLVM IR (-O0):
define i64 @core__math___Int___bor(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = call i64 @math___Int_bor___impl(i64 %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @core__math___Int___bor(i64 %0, i64 %1) {
%3 = tail call i64 @math___Int_bor___impl(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int call_do_bt();
void *tf(void *arg) {
  if (call_do_bt() != 57)
    return (void *)1L;
  return NULL;
}


x86 assembly (clang, -O0):
<tf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <call_do_bt@plt>
cmp    $0x39,%eax
je     113a <tf+0x2a>
mov    $0x1,%eax
mov    %rax,-0x8(%rbp)
jmp    1142 <tf+0x32>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf>:
push   %rax
xor    %eax,%eax
call   1030 <call_do_bt@plt>
xor    %ecx,%ecx
cmp    $0x39,%eax
setne  %cl
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @tf(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (...) @call_do_bt()
%5 = icmp ne i32 %4, 57
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* inttoptr (i64 1 to i8*), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @tf(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @call_do_bt()
%3 = icmp eq i32 %2, 57
%4 = select i1 %3, i8* null, i8* inttoptr (i64 1 to i8*)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *daytime(void) {
  static char now[30];
  time_t t;
  struct tm *tm;
  t = time(NULL);
  tm = localtime(&t);
  strftime(now, 30, "%a %b %e %H:%M:%S %Z %Y\n", tm);
  return now;
}


x86 assembly (clang, -O0):
<daytime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2ef4(%rip),%rdi
mov    $0x1e,%esi
lea    0xe98(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2edc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daytime>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@daytime.now = internal global [30 x i8] zeroinitializer
@.str = [25 x i8] c"%a %b %e %H:%M:%S %Z %Y\0A\00"
define i8* @daytime() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i32 @strftime(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @daytime.now, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @daytime.now, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@daytime.now = internal global [30 x i8] zeroinitializer
@.str = [25 x i8] c"%a %b %e %H:%M:%S %Z %Y\0A\00"
define i8* @daytime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @daytime.now, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @daytime.now, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int *malloc(int);
int mss(int *, int);
int main(int argc, char **argv) {
  int n = 1000;
  int *a;
  a = malloc(n * sizeof(a));
  return mss(a, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3e8,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <mss@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1f40,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x3e8,%esi
pop    %rax
jmp    1030 <mss@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1000, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 8
%11 = trunc i64 %10 to i32
%12 = call i32* @malloc(i32 %11)
store i32* %12, i32** %7
%13 = load i32*, i32** %7
%14 = load i32, i32* %6
%15 = call i32 @mss(i32* %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 8000)
%4 = tail call i32 @mss(i32* %3, i32 1000)
ret i32 %4
}
/* Type definitions */
struct fa_status {
  int dummy;
};

/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ print_error(char *);
bool read_gigabit_status(struct fa_status *status) {
  errno = 0;
  return ({
    print_error("Read status not suppported for gigabit");
    false;
  });
}


x86 assembly (clang, -O0):
<read_gigabit_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
movq   $0x0,(%rax)
lea    0xecf(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_gigabit_status>:
push   %rax
mov    0x2ec8(%rip),%rax
movq   $0x0,(%rax)
lea    0xeda(%rip),%rdi
call   1030 <print_error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.fa_status = type { i32 }
@errno = global i64 0
@.str = [39 x i8] c"Read status not suppported for gigabit\00"
define i32 @read_gigabit_status(%struct.fa_status* %0) {
%2 = alloca %struct.fa_status*
%3 = alloca i32
store %struct.fa_status* %0, %struct.fa_status** %2
store i64 0, i64* @errno
%4 = call i32 @print_error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
%struct.fa_status = type { i32 }
@errno = global i64 0
@.str = [39 x i8] c"Read status not suppported for gigabit\00"
define i32 @read_gigabit_status(%struct.fa_status* nocapture readnone %0) {
store i64 0, i64* @errno
%2 = tail call i32 @print_error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Dopen(void *file_id, const char *name, void *dapl_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Dclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Dopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Dopen>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Dclose\00"
define i8* @H5Dopen(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i8* @__coverity_alloc__(i32 10)
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = call i32 @__coverity_mark_as_afm_allocated__(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %7
ret i8* %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Dclose\00"
define i8* @H5Dopen(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* @__coverity_alloc__(i32 10)
%5 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}