xunge/DecIR huggingface dataset:
char *basename(char *str) {
  char *s;
  char *ret = str;
  for (s = str; *s; ++s) {
    if (*s == '/')
      ret = s + 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <basename+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1141 <basename+0x41>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <basename+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <basename+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <basename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <basename+0x10>
test   %dl,%dl
jne    1113 <basename+0x13>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
void f5() {
  int x = 4;
  int *p = &x;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f5() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *SysAllocString(const char *str) {
  size_t nz = strlen(str);
  char *cArr = (char *)malloc(nz);
  memcpy(cArr, str, nz);
  return cArr;
}


x86 assembly (clang, -O0):
<SysAllocString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysAllocString>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @SysAllocString(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @SysAllocString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ lua_delfile();
void lua_closestring(void) { lua_delfile(); }


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

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

LLVM IR (-O0):
define void @lua_closestring() {
%1 = call i32 (...) @lua_delfile()
ret void
}

LLVM IR (-O2):
define void @lua_closestring() {
%1 = tail call i32 (...) @lua_delfile()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_meloner();
void test_hutaow() {
  test_meloner();
  return;
}


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

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

LLVM IR (-O0):
define void @test_hutaow() {
%1 = call i32 (...) @test_meloner()
ret void
}

LLVM IR (-O2):
define void @test_hutaow() {
%1 = tail call i32 (...) @test_meloner()
ret void
}
int modbus_check_header(unsigned char *packet) {
  return ((*(packet + 2)) == 0 && (*(packet + 3)) == 0 &&
          (*(packet + 4)) == 0 && (*(packet + 5)) > 0)
             ? 0
             : -1;
}


x86 assembly (clang, -O0):
<modbus_check_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    115b <modbus_check_header+0x5b>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    115b <modbus_check_header+0x5b>
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    115b <modbus_check_header+0x5b>
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
cmp    $0x0,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0xffffffff,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbus_check_header>:
mov    $0xffffffff,%eax
cmpb   $0x0,0x2(%rdi)
je     110c <modbus_check_header+0xc>
ret
cmpb   $0x0,0x3(%rdi)
jne    110b <modbus_check_header+0xb>
cmpb   $0x0,0x4(%rdi)
jne    110b <modbus_check_header+0xb>
cmpb   $0x1,0x5(%rdi)
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @modbus_check_header(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = getelementptr inbounds i8, i8* %0, i64 5
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
%17 = sext i1 %16 to i32
br label %18
18: ; preds = %13, %9, %5, %1
%19 = phi i32 [ -1, %9 ], [ -1, %5 ], [ -1, %1 ], [ %17, %13 ]
ret i32 %19
}
void func(int a[]) {
  int i;
#pragma acc data copyout(a [0:N])
  {
#pragma acc parallel loop
    for (i = 0; i < 10; i++) {
      a[i] = 100;
    }
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1136 <func+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x64,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <func+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movabs $0x6400000064,%rax
mov    %rax,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @func(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 100, i32 100, i32 100, i32 100>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 100, i32 100, i32 100, i32 100>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 100, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 9
store i32 100, i32* %6
ret void
}
/* Variables and functions */
double __daylen__(int, int, int, double, double, double, int /*<<< orphan*/);
double day_civil_twilight_length(int year, int month, int day, double lon,
                                 double lat) {
  return __daylen__(year, month, day, lon, lat, -6.0, 0);
}


x86 assembly (clang, -O0):
<day_civil_twilight_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xeba(%rip),%xmm2
xor    %ecx,%ecx
call   1030 <__daylen__@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<day_civil_twilight_length>:
movsd  0xee8(%rip),%xmm2
xor    %ecx,%ecx
jmp    1030 <__daylen__@plt>

LLVM IR (-O0):
define double @day_civil_twilight_length(i32 %0, i32 %1, i32 %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double %3, double* %9
store double %4, double* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load double, double* %9
%15 = load double, double* %10
%16 = call double @__daylen__(i32 %11, i32 %12, i32 %13, double %14, double %15, double -6.000000e+00, i32 0)
ret double %16
}

LLVM IR (-O2):
define double @day_civil_twilight_length(i32 %0, i32 %1, i32 %2, double %3, double %4) {
%6 = tail call double @__daylen__(i32 %0, i32 %1, i32 %2, double %3, double %4, double -6.000000e+00, i32 0)
ret double %6
}
void greenDownhill() {}


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

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

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

LLVM IR (-O2):
define void @greenDownhill() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
float __VERIFIER_nondet_float();
int main(void) {
  float a = __VERIFIER_nondet_float();
  if (a < 0) {
    return 0;
  }
  __VERIFIER_assert(a >= 1);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_float@plt>
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1154 <main+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1179 <main+0x59>
movss  -0x8(%rbp),%xmm0
movss  0xe9f(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_float@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1154 <main+0x34>
xor    %edi,%edi
ucomiss 0xec1(%rip),%xmm0
setae  %dil
movss  %xmm0,0xc(%rsp)
call   1030 <__VERIFIER_assert@plt>
cvttss2si 0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float (...) @__VERIFIER_nondet_float()
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %14
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp oge float %8, 1.000000e+00
%10 = zext i1 %9 to i32
%11 = call i32 @__VERIFIER_assert(i32 %10)
%12 = load float, float* %2
%13 = fptosi float %12 to i32
store i32 %13, i32* %1
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @__VERIFIER_nondet_float()
%2 = fcmp olt float %1, 0.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = fcmp oge float %1, 1.000000e+00
%5 = zext i1 %4 to i32
%6 = tail call i32 @__VERIFIER_assert(i32 %5)
%7 = fptosi float %1 to i32
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ %7, %3 ], [ 0, %0 ]
ret i32 %9
}
/* Type definitions */
struct ring_buf {
  int dummy;
};

/* Variables and functions */
scalar_t__ ring_buf_len(struct ring_buf *);
int ring_buf_is_empty(struct ring_buf *rb) { return ring_buf_len(rb) == 0; }


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

x86 assembly (clang, -O2):
<ring_buf_is_empty>:
push   %rax
call   1030 <ring_buf_len@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ring_buf = type { i32 }
define i32 @ring_buf_is_empty(%struct.ring_buf* %0) {
%2 = alloca %struct.ring_buf*
store %struct.ring_buf* %0, %struct.ring_buf** %2
%3 = load %struct.ring_buf*, %struct.ring_buf** %2
%4 = call i64 @ring_buf_len(%struct.ring_buf* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.ring_buf = type { i32 }
define i32 @ring_buf_is_empty(%struct.ring_buf* %0) {
%2 = tail call i64 @ring_buf_len(%struct.ring_buf* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void ac_do_stat(void) {}


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

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

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

LLVM IR (-O2):
define void @ac_do_stat() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ struct_complex_1_x();
int main() {
  struct_complex_1_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <struct_complex_1_x@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <struct_complex_1_x@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @struct_complex_1_x()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_complex_1_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int ebbrt_newlib_lseek(int, int, int);
int lseek(int file, int ptr, int dir) {
  return ebbrt_newlib_lseek(file, ptr, dir);
}


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

x86 assembly (clang, -O2):
<lseek>:
jmp    1030 <ebbrt_newlib_lseek@plt>

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

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @ebbrt_newlib_lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ beep();
void os_beep(int number) { beep(); }


x86 assembly (clang, -O0):
<os_beep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <beep@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @os_beep(i32 %0) {
%2 = tail call i32 (...) @beep()
ret void
}
/* Variables and functions */
float cblas_sdot(int const, float const *, int const, float const *, int const);
void acc_sdot_(const int *N, const float *X, const int *incX, const float *Y,
               const int *incY, float *result) {
  *result = cblas_sdot(*N, X, *incX, Y, *incY);
}


x86 assembly (clang, -O0):
<acc_sdot_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
call   1030 <cblas_sdot@plt>
mov    -0x30(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_sdot_>:
push   %rbx
mov    %r9,%rbx
mov    (%rdi),%edi
mov    (%rdx),%edx
mov    (%r8),%r8d
call   1030 <cblas_sdot@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @acc_sdot_(i32* %0, float* %1, i32* %2, float* %3, i32* %4, float* %5) {
%7 = alloca i32*
%8 = alloca float*
%9 = alloca i32*
%10 = alloca float*
%11 = alloca i32*
%12 = alloca float*
store i32* %0, i32** %7
store float* %1, float** %8
store i32* %2, i32** %9
store float* %3, float** %10
store i32* %4, i32** %11
store float* %5, float** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load float*, float** %8
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load float*, float** %10
%19 = load i32*, i32** %11
%20 = load i32, i32* %19
%21 = call float @cblas_sdot(i32 %14, float* %15, i32 %17, float* %18, i32 %20)
%22 = load float*, float** %12
store float %21, float* %22
ret void
}

LLVM IR (-O2):
define void @acc_sdot_(i32* nocapture %0, float* %1, i32* nocapture %2, float* %3, i32* nocapture %4, float* nocapture writeonly %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = tail call float @cblas_sdot(i32 %7, float* %1, i32 %8, float* %3, i32 %9)
store float %10, float* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(void *);
int main() {
  void *message = "Hello World";
  puts(message);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_saturating_add(int x, int y) {
  long long llx = (long long)x;
  long long lly = (long long)y;
  long long llsum = llx + lly;
  int INT_MAX = ~(1 << ((sizeof(int) << 3) - 1));
  int INT_MIN = INT_MAX + 1;
  int sum = (int)llsum;
  if (sum == llsum)
    return sum;
  if (llsum < 0)
    return INT_MIN;
  return INT_MAX;
}


x86 assembly (clang, -O0):
<test_saturating_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x7fffffff,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <test_saturating_add+0x56>
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <test_saturating_add+0x72>
cmpq   $0x0,-0x28(%rbp)
jge    116c <test_saturating_add+0x6c>
mov    -0x30(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <test_saturating_add+0x72>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_saturating_add>:
lea    (%rdi,%rsi,1),%eax
sar    $0x1f,%eax
xor    $0x80000000,%eax
add    %esi,%edi
cmovno %edi,%eax
ret

LLVM IR (-O0):
define i32 @test_saturating_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
store i64 %13, i64* %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
store i64 %15, i64* %7
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = add nsw i64 %16, %17
store i64 %18, i64* %8
store i32 2147483647, i32* %9
%19 = load i32, i32* %9
%20 = add nsw i32 %19, 1
store i32 %20, i32* %10
%21 = load i64, i64* %8
%22 = trunc i64 %21 to i32
store i32 %22, i32* %11
%23 = load i32, i32* %11
%24 = sext i32 %23 to i64
%25 = load i64, i64* %8
%26 = icmp eq i64 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %2
%28 = load i32, i32* %11
store i32 %28, i32* %3
br label %36
29: ; preds = %2
%30 = load i64, i64* %8
%31 = icmp slt i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = load i32, i32* %10
store i32 %33, i32* %3
br label %36
34: ; preds = %29
%35 = load i32, i32* %9
store i32 %35, i32* %3
br label %36
36: ; preds = %34, %32, %27
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @test_saturating_add(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.sadd.sat.i32(i32 %0, i32 %1)
ret i32 %3
}
int vmax(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<vmax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <vmax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <vmax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @vmax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hsp_subevent_speaker_gain_changed_get_gain(const uint8_t *event) {
  return event[3];
}


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

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

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

LLVM IR (-O2):
define i32 @hsp_subevent_speaker_gain_changed_get_gain(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
struct sb *tux_sb(struct sb *sb) {
  return sb;
}


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

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

LLVM IR (-O0):
%struct.sb = type opaque
define %struct.sb* @tux_sb(%struct.sb* %0) {
%2 = alloca %struct.sb*
store %struct.sb* %0, %struct.sb** %2
%3 = load %struct.sb*, %struct.sb** %2
ret %struct.sb* %3
}

LLVM IR (-O2):
%struct.sb = type opaque
define %struct.sb* @tux_sb(%struct.sb* readnone returned %0) {
ret %struct.sb* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ pm_close(int /*<<< orphan*/ *const);
void pm_closer(FILE *const f) { pm_close(f); }


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

x86 assembly (clang, -O2):
<pm_closer>:
jmp    1030 <pm_close@plt>

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

LLVM IR (-O2):
define void @pm_closer(i32* %0) {
%2 = tail call i32 @pm_close(i32* %0)
ret void
}
/* Variables and functions */
int func(int);
int /*<<< orphan*/ printf(char *, int);
int plugin(int i) {
  printf("%d\n", func(i));
  return 0;
}


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

x86 assembly (clang, -O2):
<plugin>:
push   %rax
call   1040 <func@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @plugin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @func(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @gencvt_s_d() {
ret void
}
int ext3_acl_chmod(struct inode *inode) { return 0; }


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define i32 @ext3_acl_chmod(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret i32 0
}

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @ext3_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
void avformat_get_class() {}


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

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

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

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

/* Variables and functions */
char const *config_acccl(struct configuration *, struct access **, int);
const char *config_clients(struct configuration *p, struct access **ls) {
  return config_acccl(p, ls, 1);
}


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

x86 assembly (clang, -O2):
<config_clients>:
mov    $0x1,%edx
jmp    1030 <config_acccl@plt>

LLVM IR (-O0):
%struct.configuration = type { i32 }
%struct.access = type { i32 }
define i8* @config_clients(%struct.configuration* %0, %struct.access** %1) {
%3 = alloca %struct.configuration*
%4 = alloca %struct.access**
store %struct.configuration* %0, %struct.configuration** %3
store %struct.access** %1, %struct.access*** %4
%5 = load %struct.configuration*, %struct.configuration** %3
%6 = load %struct.access**, %struct.access*** %4
%7 = call i8* @config_acccl(%struct.configuration* %5, %struct.access** %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
%struct.configuration = type { i32 }
%struct.access = type { i32 }
define i8* @config_clients(%struct.configuration* %0, %struct.access** %1) {
%3 = tail call i8* @config_acccl(%struct.configuration* %0, %struct.access** %1, i32 1)
ret i8* %3
}
/* Type definitions */
struct search_context {
  int dummy;
};

/* Variables and functions */
int _insert(struct search_context *, int);
int search_add(struct search_context *c, int data) {
  if (!c)
    return -1;
  return _insert(c, data);
}


x86 assembly (clang, -O0):
<search_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <search_add+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <search_add+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <_insert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_add>:
test   %rdi,%rdi
je     111a <search_add+0xa>
jmp    1030 <_insert@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.search_context = type { i32 }
define i32 @search_add(%struct.search_context* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.search_context*
%5 = alloca i32
store %struct.search_context* %0, %struct.search_context** %4
store i32 %1, i32* %5
%6 = load %struct.search_context*, %struct.search_context** %4
%7 = icmp ne %struct.search_context* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i32 -1, i32* %3
br label %13
9: ; preds = %2
%10 = load %struct.search_context*, %struct.search_context** %4
%11 = load i32, i32* %5
%12 = call i32 @_insert(%struct.search_context* %10, i32 %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.search_context = type { i32 }
define i32 @search_add(%struct.search_context* %0, i32 %1) {
%3 = icmp eq %struct.search_context* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @_insert(%struct.search_context* %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
void av_get_cpu_flags() {}


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

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

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

LLVM IR (-O2):
define void @av_get_cpu_flags() {
ret void
}
int my_strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2) {
    if (*s1 == '\0')
      return (0);
    ++s1;
    ++s2;
  }
  return (*s1 - *s2);
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <my_strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <my_strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <my_strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <my_strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <my_strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <my_strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ SSIBaseValid(unsigned long);
void SSIDataGet(unsigned long ulBase, unsigned long *pulData) {
  DEBUG_ASSERT(SSIBaseValid(ulBase));
  while (!((*((volatile unsigned long *)(ulBase + 0x0000000C))) & 0x00000004)) {
  }
  *pulData = (*((volatile unsigned long *)(ulBase + 0x00000008)));
}


x86 assembly (clang, -O0):
<SSIDataGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rax
and    $0x4,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1162 <SSIDataGet+0x42>
jmp    1167 <SSIDataGet+0x47>
jmp    1140 <SSIDataGet+0x20>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIDataGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
cs nopw 0x0(%rax,%rax,1)
testq  $0x4,0xc(%rbx)
je     1140 <SSIDataGet+0x20>
mov    0x8(%rbx),%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SSIDataGet(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 = call i32 @SSIBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
br label %8
8: ; preds = %16, %2
%9 = load i64, i64* %3
%10 = add i64 %9, 12
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 4
%14 = icmp ne i64 %13, 0
%15 = xor i1 %14, true
br i1 %15, label %16, label %17
16: ; preds = %8
br label %8
17: ; preds = %8
%18 = load i64, i64* %3
%19 = add i64 %18, 8
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
%22 = load i64*, i64** %4
store i64 %21, i64* %22
ret void
}

LLVM IR (-O2):
define void @SSIDataGet(i64 %0, i64* nocapture writeonly %1) {
%3 = tail call i32 @SSIBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 12
%6 = inttoptr i64 %5 to i64*
br label %7
7: ; preds = %7, %2
%8 = load volatile i64, i64* %6
%9 = and i64 %8, 4
%10 = icmp eq i64 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = add i64 %0, 8
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vseqx_get_progressive(const uint8_t *p_mp2vseqx) {
  return !!(p_mp2vseqx[5] & 0x8);
}


x86 assembly (clang, -O0):
<mp2vseqx_get_progressive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_get_progressive>:
mov    0x14(%rdi),%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vseqx_get_progressive(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vseqx_get_progressive(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 1
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t sum_addc(uint32_t a, uint32_t b) {
  uint32_t c;
  c = a + b;
  if (c < a)
    c++;
  return c;
}


x86 assembly (clang, -O0):
<sum_addc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1132 <sum_addc+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_addc>:
lea    (%rdi,%rsi,1),%rax
shr    $0x3f,%rsi
add    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @sum_addc(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = lshr i64 %1, 63
%5 = add nsw i64 %3, %4
ret i64 %5
}
void cijfersom(int n, int *r) {
  int totaal;
  while (n > 0) {
    totaal = totaal + (n % 10);
    n = n / 10;
  }
  *r = totaal;
}


x86 assembly (clang, -O0):
<cijfersom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1141 <cijfersom+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110b <cijfersom+0xb>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cijfersom>:
test   %edi,%edi
jle    1132 <cijfersom+0x32>
mov    $0xcccccccd,%r8d
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%ecx
lea    (%rcx,%rcx,4),%r9d
mov    %edi,%ecx
sub    %r9d,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <cijfersom+0x10>
mov    %eax,(%rsi)
ret
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @cijfersom(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ undef, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = urem i32 %6, 10
%8 = add nsw i32 %5, %7
%9 = udiv i32 %6, 10
%10 = icmp ult i32 %6, 10
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ undef, %2 ], [ %8, %4 ]
store i32 %12, i32* %1
ret void
}
void ColorChange() {}


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

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

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

LLVM IR (-O2):
define void @ColorChange() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DymosimMessage(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, double);
void SolveScalarWarning(const char *xs, double x) {
  char s[1000];
  sprintf(
      s,
      "Singular scalar system. Using minimum norm solution for %.400s = %g\n",
      xs, x);
  DymosimMessage(s);
}


x86 assembly (clang, -O0):
<SolveScalarWarning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rdx
movsd  -0x10(%rbp),%xmm0
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <DymosimMessage@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SolveScalarWarning>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <DymosimMessage@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"Singular scalar system. Using minimum norm solution for %.400s = %g\0A\00"
define void @SolveScalarWarning(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load double, double* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %7, double %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @DymosimMessage(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c"Singular scalar system. Using minimum norm solution for %.400s = %g\0A\00"
define void @SolveScalarWarning(i8* %0, double %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %0, double %1)
%6 = call i32 @DymosimMessage(i8* %4)
ret void
}
/* Variables and functions */
char *malloc(size_t);
char rndchr(char *);
char *rndstr(char *map, size_t strsize) {
  char *result = malloc(strsize);
  size_t i;
  for (i = 0; i < strsize; i++) {
    *(result + i) = rndchr(map);
  };
  return result;
}


x86 assembly (clang, -O0):
<rndstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117a <rndstr+0x5a>
mov    -0x8(%rbp),%rdi
call   1040 <rndchr@plt>
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1145 <rndstr+0x25>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndstr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <malloc@plt>
mov    %rax,%r12
test   %r15,%r15
je     1155 <rndstr+0x35>
xor    %ebx,%ebx
mov    %r14,%rdi
call   1040 <rndchr@plt>
mov    %al,(%r12,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <rndstr+0x20>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @rndstr(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i64 %1, 0
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = tail call signext i8 @rndchr(i8* %0)
%8 = getelementptr inbounds i8, i8* %3, i64 %6
store i8 %7, i8* %8
%9 = add nuw i64 %6, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %5
11: ; preds = %5, %2
ret i8* %3
}