xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void destroy(char **ptr) {
  free(*ptr);
  *ptr = NULL;
}


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

x86 assembly (clang, -O2):
<destroy>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @destroy(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
void test_io() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint32_t sancus_u32l(long v) {
  assert((v >= 0) && (v <= 0xffffffff));
  return (uint32_t)v;
}


x86 assembly (clang, -O0):
<sancus_u32l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     113b <sancus_u32l+0x2b>
mov    $0xffffffff,%eax
cmp    %rax,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_u32l>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
mov    %rbx,%rax
shr    $0x20,%rax
sete   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_u32l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 4294967295
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %2
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @sancus_u32l(i64 %0) {
%2 = icmp ult i64 %0, 4294967296
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = trunc i64 %0 to i32
ret i32 %5
}
int test_imm_CBuint8_reg(unsigned char val) {
  return ((val) & (0xCB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CBuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xcb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_CBuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -53
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int ch) { return islower(ch) ? ch & 0x5F : ch; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
and    $0x5f,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
and    $0x5f,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, 95
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_value(int value) { printf("Value is %d.\n", value); }


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

x86 assembly (clang, -O2):
<print_value>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"Value is %d.\0A\00"
define void @print_value(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int cmd_exit(int argc, char **argv) {
  int val = 0;
  if (argc > 0)
    val = atoi(argv[0]);
  exit(val);
}


x86 assembly (clang, -O0):
<cmd_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114f <cmd_exit+0x2f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cmd_exit>:
push   %rax
mov    %edi,%eax
xor    %edi,%edi
test   %eax,%eax
jle    1133 <cmd_exit+0x13>
mov    (%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @cmd_exit(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
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %5
br label %13
13: ; preds = %8, %2
%14 = load i32, i32* %5
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
define i32 @cmd_exit(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @atoi(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int HadTu_decoding(void const *);
uint32_t SubEvt_decoding(const void *my) {
  return (HadTu_decoding(my) & 0xFFFFFF0F);
}


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

x86 assembly (clang, -O2):
<SubEvt_decoding>:
push   %rax
call   1030 <HadTu_decoding@plt>
and    $0xffffff0f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SubEvt_decoding(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @HadTu_decoding(i8* %3)
%5 = and i32 %4, -241
ret i32 %5
}

LLVM IR (-O2):
define i32 @SubEvt_decoding(i8* %0) {
%2 = tail call i32 @HadTu_decoding(i8* %0)
%3 = and i32 %2, -241
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Swap(int *, int /*<<< orphan*/, int /*<<< orphan*/);
void reverse(int Array[], int lo, int hi) {
  while (lo < hi) {
    Swap(Array, lo--, hi--);
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1152 <reverse+0x42>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edx
mov    %edx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
call   1030 <Swap@plt>
jmp    1122 <reverse+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    %edx,%esi
jge    1150 <reverse+0x40>
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x1(%rbx),%r12d
lea    -0x1(%r15),%ebp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   1030 <Swap@plt>
cmp    %r15d,%ebx
mov    %ebp,%r15d
mov    %r12d,%ebx
jl     1130 <reverse+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @reverse(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %2, %3 ]
%7 = phi i32 [ %8, %5 ], [ %1, %3 ]
%8 = add nsw i32 %7, -1
%9 = add nsw i32 %6, -1
%10 = tail call i32 @Swap(i32* %0, i32 %7, i32 %6)
%11 = icmp slt i32 %7, %6
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int LOG_EMERG;
int LOG_USER;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ syslog(int, char *);
int main() {
  FILE *f;
  f = fopen("not_here", "r");
  if (!f)
    syslog(LOG_EMERG | LOG_USER, "oops - %m \n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <main+0x4f>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rax
or     (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <syslog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
jne    1167 <main+0x37>
mov    0x2e90(%rip),%rax
mov    0x2e91(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <syslog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"not_here\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_EMERG = global i32 0
@LOG_USER = global i32 0
@.str.2 = [12 x i8] c"oops - %m \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = load i32, i32* @LOG_EMERG
%8 = load i32, i32* @LOG_USER
%9 = or i32 %7, %8
%10 = call i32 @syslog(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %6, %0
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"not_here\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_EMERG = global i32 0
@LOG_USER = global i32 0
@.str.2 = [12 x i8] c"oops - %m \0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @LOG_EMERG
%5 = load i32, i32* @LOG_USER
%6 = or i32 %5, %4
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %3, %0
%9 = tail call i32 @exit(i32 0)
unreachable
}
int hwlist_sensor_chip(const char *value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hwlist_sensor_chip(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int ccnl_ccnb_mkField(unsigned char *, unsigned int, int, unsigned char *,
                      int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int ccnl_ccnb_mkStrBlob(unsigned char *out, unsigned int num, unsigned int tt,
                        char *str) {
  (void)tt;
  return ccnl_ccnb_mkField(out, num, 5, (unsigned char *)str, strlen(str));
}


x86 assembly (clang, -O0):
<ccnl_ccnb_mkStrBlob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
mov    $0x5,%edx
call   1040 <ccnl_ccnb_mkField@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnl_ccnb_mkStrBlob>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
mov    %rcx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    $0x5,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ccnl_ccnb_mkField@plt>

LLVM IR (-O0):
define i32 @ccnl_ccnb_mkStrBlob(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %8
%13 = load i8*, i8** %8
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @ccnl_ccnb_mkField(i8* %10, i32 %11, i32 5, i8* %12, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @ccnl_ccnb_mkStrBlob(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @strlen(i8* %3)
%6 = tail call i32 @ccnl_ccnb_mkField(i8* %0, i32 %1, i32 5, i8* %3, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void dummy_variadic(void *what, ...) {
  assert(what);
  return;
}


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

x86 assembly (clang, -O2):
<dummy_variadic>:
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @dummy_variadic(i8* %0, ...) {
%2 = tail call i32 @assert(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
bob(int a) { printf("B: %d\n", a); }


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

x86 assembly (clang, -O2):
<bob>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"B: %d\0A\00"
define i32 @bob(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
void RTTestCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestCreate() {
ret void
}
/* Variables and functions */
int get_proc_cpuinfo_data(char *, char *, int /*<<< orphan*/);
int generic_get_cpu_vendor(char *vendor) {
  return get_proc_cpuinfo_data("vendor", vendor, 0);
}


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

x86 assembly (clang, -O2):
<generic_get_cpu_vendor>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
jmp    1030 <get_proc_cpuinfo_data@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"vendor\00"
define i32 @generic_get_cpu_vendor(i8* %0) {
%2 = tail call i32 @get_proc_cpuinfo_data(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int _nss_prax_gethostbyname2_r(char const *, int /*<<< orphan*/,
                               struct hostent *, char *, size_t, int *, int *);
enum nss_status _nss_prax_gethostbyname_r(const char *name,
                                          struct hostent *result, char *buffer,
                                          size_t buflen, int *errnop,
                                          int *h_errnop) {
  return _nss_prax_gethostbyname2_r(name, AF_INET, result, buffer, buflen,
                                    errnop, h_errnop);
}


x86 assembly (clang, -O0):
<_nss_prax_gethostbyname_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <_nss_prax_gethostbyname2_r@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_prax_gethostbyname_r>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ec4(%rip),%rsi
mov    (%rsi),%esi
mov    %r9,(%rsp)
mov    %rax,%r9
call   1030 <_nss_prax_gethostbyname2_r@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @_nss_prax_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* @AF_INET
%15 = load %struct.hostent*, %struct.hostent** %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load i32*, i32** %11
%19 = load i32*, i32** %12
%20 = call i32 @_nss_prax_gethostbyname2_r(i8* %13, i32 %14, %struct.hostent* %15, i8* %16, i64 %17, i32* %18, i32* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @_nss_prax_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = load i32, i32* @AF_INET
%8 = tail call i32 @_nss_prax_gethostbyname2_r(i8* %0, i32 %7, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ run(int);
void running(void) {
  for (;;)
    run(100);
}


x86 assembly (clang, -O0):
<running>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <running+0x9>
mov    $0x64,%edi
call   1030 <run@plt>
jmp    1119 <running+0x9>

x86 assembly (clang, -O2):
<running>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <run@plt>
jmp    1120 <running+0x10>

LLVM IR (-O0):
define void @running() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @run(i32 100)
br label %1
}

LLVM IR (-O2):
define void @running() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @run(i32 100)
br label %1
}
void av_demuxer_open() {}


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

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

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

LLVM IR (-O2):
define void @av_demuxer_open() {
ret void
}
void discrete_world_2D_position(unsigned long long index, unsigned int w,
                                unsigned int *x, unsigned int *y) {
  *x = index % w;
  *y = index / w;
}


x86 assembly (clang, -O0):
<discrete_world_2D_position>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<discrete_world_2D_position>:
mov    %rdx,%r8
mov    %rdi,%rax
mov    %esi,%esi
mov    %rdi,%rdx
shr    $0x20,%rdx
je     1118 <discrete_world_2D_position+0x18>
xor    %edx,%edx
div    %rsi
jmp    111c <discrete_world_2D_position+0x1c>
xor    %edx,%edx
div    %esi
mov    %edx,(%r8)
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @discrete_world_2D_position(i64 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i64 %0, i64* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = zext i32 %10 to i64
%12 = urem i64 %9, %11
%13 = trunc i64 %12 to i32
%14 = load i32*, i32** %7
store i32 %13, i32* %14
%15 = load i64, i64* %5
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = udiv i64 %15, %17
%19 = trunc i64 %18 to i32
%20 = load i32*, i32** %8
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @discrete_world_2D_position(i64 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = zext i32 %1 to i64
%6 = urem i64 %0, %5
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = udiv i64 %0, %5
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_del(struct list_head *);
int /*<<< orphan*/ list_init(struct list_head *);
void list_del_init(struct list_head *r) {
  list_del(r);
  list_init(r);
}


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

x86 assembly (clang, -O2):
<list_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <list_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <list_init@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @list_del(%struct.list_head* %3)
%5 = load %struct.list_head*, %struct.list_head** %2
%6 = call i32 @list_init(%struct.list_head* %5)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = tail call i32 @list_del(%struct.list_head* %0)
%3 = tail call i32 @list_init(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, unsigned char *, int);
double R8(unsigned char *p) {
  double r;
  memcpy(&r, p, 8);
  return r;
}


x86 assembly (clang, -O0):
<R8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R8>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @R8(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(double* %3, i8* %4, i32 8)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @R8(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @memcpy(double* %2, i8* %0, i32 8)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgcalr(void) { gen("call\t*%eax"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"call\09*%eax\00"
define void @cgcalr() {
%1 = call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"call\09*%eax\00"
define void @cgcalr() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int _function(int x) { return x + 1; }


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

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

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

LLVM IR (-O2):
define i32 @_function(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int test2(int a, int b, int c) {
  int x = a;
  int y = b;
  return (x + y - c);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
lea    (%rdi,%rsi,1),%eax
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
store i32 %9, i32* %7
%10 = load i32, i32* %5
store i32 %10, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @test2(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = sub i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Print(int *array, int length) {
  for (int i = 0; i < length; i++) {
    printf("%4d", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <Print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <Print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <Print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%4d\00"
define void @Print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
void bit_set16(volatile uint16_t *ptr, uint8_t bit) {
  *((volatile uint16_t *)(((uintptr_t)ptr) | (1 << 27))) =
      (uint16_t)((1ul << bit));
}


x86 assembly (clang, -O0):
<bit_set16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
or     $0x8000000,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set16>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
or     $0x8000000,%rdi
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @bit_set16(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = shl i64 1, %5
%7 = load i64*, i64** %3
%8 = ptrtoint i64* %7 to i64
%9 = or i64 %8, 134217728
%10 = inttoptr i64 %9 to i64*
store volatile i64 %6, i64* %10
ret void
}

LLVM IR (-O2):
define void @bit_set16(i64* %0, i64 %1) {
%3 = shl nuw i64 1, %1
%4 = ptrtoint i64* %0 to i64
%5 = or i64 %4, 134217728
%6 = inttoptr i64 %5 to i64*
store volatile i64 %3, i64* %6
ret void
}
void vcopy(float *v1, float *out) {
  out[0] = v1[0];
  out[1] = v1[1];
  out[2] = v1[2];
}


x86 assembly (clang, -O0):
<vcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcopy>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @vcopy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %4
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %4
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
ret void
}

LLVM IR (-O2):
define void @vcopy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ inccount(int);
void *xcalloc(size_t size) {
  void *p = calloc(1, size);
  if (p) {
    inccount(7);
  }
  return (p);
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <xcalloc+0x33>
mov    $0x7,%edi
call   1030 <inccount@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1140 <xcalloc+0x20>
mov    $0x7,%edi
call   1030 <inccount@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @inccount(i32 7)
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @inccount(i32 7)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
void printerr(char *app, char *msg, char *dir) {
  fprintf(stderr, "%s: cannot create the directory '%s': %s\n", app, dir, msg);
}


x86 assembly (clang, -O0):
<printerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printerr>:
mov    %rdx,%rcx
mov    %rsi,%r8
mov    %rdi,%rdx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"%s: cannot create the directory '%s': %s\0A\00"
define void @printerr(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"%s: cannot create the directory '%s': %s\0A\00"
define void @printerr(i8* %0, i8* %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2, i8* %1)
ret void
}
int foo(unsigned int i, unsigned int j) {
  i &= 15;
  j &= 15;
  i += 1024;
  j += 2048;
  i |= j;
  return i >= 1024 + 2048;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x400,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x800,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xc00,-0x4(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(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 = and i32 %5, 15
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %7, 15
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = add i32 %9, 1024
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = add i32 %11, 2048
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp uge i32 %16, 3072
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_server_cancel_all_calls() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_server_cancel_all_calls>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_server_cancel_all_calls>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_cancel_all_calls() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_cancel_all_calls() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
unsigned int _hrt_is_p2(unsigned int x) { return (x & (x - 1)) == 0; }


x86 assembly (clang, -O0):
<_hrt_is_p2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hrt_is_p2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @_hrt_is_p2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_hrt_is_p2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int do_103() { return 103; }


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

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

LLVM IR (-O0):
define i32 @do_103() {
ret i32 103
}

LLVM IR (-O2):
define i32 @do_103() {
ret i32 103
}
int test_023(int a, int b, int c, int d) { return a + ((b >> 31) & 1); }


x86 assembly (clang, -O0):
<test_023>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1f,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_023>:
shr    $0x1f,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @test_023(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = ashr i32 %10, 31
%12 = and i32 %11, 1
%13 = add nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_023(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = lshr i32 %1, 31
%6 = add nsw i32 %5, %0
ret i32 %6
}
int checkTamTipo(const unsigned char *tr) {
  if ((tr[12] * 256) + tr[13] < 1500)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkTamTipo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0xc(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0xd(%rcx),%ecx
add    %ecx,%eax
cmp    $0x5dc,%eax
jge    1134 <checkTamTipo+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <checkTamTipo+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkTamTipo>:
movzwl 0xc(%rdi),%ecx
shl    $0x10,%ecx
bswap  %ecx
xor    %eax,%eax
cmp    $0x5dc,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @checkTamTipo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 12
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = mul nsw i32 %7, 256
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 13
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = icmp slt i32 %13, 1500
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @checkTamTipo(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 13
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = or i32 %5, %8
%10 = icmp ult i32 %9, 1500
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (0 == n % 3)
    printf("YES");
  else
    printf("NO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    1165 <main+0x45>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    1171 <main+0x51>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
imul   $0xaaaaaaab,0x4(%rsp),%eax
aa
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
lea    0xeb8(%rip),%rax
lea    0xeb5(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 3
%6 = icmp eq i32 0, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
void gdk_draw_points() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_points() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ sw(int);
int /*<<< orphan*/ sw2(int);
int main(int argc, char **argv) {
  int i;
  if (argc != 1)
    return 0;
  foo(argc);
  for (i = 0; i < 5; ++i) {
    sw(-1);
  }
  sw2(argc - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     115c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    119f <main+0x6f>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    118d <main+0x5d>
mov    $0xffffffff,%edi
call   1050 <sw@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116b <main+0x3b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <sw2@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jne    117d <main+0x4d>
push   %rax
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0xffffffff,%edi
call   1050 <sw@plt>
mov    $0xffffffff,%edi
call   1050 <sw@plt>
mov    $0xffffffff,%edi
call   1050 <sw@plt>
mov    $0xffffffff,%edi
call   1050 <sw@plt>
mov    $0xffffffff,%edi
call   1050 <sw@plt>
xor    %edi,%edi
call   1040 <sw2@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = tail call i32 @foo(i32 1)
%6 = tail call i32 @sw(i32 -1)
%7 = tail call i32 @sw(i32 -1)
%8 = tail call i32 @sw(i32 -1)
%9 = tail call i32 @sw(i32 -1)
%10 = tail call i32 @sw(i32 -1)
%11 = tail call i32 @sw2(i32 0)
br label %12
12: ; preds = %2, %4
ret i32 0
}