xunge/DecIR huggingface dataset:
char hex_char(char num) {
  if (num < 10) {
    return '0' + num;
  } else {
    return 'a' + num;
  }
}


x86 assembly (clang, -O0):
<hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <hex_char+0x26>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1130 <hex_char+0x30>
movsbl -0x2(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_char>:
cmp    $0xa,%dil
mov    $0x30,%ecx
mov    $0x61,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @hex_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = add nsw i32 48, %9
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %17
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 97, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %17
17: ; preds = %12, %7
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @hex_char(i8 signext %0) {
%2 = icmp slt i8 %0, 10
%3 = select i1 %2, i8 48, i8 97
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void SLIST_end(int *l) { free(l); }


x86 assembly (clang, -O0):
<SLIST_end>:
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):
<SLIST_end>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @SLIST_end(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __v8hi;
typedef scalar_t__ __m128i;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ia32_pmaxsw128(int /*<<< orphan*/,
                                            int /*<<< orphan*/);
__m128i __attribute__((__always___, __nodebug__))
_mm_max_epi16(__m128i a, __m128i b) {
  return (__m128i)__builtin_ia32_pmaxsw128((__v8hi)a, (__v8hi)b);
}


x86 assembly (clang, -O0):
<_mm_max_epi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1030 <__builtin_ia32_pmaxsw128@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_max_epi16>:
push   %rax
call   1030 <__builtin_ia32_pmaxsw128@plt>
cltq
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @_mm_max_epi16(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = tail call i32 @__builtin_ia32_pmaxsw128(i32 %3, i32 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int countWord(char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char *s = (char *)malloc(sizeof(char));
  scanf("%s", s);
  int wordCount = countWord("CHEF", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <countWord@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1050 <scanf@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <countWord@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"CHEF\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @countWord(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %8)
store i32 %9, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"CHEF\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @countWord(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct TYPE_3__ {
  int /*<<< orphan*/ member_0;
};
typedef TYPE_1__ mbstate_t;

/* Variables and functions */
size_t mbsrtowcs(int /*<<< orphan*/ *, char const **, size_t, TYPE_1__ *);
size_t mbstowcs(wchar_t *restrict wcs, const char *restrict s, size_t size) {
  mbstate_t ps = {0};
  return mbsrtowcs(wcs, (const char **)&s, size, &ps);
}


x86 assembly (clang, -O0):
<mbstowcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rcx
call   1040 <mbsrtowcs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbstowcs>:
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
call   1030 <mbsrtowcs@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i64 @mbstowcs(i32* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.TYPE_3__
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = bitcast %struct.TYPE_3__* %7 to i8*
%9 = load i32*, i32** %4
%10 = load i64, i64* %6
%11 = call i64 @mbsrtowcs(i32* %9, i8** %5, i64 %10, %struct.TYPE_3__* %7)
ret i64 %11
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i64 @mbstowcs(i32* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca %struct.TYPE_3__
store i8* %1, i8** %4
%6 = bitcast %struct.TYPE_3__* %5 to i8*
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 0
store i32 0, i32* %7
%8 = call i64 @mbsrtowcs(i32* %0, i8** %4, i64 %2, %struct.TYPE_3__* %5)
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ posix_error(int, char *);
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
void Pthread_create(pthread_t *tidp, pthread_attr_t *attrp,
                    void *(*routine)(void *), void *argp) {
  int rc;
  if ((rc = pthread_create(tidp, attrp, routine, argp)) != 0)
    posix_error(rc, "Pthread_create error");
}


x86 assembly (clang, -O0):
<Pthread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <pthread_create@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1168 <Pthread_create+0x48>
mov    -0x24(%rbp),%edi
lea    0xe9d(%rip),%rsi
call   1030 <posix_error@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_create>:
push   %rax
call   1040 <pthread_create@plt>
test   %eax,%eax
je     1139 <Pthread_create+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <posix_error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Pthread_create error\00"
define void @Pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8* (i8*)*
%8 = alloca i8*
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* (i8*)* %2, i8* (i8*)** %7
store i8* %3, i8** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i8* (i8*)*, i8* (i8*)** %7
%13 = load i8*, i8** %8
%14 = call i32 @pthread_create(i32* %10, i32* %11, i8* (i8*)* %12, i8* %13)
store i32 %14, i32* %9
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %4
%17 = load i32, i32* %9
%18 = call i32 @posix_error(i32 %17, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %16, %4
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Pthread_create error\00"
define void @Pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i32 @pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @posix_error(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
unsigned load2(void) { return 273; }


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

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

LLVM IR (-O0):
define i32 @load2() {
ret i32 273
}

LLVM IR (-O2):
define i32 @load2() {
ret i32 273
}
/* Variables and functions */
int /*<<< orphan*/ M_Menu_Credits_f();
void CreditsFunc(void *unused) { M_Menu_Credits_f(); }


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

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

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

LLVM IR (-O2):
define void @CreditsFunc(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @M_Menu_Credits_f()
ret void
}
const char *td_ewf_version(void) { return "none"; }


x86 assembly (clang, -O0):
<td_ewf_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_ewf_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
define i8* @td_ewf_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i8* @td_ewf_version() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
int void_pointers(void *foo) {
  return foo == (void *)0;
  return foo == (void *)1;
}


x86 assembly (clang, -O0):
<void_pointers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<void_pointers>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @void_pointers(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @void_pointers(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR95_set(void) { return U_WMRCORENONE_set("U_WMR95"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR95\00"
define i8* @U_WMR95_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR95\00"
define i8* @U_WMR95_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char rapl_pkg_available() { return 1; }


x86 assembly (clang, -O0):
<rapl_pkg_available>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_pkg_available>:
mov    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @rapl_pkg_available() {
ret i8 1
}

LLVM IR (-O2):
define signext i8 @rapl_pkg_available() {
ret i8 1
}
void ff_hevc_put_hevc_uni_w_qpel_hv32_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv32_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, unsigned int);
void w977_efm_enter(unsigned int efio) {
  outb(0x87, efio);
  outb(0x87, efio);
}


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

x86 assembly (clang, -O2):
<w977_efm_enter>:
push   %rbx
mov    %edi,%ebx
mov    $0x87,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
mov    $0x87,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @w977_efm_enter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @outb(i32 135, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @outb(i32 135, i32 %5)
ret void
}

LLVM IR (-O2):
define void @w977_efm_enter(i32 %0) {
%2 = tail call i32 @outb(i32 135, i32 %0)
%3 = tail call i32 @outb(i32 135, i32 %0)
ret void
}
/* Variables and functions */
int double_compare(void const *, void const *);
int double_rcompare(const void *x, const void *y) {
  return double_compare(y, x);
}


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

x86 assembly (clang, -O2):
<double_rcompare>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <double_compare@plt>

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

LLVM IR (-O2):
define i32 @double_rcompare(i8* %0, i8* %1) {
%3 = tail call i32 @double_compare(i8* %1, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_polygons_endpoly();
void fgmvwrite_polygons_endpoly_() { gmvwrite_polygons_endpoly(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_polygons_endpoly_() {
%1 = tail call i32 (...) @gmvwrite_polygons_endpoly()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void sendhex(const unsigned char *p, int i) {
  while (i--)
    printf("%02X", *p++);
}


x86 assembly (clang, -O0):
<sendhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1156 <sendhex+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <sendhex+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendhex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1146 <sendhex+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <sendhex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @sendhex(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
int number_good(double x) { return (x < 1.0e+50); }


x86 assembly (clang, -O0):
<number_good>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_good>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @number_good(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 1.000000e+50
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @number_good(double %0) {
%2 = fcmp olt double %0, 1.000000e+50
%3 = zext i1 %2 to i32
ret i32 %3
}
__attribute__((no, noclone)) unsigned __int128 t104_5mul(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (signed __int128)(12), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t104_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    $0xc,%ecx
mul    %rcx
mov    %rax,%rsi
mov    -0x50(%rbp),%rax
seto   %dl
mov    %dl,-0x41(%rbp)
mul    %rcx
mov    %rax,%rcx
mov    -0x41(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
mov    %rcx,-0x40(%rbp)
mov    %rdx,-0x38(%rbp)
test   $0x1,%al
jne    1179 <t104_5mul+0x69>
jmp    1180 <t104_5mul+0x70>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t104_5mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    $0xc,%esi
mul    %rsi
mov    %rax,%rcx
mov    %rdi,%rax
seto   %dil
mul    %rsi
mov    %rax,%r14
mov    %rdx,%rbx
add    %rcx,%rbx
setb   %al
or     %dil,%al
cmp    $0x1,%al
jne    1146 <t104_5mul+0x36>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t104_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 12, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ne i128 %14, 0
%16 = and i1 false, %15
%17 = or i1 %13, %16
%18 = sub i128 0, %14
%19 = select i1 false, i128 %18, i128 %14
store i128 %19, i128* %6
br i1 %17, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t104_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 12)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ drv_L7_write_ctrl(int);
void drv_L7_page(int page) {
  static int cp = -1;
  if (page != cp) {
    cp = page;
    drv_L7_write_ctrl(0xb0 | cp);
  }
}


x86 assembly (clang, -O0):
<drv_L7_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    0x2f04(%rip),%eax
je     1144 <drv_L7_page+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,0x2ef5(%rip)
mov    0x2eef(%rip),%edi
or     $0xb0,%edi
call   1030 <drv_L7_write_ctrl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_L7_page>:
cmp    %edi,0x2f12(%rip)
jne    1119 <drv_L7_page+0x9>
ret
mov    %edi,0x2f09(%rip)
or     $0xb0,%edi
jmp    1030 <drv_L7_write_ctrl@plt>

LLVM IR (-O0):
@drv_L7_page.cp = internal global i32 -1
define void @drv_L7_page(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @drv_L7_page.cp
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
store i32 %7, i32* @drv_L7_page.cp
%8 = load i32, i32* @drv_L7_page.cp
%9 = or i32 176, %8
%10 = call i32 @drv_L7_write_ctrl(i32 %9)
br label %11
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@drv_L7_page.cp = internal unnamed_addr global i32 -1
define void @drv_L7_page(i32 %0) {
%2 = load i32, i32* @drv_L7_page.cp
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
store i32 %0, i32* @drv_L7_page.cp
%5 = or i32 %0, 176
%6 = tail call i32 @drv_L7_write_ctrl(i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void not_as_guest(char *action) {
  printf("<b>You may not perform the action %s as a guest user</b><p>", action);
}


x86 assembly (clang, -O0):
<not_as_guest>:
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):
<not_as_guest>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"<b>You may not perform the action %s as a guest user</b><p>\00"
define void @not_as_guest(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"<b>You may not perform the action %s as a guest user</b><p>\00"
define void @not_as_guest(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
};

/* Variables and functions */
char *inet_ntoa(TYPE_1__);
int /*<<< orphan*/ memset(struct sockaddr_in *, int /*<<< orphan*/, int);
char *ip_to_string(unsigned long ip) {
  struct sockaddr_in client;
  memset(&client, 0, sizeof(struct sockaddr_in));
  client.sin_addr.s_addr = ip;
  return inet_ntoa(client.sin_addr);
}


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

x86 assembly (clang, -O2):
<ip_to_string>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %rbx,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <inet_ntoa@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
define i8* @ip_to_string(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.sockaddr_in
store i64 %0, i64* %2
%4 = call i32 @memset(%struct.sockaddr_in* %3, i32 0, i32 8)
%5 = load i64, i64* %2
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 0
store i64 %5, i64* %7
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = call i8* @inet_ntoa(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
define i8* @ip_to_string(i64 %0) {
%2 = alloca %struct.sockaddr_in
%3 = bitcast %struct.sockaddr_in* %2 to i8*
%4 = call i32 @memset(%struct.sockaddr_in* %2, i32 0, i32 8)
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0, i32 0
store i64 %0, i64* %5
%6 = call i8* @inet_ntoa(i64 %0)
ret i8* %6
}
void fool_optimizer_() {}


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

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

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

LLVM IR (-O2):
define void @fool_optimizer_() {
ret void
}
void testOptionalClosureBrV(void (*closure)(char), char a1) {
  if (closure) {
    (*closure)(a1);
  }
}


x86 assembly (clang, -O0):
<testOptionalClosureBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1127 <testOptionalClosureBrV+0x27>
mov    -0x8(%rbp),%rax
movsbl -0x9(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testOptionalClosureBrV>:
test   %rdi,%rdi
je     110e <testOptionalClosureBrV+0xe>
mov    %rdi,%rax
movsbl %sil,%edi
jmp    *%rax
ret

LLVM IR (-O0):
define void @testOptionalClosureBrV(void (i8)* %0, i8 signext %1) {
%3 = alloca void (i8)*
%4 = alloca i8
store void (i8)* %0, void (i8)** %3
store i8 %1, i8* %4
%5 = load void (i8)*, void (i8)** %3
%6 = icmp ne void (i8)* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load void (i8)*, void (i8)** %3
%9 = load i8, i8* %4
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @testOptionalClosureBrV(void (i8)* %0, i8 signext %1) {
%3 = icmp eq void (i8)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void %0(i8 signext %1)
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int del(double, double);
int udb(double, double);
double ubar(double xx, double Q2) { return (-del(xx, Q2) + udb(xx, Q2)) / 2; }


x86 assembly (clang, -O0):
<ubar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <del@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <udb@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubar>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1040 <del@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <udb@plt>
sub    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ubar(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i32 @del(double %5, double %6)
%8 = sub nsw i32 0, %7
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i32 @udb(double %9, double %10)
%12 = add nsw i32 %8, %11
%13 = sdiv i32 %12, 2
%14 = sitofp i32 %13 to double
ret double %14
}

LLVM IR (-O2):
define double @ubar(double %0, double %1) {
%3 = tail call i32 @del(double %0, double %1)
%4 = tail call i32 @udb(double %0, double %1)
%5 = sub i32 %4, %3
%6 = sdiv i32 %5, 2
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ inw(unsigned long);
void insw(unsigned long port, void *dst, unsigned long count) {
  unsigned short *p = dst;
  while (count--)
    *p++ = inw(port);
}


x86 assembly (clang, -O0):
<insw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1168 <insw+0x58>
mov    -0x8(%rbp),%rdi
call   1030 <inw@plt>
mov    %ax,%cx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x2,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cx,(%rax)
jmp    112c <insw+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insw>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1146 <insw+0x36>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <inw@plt>
mov    %ax,(%r14,%rbx,2)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <insw+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @insw(i64 %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i16*
br label %7
7: ; preds = %5, %7
%8 = phi i16* [ %13, %7 ], [ %6, %5 ]
%9 = phi i64 [ %10, %7 ], [ %2, %5 ]
%10 = add i64 %9, -1
%11 = tail call i32 @inw(i64 %0)
%12 = trunc i32 %11 to i16
%13 = getelementptr inbounds i16, i16* %8, i64 1
store i16 %12, i16* %8
%14 = icmp eq i64 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int hzdptr_size(int nprocs, int nptrs) {
  return sizeof(void * [(2 * nprocs) + nptrs]);
}


x86 assembly (clang, -O0):
<hzdptr_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,%eax
shl    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hzdptr_size>:
lea    (%rsi,%rdi,2),%eax
shl    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @hzdptr_size(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 = mul nsw i32 2, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = zext i32 %8 to i64
%10 = mul nuw i64 8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @hzdptr_size(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
%5 = shl i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ e_sbc();
int /*<<< orphan*/ e_zpx();
void e_sbc_zpx() {
  e_zpx();
  e_sbc();
}


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

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

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

LLVM IR (-O2):
define void @e_sbc_zpx() {
%1 = tail call i32 (...) @e_zpx()
%2 = tail call i32 (...) @e_sbc()
ret void
}
/* Variables and functions */
scalar_t__ fadd(int, int, int, int);
main() { return 10 == (int)fadd(1, 2, 3, 4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <fadd@plt>
mov    %eax,%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <fadd@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @fadd(i32 1, i32 2, i32 3, i32 4)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 10, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @fadd(i32 1, i32 2, i32 3, i32 4)
%2 = trunc i64 %1 to i32
%3 = icmp eq i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
virtual(StringArray) {}


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

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

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

LLVM IR (-O2):
define i32 @virtual(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int system(char *);
int try_setup(const char *iface) {
  char buffer[256];
  snprintf(buffer, sizeof(buffer), "ip link set %s up", iface);
  buffer[sizeof(buffer) - 1] = '\0';
  return system(buffer);
}


x86 assembly (clang, -O0):
<try_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_setup>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
movb   $0x0,0xff(%rsp)
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"ip link set %s up\00"
define i32 @try_setup(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 255
store i8 0, i8* %7
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [18 x i8] c"ip link set %s up\00"
define i32 @try_setup(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 255
store i8 0, i8* %5
%6 = call i32 @system(i8* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void OnWin(void) { printf("You win!\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"You win!\00"
define void @OnWin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void foo382() {}


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

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

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

LLVM IR (-O2):
define void @foo382() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_GetIP() {
  char msg[] = "Aborting: "
               "_Unwind_GetIP"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_GetIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x45,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x44,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_GetIP>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa2964656c6261,%rax
mov    %rax,0x3d(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x44,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_GetIP.msg = [69 x i8] c"Aborting: _Unwind_GetIP called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetIP() {
%1 = alloca [69 x i8]
%2 = bitcast [69 x i8]* %1 to i8*
%3 = getelementptr inbounds [69 x i8], [69 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 68)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_GetIP.msg = [69 x i8] c"Aborting: _Unwind_GetIP called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetIP() {
%1 = alloca [69 x i8]
%2 = getelementptr inbounds [69 x i8], [69 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 68)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ testQueue();
int main(void) {
  testQueue();
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testQueue()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @testQueue()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Expander_Write_Byte(char, int, char);
void Expander_Write_Port(char ModuleAddress, char Data_) {
  Expander_Write_Byte(ModuleAddress, 0x01, Data_);
}


x86 assembly (clang, -O0):
<Expander_Write_Port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x1,%esi
movsbl %al,%edi
movsbl -0x2(%rbp),%edx
call   1030 <Expander_Write_Byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Expander_Write_Port(i8 signext %0, i8 signext %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 @Expander_Write_Byte(i8 signext %5, i32 1, i8 signext %6)
ret void
}

LLVM IR (-O2):
define void @Expander_Write_Port(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @Expander_Write_Byte(i8 signext %0, i32 1, i8 signext %1)
ret void
}
/* Variables and functions */
int StdBar10(int, int, int, int, int, int, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum;
  sum = StdBar10(1, 2, 3, 4, 5, 6, 7, 8, 9, 0);
  printf(" main: sum=%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
xor    %eax,%eax
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1040 <StdBar10@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x0
push   $0x9
push   $0x8
push   $0x7
call   1040 <StdBar10@plt>
add    $0x20,%rsp
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c" main: sum=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @StdBar10(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c" main: sum=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @StdBar10(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int leap_year(int year) { return !(year % 4) - !(year % 100) + !(year % 400); }


x86 assembly (clang, -O0):
<leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap_year>:
xor    %eax,%eax
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
sbb    $0x0,%eax
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = load i32, i32* %2
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = sub nsw i32 %7, %12
%14 = load i32, i32* %2
%15 = srem i32 %14, 400
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = add nsw i32 %13, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
%7 = sext i1 %6 to i32
%8 = add nsw i32 %7, %4
%9 = srem i32 %0, 400
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = add nsw i32 %8, %11
ret i32 %12
}
void g_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @g_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
main() {
  int i = 1;
  printf("Predecrement (--i) of i = %d  is %d", i, i--);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %edx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
lea    0xecc(%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
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Predecrement (--i) of i = %d is %d\00"
define i32 @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Predecrement (--i) of i = %d is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_file();
int /*<<< orphan*/ write_file();
main(int argc, char *argv[]) {
  int i, j;
  char *s;
  char *progname;
  progname = argv[0];
  read_file();
  write_file();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <read_file@plt>
mov    $0x0,%al
call   1030 <write_file@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
store i8* %11, i8** %8
%12 = call i32 (...) @read_file()
%13 = call i32 (...) @write_file()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @read_file()
%4 = tail call i32 (...) @write_file()
ret i32 0
}