xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t hex_uint64_t(int /*<<< orphan*/, char *);
size_t variantkey_hex(uint64_t vk, char *str) { return hex_uint64_t(vk, str); }


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

x86 assembly (clang, -O2):
<variantkey_hex>:
jmp    1030 <hex_uint64_t@plt>

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

LLVM IR (-O2):
define i64 @variantkey_hex(i32 %0, i8* %1) {
%3 = tail call i64 @hex_uint64_t(i32 %0, i8* %1)
ret i64 %3
}
int strlengIgnoreSlash(char *string) {
  int i = 0;
  int count = 0;
  while (string[i] != '\0') {
    i++;
    count++;
    if (string[i] == '\\') {
      count--;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<strlengIgnoreSlash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <strlengIgnoreSlash+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    115b <strlengIgnoreSlash+0x5b>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <strlengIgnoreSlash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlengIgnoreSlash>:
cmpb   $0x0,(%rdi)
je     1126 <strlengIgnoreSlash+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
xor    %edx,%edx
cmp    $0x5c,%cl
setne  %dl
add    %edx,%eax
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strlengIgnoreSlash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlengIgnoreSlash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 92
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %6, %11
%13 = icmp eq i8 %9, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %15
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *pathlast(const char *path) {
  const char *s;
  s = strrchr(path, '/');
  if (s == NULL)
    return (path);
  return (++s);
}


x86 assembly (clang, -O0):
<pathlast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <pathlast+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <pathlast+0x46>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathlast>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @pathlast(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int get_tab_size(int char_index) {
  while ((char_index % 4) != 0) {
    ++char_index;
  }
  return char_index;
}


x86 assembly (clang, -O0):
<get_tab_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1129 <get_tab_size+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <get_tab_size+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tab_size>:
mov    %edi,%eax
neg    %eax
and    $0x3,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_tab_size(i32 %0) {
%2 = sub i32 0, %0
%3 = and i32 %2, 3
%4 = add i32 %3, %0
ret i32 %4
}
void IWDGTimerPrescalerSet(unsigned long ulDivide) {

  ;
  (*((volatile unsigned long *)(0x40003000))) = 0x00005555;
  (*((volatile unsigned long *)(0x40003004))) = ulDivide;
}


x86 assembly (clang, -O0):
<IWDGTimerPrescalerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x40003000,%eax
movq   $0x5555,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x40003004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IWDGTimerPrescalerSet>:
movq   $0x5555,0x40003000
mov    %rdi,0x40003004
40
ret

LLVM IR (-O0):
define void @IWDGTimerPrescalerSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
store volatile i64 21845, i64* inttoptr (i64 1073754112 to i64*)
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1073754116 to i64*)
ret void
}

LLVM IR (-O2):
define void @IWDGTimerPrescalerSet(i64 %0) {
store volatile i64 21845, i64* inttoptr (i64 1073754112 to i64*)
store volatile i64 %0, i64* inttoptr (i64 1073754116 to i64*)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ i2cRead(int, int, unsigned char *);
uint16_t mpl3115ReadTemp() {
  unsigned char data = 0;
  uint16_t val = 0;
  i2cRead(0x60, 0x04, &data);
  val = data;
  val <<= 8;
  i2cRead(0x60, 0x05, &data);
  val += data;
  return val >> 8 & 0xff;
}


x86 assembly (clang, -O0):
<mpl3115ReadTemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x60,%edi
mov    $0x4,%esi
lea    -0x1(%rbp),%rdx
call   1030 <i2cRead@plt>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x60,%edi
mov    $0x5,%esi
lea    -0x1(%rbp),%rdx
call   1030 <i2cRead@plt>
movzbl -0x1(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpl3115ReadTemp>:
push   %rbp
push   %rbx
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rbx
mov    $0x60,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <i2cRead@plt>
movzbl 0x7(%rsp),%ebp
mov    $0x60,%edi
mov    $0x5,%esi
mov    %rbx,%rdx
call   1030 <i2cRead@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mpl3115ReadTemp() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i32 @i2cRead(i32 96, i32 4, i8* %1)
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
store i32 %7, i32* %2
%8 = call i32 @i2cRead(i32 96, i32 5, i8* %1)
%9 = load i8, i8* %1
%10 = zext i8 %9 to i32
%11 = load i32, i32* %2
%12 = add nsw i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
ret i32 %15
}

LLVM IR (-O2):
define i32 @mpl3115ReadTemp() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @i2cRead(i32 96, i32 4, i8* %1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = call i32 @i2cRead(i32 96, i32 5, i8* %1)
ret i32 %4
}
int test_imm_60int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x60 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_60int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x60,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_60int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 412316860416
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t readlink(char *, char *, int);
size_t getBinaryPathBuffer(char *buf, int bufLen) {
  return readlink("/proc/self/exe", buf, bufLen);
}


x86 assembly (clang, -O0):
<getBinaryPathBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <readlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBinaryPathBuffer>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <readlink@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i64 @getBinaryPathBuffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i64 %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i64 @getBinaryPathBuffer(i8* nocapture %0, i32 %1) {
%3 = tail call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i64 %3
}
void __attribute__((flatten)) direct(void) { direct(); }


x86 assembly (clang, -O0):
<direct>:
push   %rbp
mov    %rsp,%rbp
call   1030 <direct@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @direct() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int BIT(int);
scalar_t__ wpa_key_mgmt_wpa(int);
int wpa_key_mgmt_wpa_any(int akm) {
  return wpa_key_mgmt_wpa(akm) || (akm & BIT(4));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_wpa_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <wpa_key_mgmt_wpa@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1165 <wpa_key_mgmt_wpa_any+0x45>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_wpa_any>:
push   %rbx
mov    %edi,%ebx
call   1040 <wpa_key_mgmt_wpa@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <wpa_key_mgmt_wpa_any+0x17>
pop    %rbx
ret
mov    $0x4,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ebx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wpa_key_mgmt_wpa_any(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @wpa_key_mgmt_wpa(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @BIT(i32 4)
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ true, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @wpa_key_mgmt_wpa_any(i32 %0) {
%2 = tail call i64 @wpa_key_mgmt_wpa(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @BIT(i32 4)
%6 = and i32 %5, %0
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %10
}
void early_gart_iommu_check(void) {}


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

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

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

LLVM IR (-O2):
define void @early_gart_iommu_check() {
ret void
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *la_memset(void *s, int c, size_t n) { return memset(s, c, n); }


x86 assembly (clang, -O0):
<la_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<la_memset>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @la_memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = load i64, i64* %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @la_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
double seconds() {
  struct timeval tp;
  struct timezone tzp;
  int i = gettimeofday(&tp, &tzp);
  return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    %eax,-0x1c(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @seconds() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
ret double %12
}
void gtk_range_set_value() {}


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

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

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

LLVM IR (-O2):
define void @gtk_range_set_value() {
ret void
}
int SampleFunction2() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SampleFunction2() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t l2cap_event_channel_opened_get_psm(const uint8_t *event) {
  return little_endian_read_16(event, 11);
}


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

x86 assembly (clang, -O2):
<l2cap_event_channel_opened_get_psm>:
mov    $0xb,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @l2cap_event_channel_opened_get_psm(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 11)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ perf_cmp(int);
int /*<<< orphan*/ perf_encdec(int);
int main() {
  perf_cmp(1);
  perf_cmp(10);
  perf_encdec(1);
  perf_encdec(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <perf_cmp@plt>
mov    $0xa,%edi
call   1030 <perf_cmp@plt>
mov    $0x1,%edi
call   1040 <perf_encdec@plt>
mov    $0xa,%edi
call   1040 <perf_encdec@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <perf_cmp@plt>
mov    $0xa,%edi
call   1030 <perf_cmp@plt>
mov    $0x1,%edi
call   1040 <perf_encdec@plt>
mov    $0xa,%edi
call   1040 <perf_encdec@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @perf_cmp(i32 1)
%3 = call i32 @perf_cmp(i32 10)
%4 = call i32 @perf_encdec(i32 1)
%5 = call i32 @perf_encdec(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @perf_cmp(i32 1)
%2 = tail call i32 @perf_cmp(i32 10)
%3 = tail call i32 @perf_encdec(i32 1)
%4 = tail call i32 @perf_encdec(i32 10)
ret i32 0
}
/* Variables and functions */
float sla_rvlsrd_(float *, float *);
float slaRvlsrd(float ra, float dec) {
  float RA;
  float DEC;
  float result;
  RA = ra;
  DEC = dec;
  result = sla_rvlsrd_(&RA, &DEC);
  return result;
}


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

x86 assembly (clang, -O2):
<slaRvlsrd>:
push   %rax
movss  %xmm0,0x4(%rsp)
movss  %xmm1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <sla_rvlsrd_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define float @slaRvlsrd(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %3 to i8*
%6 = bitcast float* %4 to i8*
store float %0, float* %3
store float %1, float* %4
%7 = call float @sla_rvlsrd_(float* %3, float* %4)
ret float %7
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int machdep_sys_open(char *, int, int);
machdep_sys_creat(char *path, int mode) {
  return (machdep_sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, mode));
}


x86 assembly (clang, -O0):
<machdep_sys_creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ec5(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <machdep_sys_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_creat>:
mov    0x2eb1(%rip),%rcx
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <machdep_sys_open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @machdep_sys_creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_WRONLY
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @machdep_sys_open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @machdep_sys_creat(i8* %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @machdep_sys_open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
void g_hash_table_foreach_steal() {}


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

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

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

LLVM IR (-O2):
define void @g_hash_table_foreach_steal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runtime_gosched();
void go_yield() { runtime_gosched(); }


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

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

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

LLVM IR (-O2):
define void @go_yield() {
%1 = tail call i32 (...) @runtime_gosched()
ret void
}
unsigned short ip_fast_csum(const void *iph, unsigned int ihl) {
  return ~do_csum(iph, ihl * 4);
}


x86 assembly (clang, -O0):
<ip_fast_csum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
mov    $0x0,%al
call   1030 <do_csum@plt>
xor    $0xffffffff,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_fast_csum>:
push   %rax
shl    $0x2,%esi
xor    %eax,%eax
call   1030 <do_csum@plt>
not    %eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @ip_fast_csum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul i32 %6, 4
%8 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_csum to i32 (i8*, i32, ...)*)(i8* %5, i32 %7)
%9 = xor i32 %8, -1
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @ip_fast_csum(i8* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @do_csum to i32 (i8*, i32, ...)*)(i8* %0, i32 %3)
%5 = trunc i32 %4 to i16
%6 = xor i16 %5, -1
ret i16 %6
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  pid_t a;
  a = fork();
  if (a > 0)
    printf("parent PID: %d\n", getpid());
  else
    printf("");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1171 <main+0x41>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    117f <main+0x4f>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
jle    1154 <main+0x24>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"parent PID: %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @fork()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %0, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cu_fail_assertation(char *, int, char *);
int /*<<< orphan*/ cu_success_assertation();
void testTrueAndEquals(void) {
  if ((1)) {
    cu_success_assertation();
  } else {
    cu_fail_assertation("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/esromneb/"
                        "embedded-c-unit-test/refs/heads/master/demo/tests.c",
                        50,
                        "1"
                        " is not true");
  };
  if (((1)) == ((1))) {
    cu_success_assertation();
  } else {
    cu_fail_assertation("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/esromneb/"
                        "embedded-c-unit-test/refs/heads/master/demo/tests.c",
                        54,
                        "1"
                        " not equals "
                        "1");
  };
}


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

x86 assembly (clang, -O2):
<testTrueAndEquals>:
push   %rax
xor    %eax,%eax
call   1030 <cu_success_assertation@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cu_success_assertation@plt>

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

LLVM IR (-O2):
define void @testTrueAndEquals() {
%1 = tail call i32 (...) @cu_success_assertation()
%2 = tail call i32 (...) @cu_success_assertation()
ret void
}
int gcd(long int x, long int y) {
  if (y == 0)
    return x;
  return gcd(y, x % y);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <gcd+0x27>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1150 <gcd+0x40>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1132 <gcd+0x32>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1135 <gcd+0x35>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rax,%rcx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %7, %2
%5 = phi i64 [ %0, %2 ], [ %8, %7 ]
%6 = trunc i64 %5 to i32
ret i32 %6
7: ; preds = %2, %7
%8 = phi i64 [ %10, %7 ], [ %1, %2 ]
%9 = phi i64 [ %8, %7 ], [ %0, %2 ]
%10 = srem i64 %9, %8
%11 = icmp eq i64 %10, 0
br i1 %11, label %4, label %7
}
/* Variables and functions */
int findMaxConsecutiveOnes(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[2] = {1, 1};
  printf("%d\n", findMaxConsecutiveOnes(array, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
call   1040 <findMaxConsecutiveOnes@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x100000001,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
call   1040 <findMaxConsecutiveOnes@plt>
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 4294967297, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @findMaxConsecutiveOnes(i32* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
int RunTest(const char *suite, const char *test) {
  fprintf(stderr, "TODO: Implement RunTest: %s:%s.\n", suite, test);
  return (1);
}


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

x86 assembly (clang, -O2):
<RunTest>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"TODO: Implement RunTest: %s:%s.\0A\00"
define i32 @RunTest(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 1
}
/* Variables and functions */
int _check_for(int, int, int, int /*<<< orphan*/, char *);
bool check_zero(int msb, int nr) { return _check_for(msb, nr, nr, 0, "0"); }


x86 assembly (clang, -O0):
<check_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
lea    0xed0(%rip),%r8
call   1030 <_check_for@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_zero>:
lea    0xee9(%rip),%r8
mov    %esi,%edx
xor    %ecx,%ecx
jmp    1030 <_check_for@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i32 @check_zero(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 = load i32, i32* %4
%8 = call i32 @_check_for(i32 %5, i32 %6, i32 %7, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define i32 @check_zero(i32 %0, i32 %1) {
%3 = tail call i32 @_check_for(i32 %0, i32 %1, i32 %1, i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
uint32_t cur_ms_ts(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<cur_ms_ts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cur_ms_ts>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @cur_ms_ts() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @cur_ms_ts() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strrchr(char *, char);
char *leveldown(char *level) {
  char *p;
  if (level == NULL)
    return NULL;
  p = strrchr(level, '.');
  if (p == NULL) {
    free(level);
    level = NULL;
  } else {
    *p = '\0';
  }
  return level;
}


x86 assembly (clang, -O0):
<leveldown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <leveldown+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1186 <leveldown+0x66>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <leveldown+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
jmp    117e <leveldown+0x5e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leveldown>:
push   %rbx
test   %rdi,%rdi
je     1145 <leveldown+0x25>
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     113d <leveldown+0x1d>
movb   $0x0,(%rax)
jmp    1147 <leveldown+0x27>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @leveldown(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %20
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strrchr(i8* %9, i8 signext 46)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
store i8* null, i8** %3
br label %18
16: ; preds = %8
%17 = load i8*, i8** %4
store i8 0, i8* %17
br label %18
18: ; preds = %16, %13
%19 = load i8*, i8** %3
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %7
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @leveldown(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 46)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @free(i8* %0)
br label %9
8: ; preds = %3
store i8 0, i8* %4
br label %9
9: ; preds = %6, %8, %1
%10 = phi i8* [ null, %1 ], [ null, %6 ], [ %0, %8 ]
ret i8* %10
}
/* Variables and functions */
char *_sys_getcwd();
char *sys_getcwd(void) { return _sys_getcwd(); }


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

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

LLVM IR (-O0):
define i8* @sys_getcwd() {
%1 = call i8* (...) @_sys_getcwd()
ret i8* %1
}

LLVM IR (-O2):
define i8* @sys_getcwd() {
%1 = tail call i8* (...) @_sys_getcwd()
ret i8* %1
}
int MAX(int a, int b) { return a > b ? a : b; }


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

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

LLVM IR (-O0):
define i32 @MAX(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = 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 @MAX(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F(int);
int /*<<< orphan*/ R(int);
int /*<<< orphan*/ U(int);
void step2b() {
  R(2);
  U(2);
  F(2);
}


x86 assembly (clang, -O0):
<step2b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <R@plt>
mov    $0x2,%edi
call   1050 <U@plt>
mov    $0x2,%edi
call   1030 <F@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<step2b>:
push   %rax
mov    $0x2,%edi
call   1040 <R@plt>
mov    $0x2,%edi
call   1050 <U@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <F@plt>

LLVM IR (-O0):
define void @step2b() {
%1 = call i32 @R(i32 2)
%2 = call i32 @U(i32 2)
%3 = call i32 @F(i32 2)
ret void
}

LLVM IR (-O2):
define void @step2b() {
%1 = tail call i32 @R(i32 2)
%2 = tail call i32 @U(i32 2)
%3 = tail call i32 @F(i32 2)
ret void
}
void g_closure_set_marshal() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_set_marshal() {
ret void
}
void foo228() {}


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

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

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

LLVM IR (-O2):
define void @foo228() {
ret void
}
int seof(char *buf, unsigned short int stop) {
  char *pBuf;
  int pos = 0;
  for (pBuf = buf; pBuf[pos] != '\0'; pos++) {
    if (pBuf[pos] == stop) {
      return pos + 1;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<seof>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     116c <seof+0x6c>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movzwl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jne    1159 <seof+0x59>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <seof+0x73>
jmp    115e <seof+0x5e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111e <seof+0x1e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seof>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1133 <seof+0x33>
movzwl %si,%esi
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %dl,%edx
cmp    %esi,%edx
je     1134 <seof+0x34>
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <seof+0x20>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @seof(i8* nocapture %0, i16 zeroext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %2
%6 = zext i16 %1 to i32
br label %7
7: ; preds = %5, %15
%8 = phi i64 [ 0, %5 ], [ %16, %15 ]
%9 = phi i8 [ %3, %5 ], [ %18, %15 ]
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %6
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = trunc i64 %8 to i32
%14 = add nuw nsw i32 %13, 1
br label %20
15: ; preds = %7
%16 = add nuw i64 %8, 1
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %7
20: ; preds = %15, %2, %12
%21 = phi i32 [ %14, %12 ], [ -1, %2 ], [ -1, %15 ]
ret i32 %21
}
extern void extern_extern_postdeclared(void) {}


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

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

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

LLVM IR (-O2):
define void @extern_extern_postdeclared() {
ret void
}
void b_print_string_with_color(char *str, unsigned char clr) {
  asm volatile("call 0x001001C8" : : "S"(str), "b"(clr));
}


x86 assembly (clang, -O0):
<b_print_string_with_color>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%bl
call   1001c8 <completed.0+0xfc1a8>
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_print_string_with_color>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
call   1001c8 <completed.0+0xfc1a8>
pop    %rbx
ret

LLVM IR (-O0):
define void @b_print_string_with_color(i8* %0, i8 zeroext %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
ret void
}

LLVM IR (-O2):
define void @b_print_string_with_color(i8* %0, i8 zeroext %1) {
tail call void asm sideeffect "call 0x001001C8", "{si},{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8 %1)
ret void
}