xunge/DecIR huggingface dataset:
int test_imm_88int8_mem(signed char *val) {
  return ((*val) & (-0x88 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_88int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff78,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_88int8_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, -136
%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_88int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -136
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
int e(void) { return 'e'; }


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

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

LLVM IR (-O0):
define i32 @e() {
ret i32 101
}

LLVM IR (-O2):
define i32 @e() {
ret i32 101
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, int *);
int atoi(const char *str) {
  int result;
  sscanf(str, "%d", &result);
  return result;
}


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

x86 assembly (clang, -O2):
<atoi>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @atoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int iptcb_get_entry_n(struct ipt_entry *i, unsigned int number,
                      unsigned int *pos, struct ipt_entry **pe) {
  if (*pos == number) {
    *pe = i;
    return 1;
  }
  (*pos)++;
  return 0;
}


x86 assembly (clang, -O0):
<iptcb_get_entry_n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1139 <iptcb_get_entry_n+0x39>
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114b <iptcb_get_entry_n+0x4b>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iptcb_get_entry_n>:
mov    (%rdx),%eax
cmp    %esi,%eax
jne    110f <iptcb_get_entry_n+0xf>
mov    %rdi,(%rcx)
mov    $0x1,%eax
ret
add    $0x1,%eax
mov    %eax,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.ipt_entry = type opaque
define i32 @iptcb_get_entry_n(%struct.ipt_entry* %0, i32 %1, i32* %2, %struct.ipt_entry** %3) {
%5 = alloca i32
%6 = alloca %struct.ipt_entry*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca %struct.ipt_entry**
store %struct.ipt_entry* %0, %struct.ipt_entry** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store %struct.ipt_entry** %3, %struct.ipt_entry*** %9
%10 = load i32*, i32** %8
%11 = load i32, i32* %10
%12 = load i32, i32* %7
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load %struct.ipt_entry*, %struct.ipt_entry** %6
%16 = load %struct.ipt_entry**, %struct.ipt_entry*** %9
store %struct.ipt_entry* %15, %struct.ipt_entry** %16
store i32 1, i32* %5
br label %21
17: ; preds = %4
%18 = load i32*, i32** %8
%19 = load i32, i32* %18
%20 = add i32 %19, 1
store i32 %20, i32* %18
store i32 0, i32* %5
br label %21
21: ; preds = %17, %14
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
%struct.ipt_entry = type opaque
define i32 @iptcb_get_entry_n(%struct.ipt_entry* %0, i32 %1, i32* nocapture %2, %struct.ipt_entry** nocapture writeonly %3) {
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, %1
br i1 %6, label %7, label %8
7: ; preds = %4
store %struct.ipt_entry* %0, %struct.ipt_entry** %3
br label %10
8: ; preds = %4
%9 = add i32 %5, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ 1, %7 ], [ 0, %8 ]
ret i32 %11
}
OP(ed, f4) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
scalar_t__ putbyte(int, int);
scalar_t__ special_cmd(int, unsigned char);
int send_cmd(int fd, unsigned char cmd) {
  return (special_cmd(fd, cmd) && putbyte(fd, 0xE9));
}


x86 assembly (clang, -O0):
<send_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
movzbl -0x5(%rbp),%esi
call   1030 <special_cmd@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x6(%rbp)
je     1166 <send_cmd+0x46>
mov    -0x4(%rbp),%edi
mov    $0xe9,%esi
call   1040 <putbyte@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd>:
push   %rbx
mov    %edi,%ebx
call   1030 <special_cmd@plt>
test   %rax,%rax
je     1146 <send_cmd+0x26>
mov    %ebx,%edi
mov    $0xe9,%esi
call   1040 <putbyte@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @send_cmd(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = load i8, i8* %4
%7 = call i64 @special_cmd(i32 %5, i8 zeroext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i64 @putbyte(i32 %10, i32 233)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %9, %2
%14 = phi i1 [ false, %2 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @send_cmd(i32 %0, i8 zeroext %1) {
%3 = tail call i64 @special_cmd(i32 %0, i8 zeroext %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @putbyte(i32 %0, i32 233)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int sctp_getPrimary(unsigned int);
int /*<<< orphan*/ stderr;
short SCTP_getPrimary(unsigned int associationID) {
  int result;
  if ((result = sctp_getPrimary(associationID)) < 0) {
    fprintf(stderr, "sctp_setPrimary: error value (%i) returned.\n", result);
    fflush(stderr);
  }
  return result;
}


x86 assembly (clang, -O0):
<SCTP_getPrimary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sctp_getPrimary@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1175 <SCTP_getPrimary+0x45>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SCTP_getPrimary>:
push   %r14
push   %rbx
push   %rax
call   1030 <sctp_getPrimary@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    115f <SCTP_getPrimary+0x2f>
mov    0x2e9a(%rip),%r14
mov    (%r14),%edi
lea    0xeb0(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"sctp_setPrimary: error value (%i) returned.\0A\00"
define signext i16 @SCTP_getPrimary(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sctp_getPrimary(i32 %4)
store i32 %5, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i32, i32* %3
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
br label %13
13: ; preds = %7, %1
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"sctp_setPrimary: error value (%i) returned.\0A\00"
define signext i16 @SCTP_getPrimary(i32 %0) {
%2 = tail call i32 @sctp_getPrimary(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
br label %9
9: ; preds = %4, %1
%10 = trunc i32 %2 to i16
ret i16 %10
}
/* Variables and functions */
int /*<<< orphan*/ DelElmLL(void *);
void *NextElmLL(void *);
void *DelElmNeLL(void *el) {
  void *next = NextElmLL(el);
  DelElmLL(el);
  return (next);
}


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

x86 assembly (clang, -O2):
<DelElmNeLL>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <NextElmLL@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <DelElmLL@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @DelElmNeLL(i8* %0) {
%2 = tail call i8* @NextElmLL(i8* %0)
%3 = tail call i32 @DelElmLL(i8* %0)
ret i8* %2
}
/* Variables and functions */
int gettid();
int /*<<< orphan*/ printf(char *, unsigned int, int);
void *thread1_func(void *arg) {
  printf("Thread 1 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
  return 0;
}


x86 assembly (clang, -O0):
<thread1_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread1_func>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Thread 1 (arg=%d tid=%d) entered.\0A\00"
define i8* @thread1_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 (...) @gettid()
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
ret i8* null
}

LLVM IR (-O2):
@.str = [35 x i8] c"Thread 1 (arg=%d tid=%d) entered.\0A\00"
define noalias i8* @thread1_func(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (...) @gettid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i8* null
}
__attribute__((used)) int _write(int file, char *ptr, int len) { return len; }


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
mov    %edx,%eax
ret

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i8*, i32)* @_write to i8*)], section "llvm.metadata"
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32, i8*, i32)* @_write to i8*)], section "llvm.metadata"
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ core8_swap(char *, int);
void U_EMREXTTEXTOUTW_swap(char *record, int torev) {
  core8_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMREXTTEXTOUTW_swap>:
jmp    1030 <core8_swap@plt>

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

LLVM IR (-O2):
define void @U_EMREXTTEXTOUTW_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core8_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_standard_Laurent_container_to_start_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(777, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_standard_Laurent_container_to_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x309,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_standard_Laurent_container_to_start_system>:
mov    $0x309,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @copy_standard_Laurent_container_to_start_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 777, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_standard_Laurent_container_to_start_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 777, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
unsigned long ROL64(unsigned long word, int i) {
  asm("rolq %%cl,%0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


x86 assembly (clang, -O0):
<ROL64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
rol    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL64>:
mov    %esi,%ecx
mov    %rdi,%rax
rol    %cl,%rax
ret

LLVM IR (-O0):
define i64 @ROL64(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = call i64 asm "rolq %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %5, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @ROL64(i64 %0, i32 %1) {
%3 = tail call i64 asm "rolq %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i32 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
main() {
  short a[] = {1, 4, 6, 8, 10, 12, 14, 16, 18, 20}, *p;
  p = a + 4;
  printf("p = %d\n", *p);
  p++;
  printf("p = %d\n", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
lea    0xec6(%rip),%rdi
movswl (%rax),%esi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
lea    0xea7(%rip),%rdi
movswl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i16] [i16 1, i16 4, i16 6, i16 8, i16 10, i16 12, i16 14, i16 16, i16 18, i16 20]
@.str = [8 x i8] c"p = %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i16]
%2 = alloca i16*
%3 = bitcast [10 x i16]* %1 to i8*
%4 = getelementptr inbounds [10 x i16], [10 x i16]* %1, i64 0, i64 0
%5 = getelementptr inbounds i16, i16* %4, i64 4
store i16* %5, i16** %2
%6 = load i16*, i16** %2
%7 = load i16, i16* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i16 signext %7)
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i32 1
store i16* %10, i16** %2
%11 = load i16*, i16** %2
%12 = load i16, i16* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i16 signext %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"p = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i16 signext 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i16 signext 12)
ret i32 0
}
int test_imm_FBint32_reg(int val) { return ((val) & (0xFB << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_FBint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 251
%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_FBint32_reg(i32 %0) {
%2 = and i32 %0, 251
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void bit_toggle(uint32_t *dword, unsigned int n) { *dword ^= (1 << n); }


x86 assembly (clang, -O0):
<bit_toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_toggle>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bit_toggle(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = xor i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @bit_toggle(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int i_dnnt(double *);
int intr_wrap_397(double p1) { return i_dnnt(&p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_397>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <i_dnnt@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @intr_wrap_397(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @i_dnnt(double* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @intr_wrap_397(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @i_dnnt(double* %2)
ret i32 %3
}
int power2(int x) { return x * x; }


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

x86 assembly (clang, -O2):
<power2>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @power2(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
char *convert(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char *string = "ABC";
  char *result = convert(string, 2);
  printf("result:%s \n", result);
  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)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1030 <convert@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <convert@plt>
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"ABC\00"
@.str.1 = [12 x i8] c"result:%s \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @convert(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
unsigned xrop3_46_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_46_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_46_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
mov    %edx,%eax
xor    $0xff,%eax
or     %ecx,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_46_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_46_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = or i32 %7, %4
%9 = xor i32 %8, %6
ret i32 %9
}
int test_imm_06uint16_mem(unsigned short *val) {
  return ((*val) & (0x06 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_06uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 6
%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_06uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 6
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void clock$clock$fire(void) { counter$clock$fire(); }


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

x86 assembly (clang, -O2):
<clock$clock$fire>:
xor    %eax,%eax
jmp    1030 <counter$clock$fire@plt>

LLVM IR (-O0):
define void @"clock$clock$fire"() {
%1 = call i32 (...) @"counter$clock$fire"()
ret void
}

LLVM IR (-O2):
define void @"clock$clock$fire"() {
%1 = tail call i32 (...) @"counter$clock$fire"()
ret void
}
/* Variables and functions */
void nn_alloc_term(void) {}


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

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

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

LLVM IR (-O2):
define void @nn_alloc_term() {
ret void
}
/* Variables and functions */
int KEY_HOME;
int device_toggle_display(volatile char *key_pressed, int key_code) {
  return key_code == KEY_HOME;
}


x86 assembly (clang, -O0):
<device_toggle_display>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ed3(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_toggle_display>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %esi,(%rcx)
sete   %al
ret

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

LLVM IR (-O2):
@KEY_HOME = global i32 0
define i32 @device_toggle_display(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @KEY_HOME
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
long test_long_7(long a, long b, long c, long d, long e, long f, long g) {
  return a * b * c * d * e * f * g;
}


x86 assembly (clang, -O0):
<test_long_7>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
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),%rax
imul   -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
imul   -0x20(%rbp),%rax
imul   -0x28(%rbp),%rax
imul   -0x30(%rbp),%rax
imul   0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_long_7>:
mov    %r8,%rax
imul   %rsi,%rdi
imul   %rcx,%rdx
imul   %rdi,%rdx
imul   %r9,%rax
imul   %rdx,%rax
imul   0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @test_long_7(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = mul nsw i64 %15, %16
%18 = load i64, i64* %10
%19 = mul nsw i64 %17, %18
%20 = load i64, i64* %11
%21 = mul nsw i64 %19, %20
%22 = load i64, i64* %12
%23 = mul nsw i64 %21, %22
%24 = load i64, i64* %13
%25 = mul nsw i64 %23, %24
%26 = load i64, i64* %14
%27 = mul nsw i64 %25, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @test_long_7(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = mul nsw i64 %1, %0
%9 = mul nsw i64 %8, %2
%10 = mul nsw i64 %9, %3
%11 = mul nsw i64 %10, %4
%12 = mul nsw i64 %11, %5
%13 = mul nsw i64 %12, %6
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void environ__NativeString__setenv(char *self, char *p0) {
  setenv(self, p0, 1);
RET_LABEL:;
}


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

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

LLVM IR (-O0):
define void @environ__NativeString__setenv(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @setenv(i8* %5, i8* %6, i32 1)
br label %8
8: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @environ__NativeString__setenv(i8* %0, i8* %1) {
%3 = tail call i32 @setenv(i8* %0, i8* %1, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ p264_pixel_avg_w8_mmxext(int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int, int);
void p264_pixel_avg_8x16_mmxext(uint8_t *dst, int i_dst, uint8_t *src,
                                int i_src) {
  p264_pixel_avg_w8_mmxext(dst, i_dst, dst, i_dst, src, i_src, 16);
}


x86 assembly (clang, -O0):
<p264_pixel_avg_8x16_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
movl   $0x10,(%rsp)
call   1030 <p264_pixel_avg_w8_mmxext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_pixel_avg_8x16_mmxext>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
movl   $0x10,(%rsp)
mov    %rdi,%rdx
mov    %esi,%ecx
call   1030 <p264_pixel_avg_w8_mmxext@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @p264_pixel_avg_8x16_mmxext(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 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32 @p264_pixel_avg_w8_mmxext(i32* %9, i32 %10, i32* %11, i32 %12, i32* %13, i32 %14, i32 16)
ret void
}

LLVM IR (-O2):
define void @p264_pixel_avg_8x16_mmxext(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @p264_pixel_avg_w8_mmxext(i32* %0, i32 %1, i32* %0, i32 %1, i32* %2, i32 %3, i32 16)
ret void
}
/* Variables and functions */
int SNDCTL_DSP_CHANNELS;
int main(int argc, char *argv[]) {
  int err;
  err = argc;
  err = argv[0][0];
  return err + SNDCTL_DSP_CHANNELS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb1(%rip),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rax
movsbl (%rax),%eax
mov    0x2ed3(%rip),%rcx
add    (%rcx),%eax
ret

LLVM IR (-O0):
@SNDCTL_DSP_CHANNELS = global i32 0
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
store i32 %7, i32* %6
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* @SNDCTL_DSP_CHANNELS
%16 = add nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
@SNDCTL_DSP_CHANNELS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = load i32, i32* @SNDCTL_DSP_CHANNELS
%7 = add nsw i32 %6, %5
ret i32 %7
}
int fun1072() { return 1072; }


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

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

LLVM IR (-O0):
define i32 @fun1072() {
ret i32 1072
}

LLVM IR (-O2):
define i32 @fun1072() {
ret i32 1072
}
/* Variables and functions */
int build_mc_cmd(char *, int const, int, int /*<<< orphan*/, void *,
                 int /*<<< orphan*/, int const);
int /*<<< orphan*/ do_close(int const);
int /*<<< orphan*/ do_cmd(int const, char *, int, int const);
void send_quit_cmd(const int fd, const int id, char *buff,
                   const int buff_size) {
  int len;
  len = build_mc_cmd(buff, buff_size, 0x0008, 0, ((void *)0), 0, id);
  do_cmd(fd, buff, len, id);
  do_close(fd);
}


x86 assembly (clang, -O0):
<send_quit_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%eax
mov    $0x8,%edx
xor    %r9d,%r9d
xor    %ecx,%ecx
mov    %ecx,%r8d
mov    %r9d,%ecx
mov    %eax,(%rsp)
call   1040 <build_mc_cmd@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1030 <do_cmd@plt>
mov    -0x4(%rbp),%edi
call   1050 <do_close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_quit_cmd>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %esi,(%rsp)
mov    %rdx,%rdi
mov    %ecx,%esi
mov    $0x8,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <build_mc_cmd@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %ebp,%ecx
call   1030 <do_cmd@plt>
mov    %r14d,%edi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <do_close@plt>

LLVM IR (-O0):
define void @send_quit_cmd(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = call i32 @build_mc_cmd(i8* %10, i32 %11, i32 8, i32 0, i8* null, i32 0, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %5
%15 = load i8*, i8** %7
%16 = load i32, i32* %9
%17 = load i32, i32* %6
%18 = call i32 @do_cmd(i32 %14, i8* %15, i32 %16, i32 %17)
%19 = load i32, i32* %5
%20 = call i32 @do_close(i32 %19)
ret void
}

LLVM IR (-O2):
define void @send_quit_cmd(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @build_mc_cmd(i8* %2, i32 %3, i32 8, i32 0, i8* null, i32 0, i32 %1)
%6 = tail call i32 @do_cmd(i32 %0, i8* %2, i32 %5, i32 %1)
%7 = tail call i32 @do_close(i32 %0)
ret void
}
/* Variables and functions */
int PAPI_accum(int, long long *);
void PAPIF_ACCUM(int *EventSet, long long *values, int *check) {
  *check = PAPI_accum(*EventSet, values);
}


x86 assembly (clang, -O0):
<PAPIF_ACCUM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <PAPI_accum@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_ACCUM>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_accum@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @PAPIF_ACCUM(i32* %0, i64* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i32*
store i32* %0, i32** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = load i64*, i64** %5
%10 = call i32 @PAPI_accum(i32 %8, i64* %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @PAPIF_ACCUM(i32* nocapture %0, i64* %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = tail call i32 @PAPI_accum(i32 %4, i64* %1)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ execv(char *, char **);
void test_execv(void) {
  char *argv[] = {"true", NULL};
  assert(execv("/foo/bar/test", argv) == 0);
}


x86 assembly (clang, -O0):
<test_execv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <execv@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_execv>:
sub    $0x18,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execv@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@__const.test_execv.argv = [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [14 x i8] c"/foo/bar/test\00"
define void @test_execv() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i64 @execv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@__const.test_execv.argv = [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [14 x i8] c"/foo/bar/test\00"
define void @test_execv() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i64 @execv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d %d\n", b, a);
  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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb5(%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
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old, struct list_head *_new_) {
  list_replace(old, _new_);
  INIT_LIST_HEAD(old);
}


x86 assembly (clang, -O0):
<list_replace_init>:
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   1040 <list_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hello World"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};

/* Variables and functions */
void *malloc(int);
void *idrnet_create_sockaddr() {
  return malloc(sizeof(struct sockaddr_storage));
}


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

x86 assembly (clang, -O2):
<idrnet_create_sockaddr>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @idrnet_create_sockaddr() {
%1 = call i8* @malloc(i32 4)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @idrnet_create_sockaddr() {
%1 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
ret i8* %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rtpx_set_length(uint8_t *p_rtpx, uint16_t i_length) {
  p_rtpx[2] = (i_length >> 8) & 0xff;
  p_rtpx[3] = i_length & 0xff;
}


x86 assembly (clang, -O0):
<rtpx_set_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtpx_set_length>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x8(%rdi)
movzbl %al,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @rtpx_set_length(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @rtpx_set_length(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %4, i32* %5
%6 = and i32 %1, 255
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %6, i32* %7
ret void
}
int getbaudval(int cbaud) { return cbaud; }


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

x86 assembly (clang, -O2):
<getbaudval>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getbaudval(i32 returned %0) {
ret i32 %0
}
unsigned long long _lo(double src) {
  unsigned long long v;
  *(double *)&v = src;
  return v;
}


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

x86 assembly (clang, -O2):
<_lo>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @_lo(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast i64* %3 to double*
store double %4, double* %5
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @_lo(double %0) {
%2 = bitcast double %0 to i64
ret i64 %2
}