xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x;
};
struct TYPE_4__ {
  TYPE_1__ max_logical_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
short get_XFontSetExtents_max_logical_extent_x(void *_p) {
  return (short)((XFontSetExtents *)_p)->max_logical_extent.x;
}


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

x86 assembly (clang, -O2):
<get_XFontSetExtents_max_logical_extent_x>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define signext i16 @get_XFontSetExtents_max_logical_extent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @get_XFontSetExtents_max_logical_extent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned LPCStatusBlockAddressGet(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  return ((*((volatile unsigned long *)(ulBase + 0x000000A0))));
}


x86 assembly (clang, -O0):
<LPCStatusBlockAddressGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0xa0(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCStatusBlockAddressGet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40080000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0xa0(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LPCStatusBlockAddressGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074266112
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 160
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @LPCStatusBlockAddressGet(i64 %0) {
%2 = icmp eq i64 %0, 1074266112
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 160
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
int f() { return 42; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 42
}

LLVM IR (-O2):
define i32 @f() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int const,
                           char const *);
int /*<<< orphan*/ stderr;
void drip_carp_real(const char *filename, const int line, const char *message) {
  fprintf(stderr, "Fatal error at %s:%d\n\t%s\n", filename, line, message);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<drip_carp_real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<drip_carp_real>:
push   %rbx
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Fatal error at %s:%d\0A\09%s\0A\00"
define void @drip_carp_real(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
%14 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Fatal error at %s:%d\0A\09%s\0A\00"
define void @drip_carp_real(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_CMC();
void do0x3F() { _I8080_CMC(); }


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

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

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

LLVM IR (-O2):
define void @do0x3F() {
%1 = tail call i32 (...) @_I8080_CMC()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printhelp(void) {
  printf("---- DicDivider Help section ----\n"
         "Usage: ./DicDivider [option] [data] [file]\n"
         "\nOptions:\n"
         "	-l , --line   Divide file by number of lines\n"
         "	-h , --help   Shows this help page\n"
         "\nExamples:\n"
         "	./DicDivider -l 10000000 file.txt\n");
}


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

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

LLVM IR (-O0):
@.str = [216 x i8] c"---- DicDivider Help section ----\0AUsage: ./DicDivider [option] [data] [file]\0A\0AOptions:\0A\09-l , --line Divide file by number of lines\0A\09-h , --help Shows this help page\0A\0AExamples:\0A\09./DicDivider -l 10000000 file.txt\0A\00"
define void @printhelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [215 x i8] c"---- DicDivider Help section ----\0AUsage: ./DicDivider [option] [data] [file]\0A\0AOptions:\0A\09-l , --line Divide file by number of lines\0A\09-h , --help Shows this help page\0A\0AExamples:\0A\09./DicDivider -l 10000000 file.txt\00"
define void @printhelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([215 x i8], [215 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Stack {
  int dummy;
};

/* Variables and functions */
struct Stack *createStack(int);
int pop(struct Stack *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ push(struct Stack *, int);
int main() {
  struct Stack *stack = createStack(100);
  push(stack, 10);
  push(stack, 20);
  push(stack, 30);
  printf("%d popped from stack\n", pop(stack));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <createStack@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1060 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%esi
call   1060 <push@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1060 <push@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pop@plt>
mov    %eax,%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <createStack@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xa,%esi
call   1060 <push@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1060 <push@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1060 <push@plt>
mov    %rbx,%rdi
call   1040 <pop@plt>
lea    0xe7c(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Stack = type { i32 }
@.str = [22 x i8] c"%d popped from stack\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Stack*
store i32 0, i32* %1
%3 = call %struct.Stack* @createStack(i32 100)
store %struct.Stack* %3, %struct.Stack** %2
%4 = load %struct.Stack*, %struct.Stack** %2
%5 = call i32 @push(%struct.Stack* %4, i32 10)
%6 = load %struct.Stack*, %struct.Stack** %2
%7 = call i32 @push(%struct.Stack* %6, i32 20)
%8 = load %struct.Stack*, %struct.Stack** %2
%9 = call i32 @push(%struct.Stack* %8, i32 30)
%10 = load %struct.Stack*, %struct.Stack** %2
%11 = call i32 @pop(%struct.Stack* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
%struct.Stack = type { i32 }
@.str = [22 x i8] c"%d popped from stack\0A\00"
define i32 @main() {
%1 = tail call %struct.Stack* @createStack(i32 100)
%2 = tail call i32 @push(%struct.Stack* %1, i32 10)
%3 = tail call i32 @push(%struct.Stack* %1, i32 20)
%4 = tail call i32 @push(%struct.Stack* %1, i32 30)
%5 = tail call i32 @pop(%struct.Stack* %1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
char *aligned_alloc(size_t, size_t);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memset(char *, int, size_t);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  size_t align = 128;
  size_t bytes = 100 * align;
  char *buffer = aligned_alloc(align, bytes);
  printf("buffer = %p\n", buffer);
  memset(buffer, 255, bytes);
  free(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x80,-0x10(%rbp)
imul   $0x64,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <aligned_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xff,%esi
call   1050 <memset@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80,%edi
mov    $0x3200,%esi
call   1060 <aligned_alloc@plt>
mov    %rax,%rbx
lea    0xea6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x3200,%edx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"buffer = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
store i32 0, i32* %1
store i64 128, i64* %2
%5 = load i64, i64* %2
%6 = mul i64 100, %5
store i64 %6, i64* %3
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = call i8* @aligned_alloc(i64 %7, i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = call i32 @memset(i8* %12, i32 255, i64 %13)
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"buffer = %p\0A\00"
define i32 @main() {
%1 = tail call align 128 dereferenceable_or_null(12800) i8* @aligned_alloc(i64 128, i64 12800)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @memset(i8* %1, i32 255, i64 12800)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
int agent_is_agent_error(int error) {
  if (error >= 5000 && error < 5100)
    return 1;
  if (error >= 1000 && error < 1100)
    return 2;
  if (error >= 3000 && error < 3100)
    return 3;
  return 0;
}


x86 assembly (clang, -O0):
<agent_is_agent_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1388,-0x8(%rbp)
jl     112d <agent_is_agent_error+0x2d>
cmpl   $0x13ec,-0x8(%rbp)
jge    112d <agent_is_agent_error+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1180 <agent_is_agent_error+0x80>
cmpl   $0x3e8,-0x8(%rbp)
jl     1153 <agent_is_agent_error+0x53>
cmpl   $0x44c,-0x8(%rbp)
jge    1153 <agent_is_agent_error+0x53>
movl   $0x2,-0x4(%rbp)
jmp    1180 <agent_is_agent_error+0x80>
cmpl   $0xbb8,-0x8(%rbp)
jl     1179 <agent_is_agent_error+0x79>
cmpl   $0xc1c,-0x8(%rbp)
jge    1179 <agent_is_agent_error+0x79>
movl   $0x3,-0x4(%rbp)
jmp    1180 <agent_is_agent_error+0x80>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<agent_is_agent_error>:
lea    -0x1388(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x64,%ecx
jb     1131 <agent_is_agent_error+0x31>
lea    -0x3e8(%rdi),%ecx
mov    $0x2,%eax
cmp    $0x64,%ecx
jb     1131 <agent_is_agent_error+0x31>
add    $0xfffff448,%edi
xor    %eax,%eax
cmp    $0x64,%edi
setb   %al
lea    (%rax,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @agent_is_agent_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 5000
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 5100
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %25
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 1000
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 1100
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 2, i32* %2
br label %25
17: ; preds = %13, %10
%18 = load i32, i32* %3
%19 = icmp sge i32 %18, 3000
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 3100
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 3, i32* %2
br label %25
24: ; preds = %20, %17
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23, %16, %9
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @agent_is_agent_error(i32 %0) {
%2 = add i32 %0, -5000
%3 = icmp ult i32 %2, 100
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i32 %0, -1000
%6 = icmp ult i32 %5, 100
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add i32 %0, -3000
%9 = icmp ult i32 %8, 100
%10 = select i1 %9, i32 3, i32 0
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 2, %4 ], [ %10, %7 ]
ret i32 %12
}
int _Xthr_zero_stub_() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_Xthr_zero_stub_() {
ret i32 0
}
char *getns(char *l) {
  while (*l == ' ')
    l++;
  return l;
}


x86 assembly (clang, -O0):
<getns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <getns+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <getns+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getns>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
je     1110 <getns+0x10>
ret

LLVM IR (-O0):
define i8* @getns(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 32
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @getns(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i8* %3
}
void XwcTextPerCharExtents() {}


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

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

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

LLVM IR (-O2):
define void @XwcTextPerCharExtents() {
ret void
}
unsigned long long __bswapdi2(unsigned long long u) {
  return (((u)&0xff00000000000000ull) >> 56) |
         (((u)&0x00ff000000000000ull) >> 40) |
         (((u)&0x0000ff0000000000ull) >> 24) |
         (((u)&0x000000ff00000000ull) >> 8) |
         (((u)&0x00000000ff000000ull) << 8) |
         (((u)&0x0000000000ff0000ull) << 24) |
         (((u)&0x000000000000ff00ull) << 40) |
         (((u)&0x00000000000000ffull) << 56);
}


x86 assembly (clang, -O0):
<__bswapdi2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xff00000000000000,%rax
and    -0x8(%rbp),%rax
shr    $0x38,%rax
movabs $0xff000000000000,%rcx
and    -0x8(%rbp),%rcx
shr    $0x28,%rcx
or     %rcx,%rax
movabs $0xff0000000000,%rcx
and    -0x8(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
movabs $0xff00000000,%rcx
and    -0x8(%rbp),%rcx
shr    $0x8,%rcx
or     %rcx,%rax
movabs $0xff000000,%rcx
and    -0x8(%rbp),%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff0000,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x28,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff,%rcx
shl    $0x38,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @__bswapdi2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -72057594037927936
%5 = lshr i64 %4, 56
%6 = load i64, i64* %2
%7 = and i64 %6, 71776119061217280
%8 = lshr i64 %7, 40
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = and i64 %10, 280375465082880
%12 = lshr i64 %11, 24
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = and i64 %14, 1095216660480
%16 = lshr i64 %15, 8
%17 = or i64 %13, %16
%18 = load i64, i64* %2
%19 = and i64 %18, 4278190080
%20 = shl i64 %19, 8
%21 = or i64 %17, %20
%22 = load i64, i64* %2
%23 = and i64 %22, 16711680
%24 = shl i64 %23, 24
%25 = or i64 %21, %24
%26 = load i64, i64* %2
%27 = and i64 %26, 65280
%28 = shl i64 %27, 40
%29 = or i64 %25, %28
%30 = load i64, i64* %2
%31 = and i64 %30, 255
%32 = shl i64 %31, 56
%33 = or i64 %29, %32
ret i64 %33
}

LLVM IR (-O2):
define i64 @__bswapdi2(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
void gtk_window_set_frame_dimensions() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_frame_dimensions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_repaint();
void redraw_screen(void) { io_repaint(); }


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

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

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

LLVM IR (-O2):
define void @redraw_screen() {
%1 = tail call i32 (...) @io_repaint()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void printidstring(char *str) { fputs(str, stdout); }


x86 assembly (clang, -O0):
<printidstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printidstring>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @printidstring(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @printidstring(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
void *dlsym(void *, char *);
void *GetProcAddress(void *hModule, char *lpProcName) {
  return dlsym(hModule, lpProcName);
}


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

x86 assembly (clang, -O2):
<GetProcAddress>:
jmp    1030 <dlsym@plt>

LLVM IR (-O0):
define i8* @GetProcAddress(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 i8* @dlsym(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @GetProcAddress(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
int fun659() { return 659; }


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

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

LLVM IR (-O0):
define i32 @fun659() {
ret i32 659
}

LLVM IR (-O2):
define i32 @fun659() {
ret i32 659
}
/* Type definitions */
struct sock_fprog {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __compile_init(struct sock_fprog *);
void teamd_bpf_desc_compile_start(struct sock_fprog *fprog) {
  __compile_init(fprog);
}


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

x86 assembly (clang, -O2):
<teamd_bpf_desc_compile_start>:
jmp    1030 <__compile_init@plt>

LLVM IR (-O0):
%struct.sock_fprog = type { i32 }
define void @teamd_bpf_desc_compile_start(%struct.sock_fprog* %0) {
%2 = alloca %struct.sock_fprog*
store %struct.sock_fprog* %0, %struct.sock_fprog** %2
%3 = load %struct.sock_fprog*, %struct.sock_fprog** %2
%4 = call i32 @__compile_init(%struct.sock_fprog* %3)
ret void
}

LLVM IR (-O2):
%struct.sock_fprog = type { i32 }
define void @teamd_bpf_desc_compile_start(%struct.sock_fprog* %0) {
%2 = tail call i32 @__compile_init(%struct.sock_fprog* %0)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *partition(int *, int /*<<< orphan*/, int);
struct TreeNode *sortedArrayToBST(int *nums, int numsSize) {
  return partition(nums, 0, numsSize - 1);
}


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

x86 assembly (clang, -O2):
<sortedArrayToBST>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <partition@plt>

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call %struct.TreeNode* @partition(i32* %5, i32 0, i32 %7)
ret %struct.TreeNode* %8
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call %struct.TreeNode* @partition(i32* %0, i32 0, i32 %3)
ret %struct.TreeNode* %4
}
int test_imm_DAint32_reg(int val) { return ((val) & (0xDA << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_DAint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xda,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DAint32_reg>:
test   $0xda,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DAint32_reg(i32 %0) {
%2 = and i32 %0, 218
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int MAP_FILE;
int MAP_SHARED;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ mmap(int /*<<< orphan*/, int /*<<< orphan*/,
                        int /*<<< orphan*/, int, int, int /*<<< orphan*/);
int main(int argc, char **argv) {
  mmap(0, 0, PROT_READ, MAP_FILE | MAP_SHARED, -1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%edx
mov    0x2ea2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea9(%rip),%rax
or     (%rax),%ecx
xor    %r9d,%r9d
mov    $0xffffffff,%r8d
mov    %r9d,%edi
mov    %r9d,%esi
call   1030 <mmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ee0(%rip),%rax
mov    (%rax),%edx
mov    0x2eb7(%rip),%rax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %edi,%edi
xor    %esi,%esi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PROT_READ = global i32 0
@MAP_FILE = global i32 0
@MAP_SHARED = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @PROT_READ
%7 = load i32, i32* @MAP_FILE
%8 = load i32, i32* @MAP_SHARED
%9 = or i32 %7, %8
%10 = call i32 @mmap(i32 0, i32 0, i32 %6, i32 %9, i32 -1, i32 0)
ret i32 0
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@MAP_FILE = global i32 0
@MAP_SHARED = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @MAP_FILE
%5 = load i32, i32* @MAP_SHARED
%6 = or i32 %5, %4
%7 = tail call i32 @mmap(i32 0, i32 0, i32 %3, i32 %6, i32 -1, i32 0)
ret i32 0
}
int cairo_code_draw_ivorySlider_get_width() { return 38; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_ivorySlider_get_width() {
ret i32 38
}

LLVM IR (-O2):
define i32 @cairo_code_draw_ivorySlider_get_width() {
ret i32 38
}
/* Variables and functions */
char *netmalloc(int);
void *thread_main(void *param) {
  (void)param;
  char *buf = netmalloc(10000);
  buf[100] = 5;
  buf[5000] = 10;
  buf[9000] = 11;
  return NULL;
}


x86 assembly (clang, -O0):
<thread_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2710,%edi
call   1030 <netmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x5,0x64(%rax)
mov    -0x10(%rbp),%rax
movb   $0xa,0x1388(%rax)
mov    -0x10(%rbp),%rax
movb   $0xb,0x2328(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_main>:
push   %rax
mov    $0x2710,%edi
call   1030 <netmalloc@plt>
movb   $0x5,0x64(%rax)
movb   $0xa,0x1388(%rax)
movb   $0xb,0x2328(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thread_main(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @netmalloc(i32 10000)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 100
store i8 5, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 5000
store i8 10, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 9000
store i8 11, i8* %11
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_main(i8* nocapture readnone %0) {
%2 = tail call i8* @netmalloc(i32 10000)
%3 = getelementptr inbounds i8, i8* %2, i64 100
store i8 5, i8* %3
%4 = getelementptr inbounds i8, i8* %2, i64 5000
store i8 10, i8* %4
%5 = getelementptr inbounds i8, i8* %2, i64 9000
store i8 11, i8* %5
ret i8* null
}
int isascii(int c) { return c < 128; }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp slt i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ testitcd();
int main() {
  testitcd();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testitcd()
ret i32 0
}
void I2CSlaveDataPut(unsigned long ulBase, unsigned char ucData) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ucData;
}


x86 assembly (clang, -O0):
<I2CSlaveDataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveDataPut>:
mov    %esi,%eax
mov    %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveDataPut(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = load i64, i64* %3
%8 = add i64 %7, 8
%9 = inttoptr i64 %8 to i64*
store volatile i64 %6, i64* %9
ret void
}

LLVM IR (-O2):
define void @I2CSlaveDataPut(i64 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i64
%4 = add i64 %0, 8
%5 = inttoptr i64 %4 to i64*
store volatile i64 %3, i64* %5
ret void
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(scalar_t__ volatile);
uint32_t UARTIntStatus(uint32_t ui32Base, bool bMasked) {
  ASSERT(_UARTBaseValid(ui32Base));
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000040))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x0000003C))));
  }
}


x86 assembly (clang, -O0):
<UARTIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
cmpl   $0x0,-0x14(%rbp)
je     115a <UARTIntStatus+0x3a>
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <UARTIntStatus+0x46>
mov    -0x10(%rbp),%rax
mov    0x3c(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntStatus>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,0x8(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
mov    0x8(%rsp),%rcx
mov    0x3c(%rcx,%rax,4),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @UARTIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store volatile i64 %0, i64* %4
store i32 %1, i32* %5
%6 = load volatile i64, i64* %4
%7 = call i32 @_UARTBaseValid(i64 %6)
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load volatile i64, i64* %4
%13 = add nsw i64 %12, 64
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
store i64 %15, i64* %3
br label %21
16: ; preds = %2
%17 = load volatile i64, i64* %4
%18 = add nsw i64 %17, 60
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
store i64 %20, i64* %3
br label %21
21: ; preds = %16, %11
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @UARTIntStatus(i64 %0, i32 %1) {
%3 = alloca i64
store volatile i64 %0, i64* %3
%4 = load volatile i64, i64* %3
%5 = tail call i32 @_UARTBaseValid(i64 %4)
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp eq i32 %1, 0
%8 = load volatile i64, i64* %3
%9 = select i1 %7, i64 60, i64 64
%10 = add nsw i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int fact(int);
int /*<<< orphan*/ printf(char *);
main() {
  assert(fact(5) == 120);
  printf("factorial test passed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1050 <fact@plt>
cmp    $0x78,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <fact@plt>
xor    %edi,%edi
cmp    $0x78,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"factorial test passed.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fact(i32 5)
%3 = icmp eq i32 %2, 120
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"factorial test passed.\00"
define i32 @main() {
%1 = tail call i32 @fact(i32 5)
%2 = icmp eq i32 %1, 120
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *malloc(intptr_t);
intptr_t read(int /*<<< orphan*/, char *, intptr_t);
intptr_t read_long();
int /*<<< orphan*/ x_perror(char *);
char *read_string() {
  intptr_t length = read_long();
  char *buf = malloc(length + 1);
  if (read(0, buf, length) != length) {
    x_perror("read_string");
  }
  buf[length] = 0;
  return buf;
}


x86 assembly (clang, -O0):
<read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <read_long@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
call   1040 <read@plt>
cmp    -0x8(%rbp),%rax
je     1189 <read_string+0x49>
lea    0xe7c(%rip),%rdi
call   1030 <x_perror@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <read_long@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1040 <read@plt>
cmp    %rbx,%rax
je     1178 <read_string+0x38>
lea    0xe8d(%rip),%rdi
call   1030 <x_perror@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"read_string\00"
define noalias i8* @read_string() {
%1 = tail call i64 (...) @read_long()
%2 = add nsw i64 %1, 1
%3 = tail call i8* @malloc(i64 %2)
%4 = tail call i64 @read(i32 0, i8* %3, i64 %1)
%5 = icmp eq i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @x_perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = getelementptr inbounds i8, i8* %3, i64 %1
store i8 0, i8* %9
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void main(int argc, char **argv) {
  int t;
  for (t = 0;; t++) {
    putchar(t * ((t >> 14 | t >> 9) & 92 & t >> 5));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%eax
sar    $0xe,%eax
mov    -0x14(%rbp),%ecx
sar    $0x9,%ecx
or     %ecx,%eax
and    $0x5c,%eax
mov    -0x14(%rbp),%ecx
sar    $0x5,%ecx
and    %ecx,%eax
imul   %eax,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%eax
shr    $0xe,%eax
mov    %ebx,%ecx
shr    $0x9,%ecx
or     %eax,%ecx
mov    %ebx,%edi
shr    $0x5,%edi
and    %ecx,%edi
and    $0x5c,%edi
imul   %ebx,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %5
%9 = ashr i32 %8, 14
%10 = load i32, i32* %5
%11 = ashr i32 %10, 9
%12 = or i32 %9, %11
%13 = and i32 %12, 92
%14 = load i32, i32* %5
%15 = ashr i32 %14, 5
%16 = and i32 %13, %15
%17 = mul nsw i32 %7, %16
%18 = call i32 @putchar(i32 %17)
br label %19
19: ; preds = %6
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %13, %3 ]
%5 = lshr i32 %4, 14
%6 = lshr i32 %4, 9
%7 = or i32 %5, %6
%8 = lshr i32 %4, 5
%9 = and i32 %8, 92
%10 = and i32 %9, %7
%11 = mul nuw nsw i32 %10, %4
%12 = tail call i32 @putchar(i32 %11)
%13 = add nuw nsw i32 %4, 1
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ wctype_t;

/* Variables and functions */
int iswctype(wint_t c, wctype_t desc) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @iswctype(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo(long long x) {
  if (x >> 1)
    bar();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
cmp    $0x0,%rax
je     1135 <foo+0x25>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x2,%rdi
jae    1117 <foo+0x7>
ret
xor    %eax,%eax
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 1
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @bar()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_91uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x91 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_91uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 622770257920
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void MakeSegv() {
  volatile int *p;
  int i;
  p = (volatile int *)0x9;
  i = *p;
}


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

x86 assembly (clang, -O2):
<MakeSegv>:
mov    0x9,%eax
ret

LLVM IR (-O0):
define void @MakeSegv() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 9 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = load volatile i32, i32* %3
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @MakeSegv() {
%1 = load volatile i32, i32* inttoptr (i64 9 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void Sleep(int t) { usleep(t * 1000); }


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

x86 assembly (clang, -O2):
<Sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @Sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @Sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void Bochs_putch(const char chr) {
  __asm__ __volatile__("outb %0, %1" : : "a"(chr), "Nd"(0xE9));
}


x86 assembly (clang, -O0):
<Bochs_putch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
out    %al,$0xe9
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bochs_putch>:
mov    %edi,%eax
out    %al,$0xe9
ret

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

LLVM IR (-O2):
define void @Bochs_putch(i8 signext %0) {
tail call void asm sideeffect "outb $0, $1", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i32 233)
ret void
}
int f() {
  int a = -42;
  int b = -35;
  if (a = -8)
    return a;
  return 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffd6,-0x8(%rbp)
movl   $0xffffffdd,-0xc(%rbp)
movl   $0xfffffff8,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1128 <f+0x28>
jmp    1133 <f+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <f+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 -42, i32* %2
store i32 -35, i32* %3
store i32 -8, i32* %2
br i1 true, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* %2
store i32 %5, i32* %1
br label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @f() {
ret i32 -8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int const *, int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void chacha20_init(uint32_t st[16], const uint8_t key[32]) {
  static const uint32_t constants[4] = {0x61707865, 0x3320646e, 0x79622d32,
                                        0x6b206574};
  memcpy(&st[0], constants, 4 * 4);
  memcpy(&st[4], key, 32);
  memset(&st[12], 0, 4 * 4);
}


x86 assembly (clang, -O0):
<chacha20_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
add    $0x30,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chacha20_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
lea    0x10(%rbx),%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1040 <memcpy@plt>
add    $0x30,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memset@plt>

LLVM IR (-O0):
@chacha20_init.constants = internal constant [4 x i32] [i32 1634760805, i32 857760878, i32 2036477234, i32 1797285236]
define void @chacha20_init(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = call i32 @memcpy(i32* %6, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @chacha20_init.constants, i64 0, i64 0), i32 16)
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 4
%10 = load i32*, i32** %4
%11 = call i32 @memcpy(i32* %9, i32* %10, i32 32)
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 12
%14 = call i32 @memset(i32* %13, i32 0, i32 16)
ret void
}

LLVM IR (-O2):
@chacha20_init.constants = internal constant [4 x i32] [i32 1634760805, i32 857760878, i32 2036477234, i32 1797285236]
define void @chacha20_init(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* getelementptr inbounds ([4 x i32], [4 x i32]* @chacha20_init.constants, i64 0, i64 0), i32 16)
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = tail call i32 @memcpy(i32* %4, i32* %1, i32 32)
%6 = getelementptr inbounds i32, i32* %0, i64 12
%7 = tail call i32 @memset(i32* %6, i32 0, i32 16)
ret void
}
int test_imm_16int8_mem(signed char *val) {
  return ((*val) & (-0x16 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_16int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffea,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_16int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -22
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}