xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *substr(char *buf, int start, int end) {
  char *subbuff = malloc(end - start + 1);
  strncpy(subbuff, buf + start, end);
  subbuff[end] = '\0';
  return subbuff;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
sub    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
mov    %edx,%edi
sub    %esi,%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movslq %ebx,%rax
movb   $0x0,0x0(%rbp,%rax,1)
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i32, i32* %6
%19 = call i32 @strncpy(i8* %13, i8* %17, i32 %18)
%20 = load i8*, i8** %7
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 0, i8* %23
%24 = load i8*, i8** %7
ret i8* %24
}

LLVM IR (-O2):
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = sub i32 1, %1
%5 = add i32 %4, %2
%6 = tail call i8* @malloc(i32 %5)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @strncpy(i8* %6, i8* %8, i32 %2)
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
store i8 0, i8* %11
ret i8* %6
}
int xisinff(float x) { return x == __builtin_inff() || x == -__builtin_inff(); }


x86 assembly (clang, -O0):
<xisinff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x1,%al
movss  0xee8(%rip),%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jne    112f <xisinff+0x2f>
jp     112f <xisinff+0x2f>
jmp    114a <xisinff+0x4a>
movss  -0x4(%rbp),%xmm0
movss  0xec8(%rip),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisinff>:
ucomiss 0xef9(%rip),%xmm0
setae  %al
movss  0xef2(%rip),%xmm1
ucomiss %xmm0,%xmm1
setae  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @xisinff(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0x7FF0000000000000
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load float, float* %2
%7 = fcmp oeq float %6, 0xFFF0000000000000
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xisinff(float %0) {
%2 = fcmp oeq float %0, 0x7FF0000000000000
%3 = fcmp oeq float %0, 0xFFF0000000000000
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void create_array(int arr[]) {
  int i;
  printf("Creating array...\n");
  for (i = 0; i < 10; i++)
    arr[i] = i;
}


x86 assembly (clang, -O0):
<create_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1155 <create_array+0x45>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <create_array+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_array>:
push   %rbx
mov    %rdi,%rbx
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
movaps 0xed9(%rip),%xmm0
movups %xmm0,(%rbx)
movaps 0xedf(%rip),%xmm0
movups %xmm0,0x10(%rbx)
movabs $0x900000008,%rax
mov    %rax,0x20(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Creating array...\0A\00"
define void @create_array(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
store i32 %9, i32* %13
br label %14
14: ; preds = %8
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Creating array...\00"
define void @create_array(i32* nocapture writeonly %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %3
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 6, i32 7>, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 8
store i32 8, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 9
store i32 9, i32* %7
ret void
}
/* Variables and functions */
scalar_t__ isinf(float);
scalar_t__ isnan(float);
float fixf(float v, float def) {
  if (isnan(v) || isinf(v))
    return def;
  return v;
}


x86 assembly (clang, -O0):
<fixf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
jne    115a <fixf+0x3a>
movss  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%rax
je     1169 <fixf+0x49>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1173 <fixf+0x53>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixf>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
call   1030 <isnan@plt>
test   %rax,%rax
je     113e <fixf+0x1e>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
movss  (%rsp),%xmm0
call   1040 <isinf@plt>
test   %rax,%rax
je     1158 <fixf+0x38>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fixf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = call i64 @isnan(float %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load float, float* %4
%11 = call i64 @isinf(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9, %2
%14 = load float, float* %5
store float %14, float* %3
br label %17
15: ; preds = %9
%16 = load float, float* %4
store float %16, float* %3
br label %17
17: ; preds = %15, %13
%18 = load float, float* %3
ret float %18
}

LLVM IR (-O2):
define float @fixf(float %0, float %1) {
%3 = tail call i64 @isnan(float %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @isinf(float %0)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, float %0, float %1
br label %9
9: ; preds = %5, %2
%10 = phi float [ %1, %2 ], [ %8, %5 ]
ret float %10
}
int pldummy_pstex() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_pstex() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void original() { puts("original."); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"original.\00"
define void @original() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"original.\00"
define void @original() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void srandom(unsigned int seed) {}


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

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

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

LLVM IR (-O2):
define void @srandom(i32 %0) {
ret void
}
void test_22_0(char *mem) { __atomic_add_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_22_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,%al
lock xadd %al,(%rdx)
add    %cl,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_22_0>:
lock addb $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_22_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw add i8* %5, i8 %6 acq_rel
%8 = add i8 %7, %6
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_22_0(i8* nocapture %0) {
%2 = atomicrmw add i8* %0, i8 1 acq_rel
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ time_t;

/* Variables and functions */
char *libewf_header_value_string_alloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int /*<<< orphan*/);
scalar_t__ time(int /*<<< orphan*/ *);
char *libewf_generate_date_header2_value(void) {
  char *date_string = libewf_header_value_string_alloc(20);
  time_t timestamp = time(NULL);
  snprintf(date_string, 20,
           "%"
           "u",
           (uint32_t)timestamp);
  return (date_string);
}


x86 assembly (clang, -O0):
<libewf_generate_date_header2_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1040 <libewf_header_value_string_alloc@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xe97(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libewf_generate_date_header2_value>:
push   %rbx
mov    $0x14,%edi
call   1040 <libewf_header_value_string_alloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1050 <time@plt>
lea    0xeb4(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %eax,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i8* @libewf_generate_date_header2_value() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i8* @libewf_header_value_string_alloc(i32 20)
store i8* %3, i8** %1
%4 = call i64 @time(i32* null)
store i64 %4, i64* %2
%5 = load i8*, i8** %1
%6 = load i64, i64* %2
%7 = trunc i64 %6 to i32
%8 = call i32 @snprintf(i8* %5, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i8* @libewf_generate_date_header2_value() {
%1 = tail call i8* @libewf_header_value_string_alloc(i32 20)
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @snprintf(i8* %1, i32 20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %1
}
int owHasPowerDelivery(int portnum) {
  portnum = 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @owHasPowerDelivery(i32 %0) {
ret i32 0
}
unsigned long set(unsigned long *field, unsigned long flag) {
  *field = *field | flag;
  return *field;
}


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

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

LLVM IR (-O0):
define i64 @set(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64, i64* %4
%8 = or i64 %6, %7
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = load i64*, i64** %3
%11 = load i64, i64* %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @set(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = or i64 %3, %1
store i64 %4, i64* %0
ret i64 %4
}
double abslt(double x) {
  if (x > 0)
    return x;
  return -x;
}


x86 assembly (clang, -O0):
<abslt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <abslt+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114b <abslt+0x4b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abslt>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @abslt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fneg double %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @abslt(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint32_t EMACVLANTxConfigGet(uint32_t ui32Base, uint16_t *pui16Tag) {
  uint32_t ui32Value;
  ;
  ;
  ui32Value = (*((volatile uint32_t *)(ui32Base + 0x00000584)));
  *pui16Tag = (uint16_t)((ui32Value & 0x0000FFFF) >> 0);
  return (ui32Value & ~0x0000FFFF);
}


x86 assembly (clang, -O0):
<EMACVLANTxConfigGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x584,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xffff,%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
and    $0xffff0000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACVLANTxConfigGet>:
movslq %edi,%rax
mov    0x584(%rax),%eax
movzwl %ax,%ecx
mov    %rcx,(%rsi)
and    $0xffff0000,%eax
ret

LLVM IR (-O0):
define i32 @EMACVLANTxConfigGet(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1412
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = and i32 %11, 65535
%13 = ashr i32 %12, 0
%14 = sext i32 %13 to i64
%15 = load i64*, i64** %4
store i64 %14, i64* %15
%16 = load i32, i32* %5
%17 = and i32 %16, -65536
ret i32 %17
}

LLVM IR (-O2):
define i32 @EMACVLANTxConfigGet(i32 %0, i64* nocapture writeonly %1) {
%3 = add nsw i32 %0, 1412
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 65535
%8 = zext i32 %7 to i64
store i64 %8, i64* %1
%9 = and i32 %6, -65536
ret i32 %9
}
/* Variables and functions */
unsigned strlen(const char *s) {
  const char *p = s;
  while (*p)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void RAWToYRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @RAWToYRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *);
scalar_t__ sscanf(char *, char *, unsigned long long *);
unsigned long long str_to_long_long(char *str) {
  unsigned long long result;
  if (sscanf(str, "%Lu", &result) == 0)
    print_error("Unexpected input from vnstat");
  return result;
}


x86 assembly (clang, -O0):
<str_to_long_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <sscanf@plt>
cmp    $0x0,%rax
jne    1156 <str_to_long_long+0x36>
lea    0xeb3(%rip),%rdi
call   1030 <print_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_long_long>:
push   %rax
lea    0xed8(%rip),%rsi
mov    %rsp,%rdx
call   1040 <sscanf@plt>
test   %rax,%rax
jne    1141 <str_to_long_long+0x21>
lea    0xec8(%rip),%rdi
call   1030 <print_error@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%Lu\00"
@.str.1 = [29 x i8] c"Unexpected input from vnstat\00"
define i64 @str_to_long_long(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @sscanf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @print_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%Lu\00"
@.str.1 = [29 x i8] c"Unexpected input from vnstat\00"
define i64 @str_to_long_long(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i64 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @print_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
ret i64 %9
}
void init_fm_knight(int fm[][2]) {
  int i;
  for (i = 0; i < 9; i++) {
    fm[i][0] = -1;
    fm[i][1] = -1;
  }
}


x86 assembly (clang, -O0):
<init_fm_knight>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1146 <init_fm_knight+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,0x4(%rax,%rcx,8)
ff
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init_fm_knight+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fm_knight>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,0x30(%rdi)
movdqu %xmm0,0x20(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
movq   $0xffffffffffffffff,0x40(%rdi)
ff
ret

LLVM IR (-O0):
define void @init_fm_knight([2 x i32]* %0) {
%2 = alloca [2 x i32]*
%3 = alloca i32
store [2 x i32]* %0, [2 x i32]** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 9
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load [2 x i32]*, [2 x i32]** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
store i32 -1, i32* %12
%13 = load [2 x i32]*, [2 x i32]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 %15
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 1
store i32 -1, i32* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @init_fm_knight([2 x i32]* nocapture writeonly %0) {
%2 = bitcast [2 x i32]* %0 to i8*
ret void
}
/* Variables and functions */
double pop();
int /*<<< orphan*/ push(double);
void swap() {
  double temp1 = pop();
  double temp2 = pop();
  push(temp1);
  push(temp2);
}


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

x86 assembly (clang, -O2):
<swap>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <push@plt>
movsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @swap() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @pop()
store double %3, double* %1
%4 = call double (...) @pop()
store double %4, double* %2
%5 = load double, double* %1
%6 = call i32 @push(double %5)
%7 = load double, double* %2
%8 = call i32 @push(double %7)
ret void
}

LLVM IR (-O2):
define void @swap() {
%1 = tail call double (...) @pop()
%2 = tail call double (...) @pop()
%3 = tail call i32 @push(double %1)
%4 = tail call i32 @push(double %2)
ret void
}
void drain(void) {
  while ((*(volatile unsigned long *)(0x80000000 + (0x0140))) & 0x00800000)
    ;
}


x86 assembly (clang, -O0):
<drain>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <drain+0x9>
mov    $0x80000140,%eax
mov    (%rax),%rax
and    $0x800000,%rax
cmp    $0x0,%rax
je     1126 <drain+0x26>
jmp    1109 <drain+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drain>:
mov    $0x80000140,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x800000,(%rax)
jne    1110 <drain+0x10>
ret

LLVM IR (-O0):
define void @drain() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i64, i64* inttoptr (i64 2147483968 to i64*)
%3 = and i64 %2, 8388608
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @drain() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 2147483968 to i64*)
%3 = and i64 %2, 8388608
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
float betai(double, double, int);
float student_p(int df, float t) {
  return betai(0.5 * df, 0.5, df / (df + t * t));
}


x86 assembly (clang, -O0):
<student_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xed3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
cvtsi2ssl -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
movss  -0x8(%rbp),%xmm4
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
divss  %xmm2,%xmm1
cvttss2si %xmm1,%edi
movsd  0xea3(%rip),%xmm1
call   1030 <betai@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<student_p>:
cvtsi2sd %edi,%xmm2
movsd  0xee4(%rip),%xmm1
mulsd  %xmm1,%xmm2
cvtsi2ss %edi,%xmm3
mulss  %xmm0,%xmm0
addss  %xmm3,%xmm0
divss  %xmm0,%xmm3
cvttss2si %xmm3,%edi
movapd %xmm2,%xmm0
jmp    1030 <betai@plt>

LLVM IR (-O0):
define float @student_p(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fmul double 5.000000e-01, %6
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
%12 = load float, float* %4
%13 = load float, float* %4
%14 = call float @llvm.fmuladd.f32(float %12, float %13, float %11)
%15 = fdiv float %9, %14
%16 = fptosi float %15 to i32
%17 = call float @betai(double %7, double 5.000000e-01, i32 %16)
ret float %17
}

LLVM IR (-O2):
define float @student_p(i32 %0, float %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 5.000000e-01
%5 = sitofp i32 %0 to float
%6 = tail call float @llvm.fmuladd.f32(float %1, float %1, float %5)
%7 = fdiv float %5, %6
%8 = fptosi float %7 to i32
%9 = tail call float @betai(double %4, double 5.000000e-01, i32 %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ tosFilename_split(char const *, void *, char *, void *);
void tosFilename_getName(const char *pszFilename, char *pszName) {
  tosFilename_split(pszFilename, ((void *)0), pszName, ((void *)0));
}


x86 assembly (clang, -O0):
<tosFilename_getName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
call   1030 <tosFilename_split@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosFilename_getName>:
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <tosFilename_split@plt>

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

LLVM IR (-O2):
define void @tosFilename_getName(i8* %0, i8* %1) {
%3 = tail call i32 @tosFilename_split(i8* %0, i8* null, i8* %1, i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  while (1)
    printf("%s", argv[0]);
}


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)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
jmp    112a <main+0x1a>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
lea    0xee2(%rip),%r14
xchg   %ax,%ax
mov    (%rbx),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
br label %4
4: ; preds = %3, %4
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %4
}
void read_mesh_databases_mpi_oc_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @read_mesh_databases_mpi_oc_adios_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M701_f(char *s) {
  debug("M701_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M701_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M701_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M701_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M701_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M701_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M701_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
double dmin(double, double);
double min_dvector(double *d, long n) {
  double mindv = 1.0e+18;
  long i;
  for (i = 1; i <= n; i++)
    mindv = dmin(mindv, d[i]);
  return mindv;
}


x86 assembly (clang, -O0):
<min_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     1170 <min_dvector+0x60>
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <dmin@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1135 <min_dvector+0x25>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_dvector>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1147 <min_dvector+0x37>
mov    %rsi,%r15
mov    %rdi,%r14
movsd  0xed8(%rip),%xmm0
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  0x8(%r14,%rbx,8),%xmm1
call   1030 <dmin@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <min_dvector+0x20>
jmp    114f <min_dvector+0x3f>
movsd  0xeb1(%rip),%xmm0
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @min_dvector(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
%5 = alloca double
%6 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
store double 1.000000e+18, double* %5
store i64 1, i64* %6
br label %7
7: ; preds = %18, %2
%8 = load i64, i64* %6
%9 = load i64, i64* %4
%10 = icmp sle i64 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load double, double* %5
%13 = load double*, double** %3
%14 = load i64, i64* %6
%15 = getelementptr inbounds double, double* %13, i64 %14
%16 = load double, double* %15
%17 = call double @dmin(double %12, double %16)
store double %17, double* %5
br label %18
18: ; preds = %11
%19 = load i64, i64* %6
%20 = add nsw i64 %19, 1
store i64 %20, i64* %6
br label %7
21: ; preds = %7
%22 = load double, double* %5
ret double %22
}

LLVM IR (-O2):
define double @min_dvector(double* nocapture %0, i64 %1) {
%3 = icmp slt i64 %1, 1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 1, %2 ]
%6 = phi double [ %9, %4 ], [ 1.000000e+18, %2 ]
%7 = getelementptr inbounds double, double* %0, i64 %5
%8 = load double, double* %7
%9 = tail call double @dmin(double %6, double %8)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %5, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi double [ 1.000000e+18, %2 ], [ %9, %4 ]
ret double %13
}
float fp_mul(float a, float b) { return a * b; }


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

x86 assembly (clang, -O2):
<fp_mul>:
mulss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fp_mul(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ backup_folder(char *, char *);
int /*<<< orphan*/ logInfoMessage(char *);
void exec3(char *source, char *target) {
  logInfoMessage("backup starting");
  backup_folder(source, target);
  logInfoMessage("updating and backing completed");
}


x86 assembly (clang, -O0):
<exec3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1040 <logInfoMessage@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <backup_folder@plt>
lea    0xec0(%rip),%rdi
call   1040 <logInfoMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1040 <logInfoMessage@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <backup_folder@plt>
lea    0xec8(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <logInfoMessage@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"backup starting\00"
@.str.1 = [31 x i8] c"updating and backing completed\00"
define void @exec3(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @logInfoMessage(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @backup_folder(i8* %6, i8* %7)
%9 = call i32 @logInfoMessage(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"backup starting\00"
@.str.1 = [31 x i8] c"updating and backing completed\00"
define void @exec3(i8* %0, i8* %1) {
%3 = tail call i32 @logInfoMessage(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @backup_folder(i8* %0, i8* %1)
%5 = tail call i32 @logInfoMessage(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};
typedef scalar_t__ speed_t;

/* Variables and functions */
int cfsetospeed(struct termios *, scalar_t__);
int cfsetispeed(struct termios *tio, speed_t speed) {
  return speed ? cfsetospeed(tio, speed) : 0;
}


x86 assembly (clang, -O0):
<cfsetispeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <cfsetispeed+0x30>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cfsetospeed@plt>
mov    %eax,-0x14(%rbp)
jmp    114a <cfsetispeed+0x3a>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <cfsetispeed+0x3a>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfsetispeed>:
test   %rsi,%rsi
je     111a <cfsetispeed+0xa>
jmp    1030 <cfsetospeed@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfsetispeed(%struct.termios* %0, i64 %1) {
%3 = alloca %struct.termios*
%4 = alloca i64
store %struct.termios* %0, %struct.termios** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load %struct.termios*, %struct.termios** %3
%9 = load i64, i64* %4
%10 = call i32 @cfsetospeed(%struct.termios* %8, i64 %9)
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %7
%13 = phi i32 [ %10, %7 ], [ 0, %11 ]
ret i32 %13
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfsetispeed(%struct.termios* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @cfsetospeed(%struct.termios* %0, i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *x_calloc(size_t count, size_t size) {
  void *mem = calloc(count, size);
  if (!mem) {
    fprintf(stderr, "Unable to allocate memory\n");
    exit(EXIT_FAILURE);
  }
  return mem;
}


x86 assembly (clang, -O0):
<x_calloc>:
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 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <x_calloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <x_calloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Unable to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @x_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Unable to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
int fun_base_3(int a, int b, int c) { return 0; }


x86 assembly (clang, -O0):
<fun_base_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun_base_3(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
ret i32 0
}

LLVM IR (-O2):
define i32 @fun_base_3(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c_wait_running_job_send();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *get_output_file(int *);
int /*<<< orphan*/ stderr;
int tail_file(char *, int);
int c_cat() {
  char *str;
  int pid;
  str = get_output_file(&pid);
  if (str == 0) {
    fprintf(stderr, "The output is not stored. Cannot cat.\n");
    exit(-1);
  }
  c_wait_running_job_send();
  return tail_file(str, -1);
}


x86 assembly (clang, -O0):
<c_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1060 <get_output_file@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    118f <c_cat+0x3f>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe80(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1040 <c_wait_running_job_send@plt>
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%esi
call   1030 <tail_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_cat>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdi
call   1060 <get_output_file@plt>
test   %rax,%rax
je     1181 <c_cat+0x31>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <c_wait_running_job_send@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1030 <tail_file@plt>
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"The output is not stored. Cannot cat.\0A\00"
define i32 @c_cat() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @get_output_file(i32* %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %0
%11 = call i32 (...) @c_wait_running_job_send()
%12 = load i8*, i8** %1
%13 = call i32 @tail_file(i8* %12, i32 -1)
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"The output is not stored. Cannot cat.\0A\00"
define i32 @c_cat() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i8* @get_output_file(i32* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = call i32 (...) @c_wait_running_job_send()
%11 = call i32 @tail_file(i8* %3, i32 -1)
ret i32 %11
}
void fc105(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
  a : {
    typedef int(*d)[n];
    0;
  };
    typedef int(*e)[n];
    goto a;
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc105>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc105+0x7>

x86 assembly (clang, -O2):
<fc105>:
jmp    1100 <fc105>

LLVM IR (-O0):
define void @fc105(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %1
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %7
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc105(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
unsigned int target_gpio_led_get_count(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @target_gpio_led_get_count() {
ret i32 4
}

LLVM IR (-O2):
define i32 @target_gpio_led_get_count() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *errstr) {
  assert(errstr);
  fprintf(stderr, "error: %s\n", errstr);
}


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

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"error: %s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int _islower(int c) {
  if (c >= 'a' && c <= 'z') {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <_islower+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <_islower+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <_islower+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ AND_();
int /*<<< orphan*/ c64_memZeroX();
void AND_zpx(void) {
  c64_memZeroX();
  AND_();
}


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

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

LLVM IR (-O0):
define void @AND_zpx() {
%1 = call i32 (...) @c64_memZeroX()
%2 = call i32 (...) @AND_()
ret void
}

LLVM IR (-O2):
define void @AND_zpx() {
%1 = tail call i32 (...) @c64_memZeroX()
%2 = tail call i32 (...) @AND_()
ret void
}