xunge/DecIR huggingface dataset:
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ nodename;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ sethostname(char *, int /*<<< orphan*/);
int /*<<< orphan*/ uname(struct utsname *);
int main(int argc, char **argv) {
  if (argc == 2) {
    sethostname(*argv, 0);
  } else {
    struct utsname un;
    uname(&un);
    puts(un.nodename);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1163 <main+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
xor    %esi,%esi
call   1050 <sethostname@plt>
jmp    1174 <main+0x44>
lea    -0x18(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x18(%rbp),%edi
call   1030 <puts@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1142 <main+0x12>
mov    (%rsi),%rdi
xor    %esi,%esi
call   1050 <sethostname@plt>
jmp    1152 <main+0x22>
mov    %rsp,%rdi
call   1040 <uname@plt>
mov    (%rsp),%edi
call   1030 <puts@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utsname
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = load i8*, i8** %10
%12 = call i32 @sethostname(i8* %11, i32 0)
br label %18
13: ; preds = %2
%14 = call i32 @uname(%struct.utsname* %6)
%15 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @puts(i32 %16)
br label %18
18: ; preds = %13, %9
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.utsname
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @sethostname(i8* %6, i32 0)
br label %14
8: ; preds = %2
%9 = bitcast %struct.utsname* %3 to i8*
%10 = call i32 @uname(%struct.utsname* %3)
%11 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%12 = load i32, i32* %11
%13 = tail call i32 @puts(i32 %12)
br label %14
14: ; preds = %8, %5
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
scalar_t__ __glibc_unlikely(int);
int /*<<< orphan*/ *__wcpncpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                              size_t);
wchar_t *__wcpncpy_chk(wchar_t *dest, const wchar_t *src, size_t n,
                       size_t destlen) {
  if (__glibc_unlikely(destlen < n))
    __chk_fail();
  return __wcpncpy(dest, src, n);
}


x86 assembly (clang, -O0):
<__wcpncpy_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__glibc_unlikely@plt>
cmp    $0x0,%rax
je     116e <__wcpncpy_chk+0x3e>
mov    $0x0,%al
call   1040 <__chk_fail@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__wcpncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wcpncpy_chk>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
cmp    %rdx,%rcx
setb   %dil
call   1050 <__glibc_unlikely@plt>
test   %rax,%rax
je     1158 <__wcpncpy_chk+0x28>
xor    %eax,%eax
call   1040 <__chk_fail@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <__wcpncpy@plt>

LLVM IR (-O0):
define i32* @__wcpncpy_chk(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %7
%11 = icmp ult i64 %9, %10
%12 = zext i1 %11 to i32
%13 = call i64 @__glibc_unlikely(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %4
%16 = call i32 (...) @__chk_fail()
br label %17
17: ; preds = %15, %4
%18 = load i32*, i32** %5
%19 = load i32*, i32** %6
%20 = load i64, i64* %7
%21 = call i32* @__wcpncpy(i32* %18, i32* %19, i64 %20)
ret i32* %21
}

LLVM IR (-O2):
define i32* @__wcpncpy_chk(i32* %0, i32* %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i64 @__glibc_unlikely(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = tail call i32 (...) @__chk_fail()
br label %11
11: ; preds = %9, %4
%12 = tail call i32* @__wcpncpy(i32* %0, i32* %1, i64 %2)
ret i32* %12
}
void umocktypes_free_void_ptr(void **value) { (void)value; }


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_void_ptr(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ needwun(char *, char *, char *, char *, int *, char *);
void workload(char SEQA[128], char SEQB[128], char alignedA[128 + 128],
              char alignedB[128 + 128]) {
#pragma HLS INTERFACE m_axi port = SEQA offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = SEQB offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = alignedA offset = slave bundle = gmem
#pragma HLS INTERFACE m_axi port = alignedB offset = slave bundle = gmem
#pragma HLS INTERFACE s_axilite port = SEQA bundle = control
#pragma HLS INTERFACE s_axilite port = SEQB bundle = control
#pragma HLS INTERFACE s_axilite port = alignedA bundle = control
#pragma HLS INTERFACE s_axilite port = alignedB bundle = control
#pragma HLS INTERFACE s_axilite port = return bundle = control
  int M[(128 + 1) * (128 + 1)];
  char ptr[(128 + 1) * (128 + 1)];
  needwun(SEQA, SEQB, alignedA, alignedB, M, ptr);
  return;
}


x86 assembly (clang, -O0):
<workload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x14540,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x10430(%rbp),%r8
lea    -0x14540(%rbp),%r9
call   1030 <needwun@plt>
add    $0x14540,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workload>:
sub    $0x14518,%rsp
lea    0x4110(%rsp),%r8
mov    %rsp,%r9
call   1030 <needwun@plt>
add    $0x14518,%rsp
ret

LLVM IR (-O0):
define void @workload(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [16641 x i32]
%10 = alloca [16641 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = getelementptr inbounds [16641 x i32], [16641 x i32]* %9, i64 0, i64 0
%16 = getelementptr inbounds [16641 x i8], [16641 x i8]* %10, i64 0, i64 0
%17 = call i32 @needwun(i8* %11, i8* %12, i8* %13, i8* %14, i32* %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @workload(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [16641 x i32]
%6 = alloca [16641 x i8]
%7 = bitcast [16641 x i32]* %5 to i8*
%8 = getelementptr inbounds [16641 x i8], [16641 x i8]* %6, i64 0, i64 0
%9 = getelementptr inbounds [16641 x i32], [16641 x i32]* %5, i64 0, i64 0
%10 = call i32 @needwun(i8* %0, i8* %1, i8* %2, i8* %3, i32* %9, i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func1(void) { printf("Hey, you entered foo! \n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Hey, you entered foo! \0A\00"
define void @func1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Hey, you entered foo! \00"
define void @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
int myindex(char *ptr1, char *ptr2) {
  int retval = ptr2 - ptr1;
  return retval;
}


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

x86 assembly (clang, -O2):
<myindex>:
mov    %rsi,%rax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @myindex(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int _bme_cookie_write(int, char const *);
int bme_cookie_write(int fd, const char *cookie) {
  return _bme_cookie_write(fd, cookie);
}


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

x86 assembly (clang, -O2):
<bme_cookie_write>:
jmp    1030 <_bme_cookie_write@plt>

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

LLVM IR (-O2):
define i32 @bme_cookie_write(i32 %0, i8* %1) {
%3 = tail call i32 @_bme_cookie_write(i32 %0, i8* %1)
ret i32 %3
}
float quadratic_out(float step, float max_steps, float max_val) {
  float ratio = step / max_steps;
  return -max_val * ratio * (ratio - 2);
}


x86 assembly (clang, -O0):
<quadratic_out>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  -0x10(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  0xeba(%rip),%xmm2
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadratic_out>:
divss  %xmm1,%xmm0
xorps  0xef5(%rip),%xmm2
mulss  %xmm0,%xmm2
addss  0xef9(%rip),%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @quadratic_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fdiv float %8, %9
store float %10, float* %7
%11 = load float, float* %6
%12 = fneg float %11
%13 = load float, float* %7
%14 = fmul float %12, %13
%15 = load float, float* %7
%16 = fsub float %15, 2.000000e+00
%17 = fmul float %14, %16
ret float %17
}

LLVM IR (-O2):
define float @quadratic_out(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = fneg float %2
%6 = fmul float %4, %5
%7 = fadd float %4, -2.000000e+00
%8 = fmul float %6, %7
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvGetDeviceDriverVersionString(char *lpVersion, int nMaxChars) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvGetDeviceDriverVersionString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvGetDeviceDriverVersionString(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvGetDeviceDriverVersionString(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ connect_ip(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("You must specify the ip\n");
    exit(0);
  }
  connect_ip(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    115c <main+0x2c>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <connect_ip@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <connect_ip@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"You must specify the ip\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @connect_ip(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"You must specify the ip\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @connect_ip(i8* %9)
ret i32 0
}
double g(double x) {
  asm volatile("" : "+x"(x));
  return x;
}


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

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

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm sideeffect "", "=x,0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @g(double %0) {
%2 = tail call double asm sideeffect "", "=x,0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
int digits_in_number(int arg) {
  if (arg == (int)0x80000000)
    return 11;
  int digits = 1;
  if (arg < 0) {
    arg = -arg;
    digits++;
  }
  while (arg > 9) {
    arg /= 10;
    digits++;
  }
  return digits;
}


x86 assembly (clang, -O0):
<digits_in_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80000000,-0x8(%rbp)
jne    1120 <digits_in_number+0x20>
movl   $0xb,-0x4(%rbp)
jmp    1173 <digits_in_number+0x73>
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1142 <digits_in_number+0x42>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <digits_in_number+0x47>
cmpl   $0x9,-0x8(%rbp)
jle    116d <digits_in_number+0x6d>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <digits_in_number+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digits_in_number>:
mov    $0xb,%eax
cmp    $0x80000000,%edi
je     1144 <digits_in_number+0x44>
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%edi
mov    %edi,%eax
add    $0x1,%eax
cmp    $0xa,%ecx
jb     1144 <digits_in_number+0x44>
mov    $0xcccccccd,%edx
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1130 <digits_in_number+0x30>
ret

LLVM IR (-O0):
define i32 @digits_in_number(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, -2147483648
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 11, i32* %2
br label %27
8: ; preds = %1
store i32 1, i32* %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %16
16: ; preds = %11, %8
br label %17
17: ; preds = %20, %16
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 9
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sdiv i32 %21, 10
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %17
25: ; preds = %17
%26 = load i32, i32* %4
store i32 %26, i32* %2
br label %27
27: ; preds = %25, %7
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @digits_in_number(i32 %0) {
%2 = icmp eq i32 %0, -2147483648
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 0
%5 = sub nsw i32 0, %0
%6 = select i1 %4, i32 %5, i32 %0
%7 = select i1 %4, i32 2, i32 1
%8 = icmp ugt i32 %6, 9
br i1 %8, label %9, label %15
9: ; preds = %3, %9
%10 = phi i32 [ %13, %9 ], [ %7, %3 ]
%11 = phi i32 [ %12, %9 ], [ %6, %3 ]
%12 = udiv i32 %11, 10
%13 = add nuw nsw i32 %10, 1
%14 = icmp ugt i32 %11, 99
br i1 %14, label %9, label %15
15: ; preds = %9, %3, %1
%16 = phi i32 [ 11, %1 ], [ %7, %3 ], [ %13, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ handle_include(int);
void cm_verbatiminclude(void) { handle_include(1); }


x86 assembly (clang, -O0):
<cm_verbatiminclude>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <handle_include@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_verbatiminclude>:
mov    $0x1,%edi
jmp    1030 <handle_include@plt>

LLVM IR (-O0):
define void @cm_verbatiminclude() {
%1 = call i32 @handle_include(i32 1)
ret void
}

LLVM IR (-O2):
define void @cm_verbatiminclude() {
%1 = tail call i32 @handle_include(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Please enter a string >");
  printf("The number of syllables is 4");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Please enter a string >\00"
@.str.1 = [29 x i8] c"The number of syllables is 4\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Please enter a string >\00"
@.str.1 = [29 x i8] c"The number of syllables is 4\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_macro(void) {
  __emit_string_literal_range("01234"
                              "56789",
                              4, 3, 6);
}


x86 assembly (clang, -O0):
<test_macro>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x6,%ecx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_macro>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x6,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define void @test_macro() {
%1 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define void @test_macro() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i32 3, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void edge_del(void *e) { free(e); }


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

x86 assembly (clang, -O2):
<edge_del>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @edge_del(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int strcmp(char const *, char const *);
int dummy_validate_login(const char *a, const char *b) {
  printf("skin checks auth for user `%s' password `%s'\n", a, b);
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<dummy_validate_login>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"skin checks auth for user `%s' password `%s'\0A\00"
define i32 @dummy_validate_login(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @strcmp(i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [46 x i8] c"skin checks auth for user `%s' password `%s'\0A\00"
define i32 @dummy_validate_login(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ state;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
unsigned get_XButtonEvent_state(void *_p) {
  return (unsigned)((XButtonEvent *)_p)->state;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define i32 @get_XButtonEvent_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_XButtonEvent_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void INThandler(int sig) { exit(-1); }


x86 assembly (clang, -O0):
<INThandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<INThandler>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @INThandler(i32 %0) {
%2 = tail call i32 @exit(i32 -1)
unreachable
}
void handle_signal(int signal) {}


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

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

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

LLVM IR (-O2):
define void @handle_signal(i32 %0) {
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *somePath(struct sqlConnection *, int, char *);
char *bioImageScreenSizePath(struct sqlConnection *conn, int id) {
  return somePath(conn, id, "screenLocation");
}


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

x86 assembly (clang, -O2):
<bioImageScreenSizePath>:
lea    0xee9(%rip),%rdx
jmp    1030 <somePath@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [15 x i8] c"screenLocation\00"
define i8* @bioImageScreenSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @somePath(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [15 x i8] c"screenLocation\00"
define i8* @bioImageScreenSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @somePath(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
int memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int sacmp4(struct sockaddr_in *a, struct sockaddr_in *b) {
  return memcmp(&a->sin_addr, &b->sin_addr, sizeof(a->sin_addr));
}


x86 assembly (clang, -O0):
<sacmp4>:
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    $0x4,%edx
call   1030 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define i32 @sacmp4(%struct.sockaddr_in* %0, %struct.sockaddr_in* %1) {
%3 = alloca %struct.sockaddr_in*
%4 = alloca %struct.sockaddr_in*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%9 = call i32 @memcmp(i32* %6, i32* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define i32 @sacmp4(%struct.sockaddr_in* %0, %struct.sockaddr_in* %1) {
%3 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
%5 = tail call i32 @memcmp(i32* %3, i32* %4, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int /*<<< orphan*/ foo(int *);
int main() {
  int *ip;
  bar(ip);
  foo(ip);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1030 <bar@plt>
mov    -0x8(%rbp),%rdi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @bar(i32* %2)
%4 = load i32*, i32** %1
%5 = call i32 @foo(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32* undef)
%2 = tail call i32 @foo(i32* undef)
ret i32 0
}
/* Variables and functions */
size_t numa_pagesize();
size_t numanuma__get_page_size(void) { return numa_pagesize(); }


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

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

LLVM IR (-O0):
define i64 @numanuma__get_page_size() {
%1 = call i64 (...) @numa_pagesize()
ret i64 %1
}

LLVM IR (-O2):
define i64 @numanuma__get_page_size() {
%1 = tail call i64 (...) @numa_pagesize()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void __tiger__print(char *s) { printf("%s", s); }


x86 assembly (clang, -O0):
<__tiger__print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_binding_entry_clear() {
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
bool timespec_is_zero(const struct timespec *a) {
  return a->tv_sec == 0 && a->tv_nsec == 0;
}


x86 assembly (clang, -O0):
<timespec_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jne    112a <timespec_is_zero+0x2a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_is_zero>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
je     1109 <timespec_is_zero+0x9>
ret
xor    %eax,%eax
cmpq   $0x0,0x8(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @timespec_is_zero(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ f();
main() {
  f();
  struct {
    int a, b, c;
  } x = {1, 2};
  if (x.c != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
mov    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115b <main+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, i32, i32 }
@__const.main.x = %struct.anon { i32 1, i32 2, i32 0 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = call i32 (...) @f()
%4 = bitcast %struct.anon* %2 to i8*
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 0
}
int rand(void) {
  static unsigned long seed;
  seed = (seed ^ 0x4BAD5A39UL) + 6513973UL;
  return (int)(seed >> 16);
}


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rax
xor    $0x4bad5a39,%rax
add    $0x636535,%rax
mov    %rax,0x2f0a(%rip)
mov    0x2f03(%rip),%rax
shr    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
mov    $0x4bad5a39,%eax
xor    0x2f1c(%rip),%rax
add    $0x636535,%rax
mov    %rax,0x2f0f(%rip)
shr    $0x10,%rax
ret

LLVM IR (-O0):
@rand.seed = internal global i64 0
define i32 @rand() {
%1 = load i64, i64* @rand.seed
%2 = xor i64 %1, 1269652025
%3 = add i64 %2, 6513973
store i64 %3, i64* @rand.seed
%4 = load i64, i64* @rand.seed
%5 = lshr i64 %4, 16
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@rand.seed = internal unnamed_addr global i64 0
define i32 @rand() {
%1 = load i64, i64* @rand.seed
%2 = xor i64 %1, 1269652025
%3 = add i64 %2, 6513973
store i64 %3, i64* @rand.seed
%4 = lshr i64 %3, 16
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ hang();
int /*<<< orphan*/ loadProgram();
int /*<<< orphan*/ makeInterrupt21();
void main() {
  makeInterrupt21();
  loadProgram();
  hang();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <makeInterrupt21@plt>
mov    $0x0,%al
call   1040 <loadProgram@plt>
mov    $0x0,%al
call   1050 <hang@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <makeInterrupt21@plt>
xor    %eax,%eax
call   1040 <loadProgram@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <hang@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @makeInterrupt21()
%2 = call i32 (...) @loadProgram()
%3 = call i32 (...) @hang()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @makeInterrupt21()
%2 = tail call i32 (...) @loadProgram()
%3 = tail call i32 (...) @hang()
ret void
}
/* Variables and functions */
double fabs(float);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  float a, b, c;
  a = 0.6;
  b = 0.4;
  c = 0.2;
  printf("%s\n", fabs(a - b - c) < 1.0e-6 ? "a-b == c" : "a-b != c");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec8(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeb7(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xe8b(%rip),%xmm0
lea    0xea5(%rip),%rsi
lea    0xe95(%rip),%rax
ucomisd %xmm1,%xmm0
cmova  %rax,%rsi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1040 <fabs@plt>
movsd  0xed2(%rip),%xmm1
ucomisd %xmm0,%xmm1
lea    0xed3(%rip),%rax
lea    0xed5(%rip),%rsi
cmova  %rax,%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"a-b == c\00"
@.str.2 = [9 x i8] c"a-b != c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 0x3FE3333340000000, float* %2
store float 0x3FD99999A0000000, float* %3
store float 0x3FC99999A0000000, float* %4
%5 = load float, float* %2
%6 = load float, float* %3
%7 = fsub float %5, %6
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = call double @fabs(float %9)
%11 = fcmp olt double %10, 0x3EB0C6F7A0B5ED8D
%12 = zext i1 %11 to i64
%13 = select i1 %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"a-b == c\00"
@.str.2 = [9 x i8] c"a-b != c\00"
define i32 @main() {
%1 = tail call double @fabs(float 0x3E50000000000000)
%2 = fcmp olt double %1, 0x3EB0C6F7A0B5ED8D
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int a(int i) { return i + 1; }


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

x86 assembly (clang, -O2):
<a>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @a(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void show_stacktrace(void) {}


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

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

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

LLVM IR (-O2):
define void @show_stacktrace() {
ret void
}
void initout() {}


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

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

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

LLVM IR (-O2):
define void @initout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void http_free_args(char **args) {
  char **p;
  if (args) {
    p = args;
    while (*p) {
      free(*p++);
    }
    free(args);
  }
}


x86 assembly (clang, -O0):
<http_free_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1162 <http_free_args+0x52>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1159 <http_free_args+0x49>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rdi
call   1030 <free@plt>
jmp    112f <http_free_args+0x1f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_free_args>:
test   %rdi,%rdi
je     1150 <http_free_args+0x40>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <http_free_args+0x31>
lea    0x8(%r14),%rbx
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <http_free_args+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @http_free_args(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %12, %6 ], [ %4, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = bitcast i8* %7 to i8**
%11 = tail call i32 @free(i8** %10)
%12 = load i8*, i8** %9
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %6
14: ; preds = %6, %3
%15 = tail call i32 @free(i8** %0)
br label %16
16: ; preds = %14, %1
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int utf8_strlen_screen(char const *);
int config_check_prefix_buffer_align_more(const void *pointer, void *data,
                                          struct t_config_option *option,
                                          const char *value) {
  (void)pointer;
  (void)data;
  (void)option;
  return (utf8_strlen_screen(value) == 1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<config_check_prefix_buffer_align_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <utf8_strlen_screen@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_check_prefix_buffer_align_more>:
push   %rax
mov    %rcx,%rdi
call   1030 <utf8_strlen_screen@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define i32 @config_check_prefix_buffer_align_more(i8* %0, i8* %1, %struct.t_config_option* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.t_config_option*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.t_config_option* %2, %struct.t_config_option** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.t_config_option*, %struct.t_config_option** %7
%12 = load i8*, i8** %8
%13 = call i32 @utf8_strlen_screen(i8* %12)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
ret i32 %16
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define i32 @config_check_prefix_buffer_align_more(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @utf8_strlen_screen(i8* %3)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}
void XRectInRegion() {}


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

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

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

LLVM IR (-O2):
define void @XRectInRegion() {
ret void
}
/* Variables and functions */
int magic_numbers_aux(char *, int /*<<< orphan*/, int /*<<< orphan*/);
unsigned magic_numbers(char *pattern) {
  return magic_numbers_aux(pattern, 0, 0);
}


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

x86 assembly (clang, -O2):
<magic_numbers>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <magic_numbers_aux@plt>

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

LLVM IR (-O2):
define i32 @magic_numbers(i8* %0) {
%2 = tail call i32 @magic_numbers_aux(i8* %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ next1();
int /*<<< orphan*/ next2();
int /*<<< orphan*/ next3();
int /*<<< orphan*/ next4();
int /*<<< orphan*/ next5();
main() {
start:
  next1();
  next2();
  next1();
  next3();
  next1();
  next4();
  next1();
  next5();
  next1();
  loop();
  goto start;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <next1@plt>
mov    $0x0,%al
call   1060 <next2@plt>
mov    $0x0,%al
call   1080 <next1@plt>
mov    $0x0,%al
call   1040 <next3@plt>
mov    $0x0,%al
call   1080 <next1@plt>
mov    $0x0,%al
call   1070 <next4@plt>
mov    $0x0,%al
call   1080 <next1@plt>
mov    $0x0,%al
call   1030 <next5@plt>
mov    $0x0,%al
call   1080 <next1@plt>
mov    $0x0,%al
call   1050 <loop@plt>
jmp    116f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <next1@plt>
xor    %eax,%eax
call   1060 <next2@plt>
xor    %eax,%eax
call   1080 <next1@plt>
xor    %eax,%eax
call   1040 <next3@plt>
xor    %eax,%eax
call   1080 <next1@plt>
xor    %eax,%eax
call   1070 <next4@plt>
xor    %eax,%eax
call   1080 <next1@plt>
xor    %eax,%eax
call   1030 <next5@plt>
xor    %eax,%eax
call   1080 <next1@plt>
xor    %eax,%eax
call   1050 <loop@plt>
jmp    1170 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @next1()
%4 = call i32 (...) @next2()
%5 = call i32 (...) @next1()
%6 = call i32 (...) @next3()
%7 = call i32 (...) @next1()
%8 = call i32 (...) @next4()
%9 = call i32 (...) @next1()
%10 = call i32 (...) @next5()
%11 = call i32 (...) @next1()
%12 = call i32 (...) @loop()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @next1()
%3 = tail call i32 (...) @next2()
%4 = tail call i32 (...) @next1()
%5 = tail call i32 (...) @next3()
%6 = tail call i32 (...) @next1()
%7 = tail call i32 (...) @next4()
%8 = tail call i32 (...) @next1()
%9 = tail call i32 (...) @next5()
%10 = tail call i32 (...) @next1()
%11 = tail call i32 (...) @loop()
br label %1
}