xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Find_Path();
int /*<<< orphan*/ Init();
int /*<<< orphan*/ Manhattan(int);
int /*<<< orphan*/ Print_Field();
int main() {
  Init();
  Manhattan(1);
  Find_Path();
  Print_Field();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <Init@plt>
mov    $0x1,%edi
call   1040 <Manhattan@plt>
mov    $0x0,%al
call   1030 <Find_Path@plt>
mov    $0x0,%al
call   1050 <Print_Field@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <Init@plt>
mov    $0x1,%edi
call   1040 <Manhattan@plt>
xor    %eax,%eax
call   1030 <Find_Path@plt>
xor    %eax,%eax
call   1050 <Print_Field@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @Init()
%2 = call i32 @Manhattan(i32 1)
%3 = call i32 (...) @Find_Path()
%4 = call i32 (...) @Print_Field()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Init()
%2 = tail call i32 @Manhattan(i32 1)
%3 = tail call i32 (...) @Find_Path()
%4 = tail call i32 (...) @Print_Field()
ret i32 0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int socklen_t;
typedef int /*<<< orphan*/ dest_addr;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ sendto(int, void const *, size_t, int, struct sockaddr *,
                          int);
ssize_t test(void) {
  int sockfd = 4;
  int buffer;
  const void *buf = &buffer;
  size_t len = sizeof(buffer);
  int flags = 7;
  struct sockaddr dest_addr;
  socklen_t addrlen = sizeof(dest_addr);
  return sendto(sockfd, buf, len, flags, &dest_addr, addrlen);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x4,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x4,-0x18(%rbp)
movl   $0x7,-0x1c(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x24(%rbp),%r9d
lea    -0x20(%rbp),%r8
call   1030 <sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rsi
mov    %rsp,%r8
mov    $0x4,%edx
mov    $0x4,%edi
mov    $0x7,%ecx
mov    $0x4,%r9d
call   1030 <sendto@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca %struct.sockaddr
%7 = alloca i32
store i32 4, i32* %1
%8 = bitcast i32* %2 to i8*
store i8* %8, i8** %3
store i64 4, i64* %4
store i32 7, i32* %5
store i32 4, i32* %7
%9 = load i32, i32* %1
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = call i32 @sendto(i32 %9, i8* %10, i64 %11, i32 %12, %struct.sockaddr* %6, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @test() {
%1 = alloca i32
%2 = alloca %struct.sockaddr
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.sockaddr* %2 to i8*
%5 = call i32 @sendto(i32 4, i8* %3, i64 4, i32 7, %struct.sockaddr* %2, i32 4)
ret i32 %5
}
int KAPI_GetAPIVersion_MAJOR() { return 4; }


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

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

LLVM IR (-O0):
define i32 @KAPI_GetAPIVersion_MAJOR() {
ret i32 4
}

LLVM IR (-O2):
define i32 @KAPI_GetAPIVersion_MAJOR() {
ret i32 4
}
int do_811() { return 811; }


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

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

LLVM IR (-O0):
define i32 @do_811() {
ret i32 811
}

LLVM IR (-O2):
define i32 @do_811() {
ret i32 811
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main(int argc, char **argv) {
  char s1[] = "This is a \"quoted string\" right here";
  char s2[] = "This is a normal string";
  test(s1);
  test(s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x25,%edx
call   1030 <memcpy@plt>
mov    0xede(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    -0x40(%rbp),%rdi
call   1040 <test@plt>
lea    -0x60(%rbp),%rdi
call   1040 <test@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movabs $0x65726568207468,%rax
mov    %rax,0x3d(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x676e6972747320,%rax
mov    %rax,0x10(%rsp)
lea    0x20(%rsp),%rdi
call   1030 <test@plt>
mov    %rsp,%rdi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [37 x i8] c"This is a \22quoted string\22 right here\00"
@__const.main.s2 = [24 x i8] c"This is a normal string\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [37 x i8]
%7 = alloca [24 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [37 x i8]* %6 to i8*
%9 = bitcast [24 x i8]* %7 to i8*
%10 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 0
%11 = call i32 @test(i8* %10)
%12 = getelementptr inbounds [24 x i8], [24 x i8]* %7, i64 0, i64 0
%13 = call i32 @test(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [37 x i8] c"This is a \22quoted string\22 right here\00"
@__const.main.s2 = [24 x i8] c"This is a normal string\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [37 x i8]
%4 = alloca [24 x i8]
%5 = getelementptr inbounds [37 x i8], [37 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%7 = call i32 @test(i8* %5)
%8 = call i32 @test(i8* %6)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int cichlid_rotate_right_32(int, int);
uint32_t sigma0(uint32_t x) {
  return cichlid_rotate_right_32(x, 7) ^ cichlid_rotate_right_32(x, 18) ^
         (x >> 3);
}


x86 assembly (clang, -O0):
<sigma0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x7,%esi
call   1030 <cichlid_rotate_right_32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x12,%esi
call   1030 <cichlid_rotate_right_32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigma0>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x7,%esi
call   1030 <cichlid_rotate_right_32@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x12,%esi
call   1030 <cichlid_rotate_right_32@plt>
sar    $0x3,%ebx
xor    %ebp,%ebx
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sigma0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cichlid_rotate_right_32(i32 %3, i32 7)
%5 = load i32, i32* %2
%6 = call i32 @cichlid_rotate_right_32(i32 %5, i32 18)
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 3
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sigma0(i32 %0) {
%2 = tail call i32 @cichlid_rotate_right_32(i32 %0, i32 7)
%3 = tail call i32 @cichlid_rotate_right_32(i32 %0, i32 18)
%4 = ashr i32 %0, 3
%5 = xor i32 %2, %4
%6 = xor i32 %5, %3
ret i32 %6
}
__attribute__((always_)) void
timer_stats_timer_clear_start_info(struct timer_list *timer) {}


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

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

LLVM IR (-O0):
%struct.timer_list = type opaque
define void @timer_stats_timer_clear_start_info(%struct.timer_list* %0) {
%2 = alloca %struct.timer_list*
store %struct.timer_list* %0, %struct.timer_list** %2
ret void
}

LLVM IR (-O2):
%struct.timer_list = type opaque
define void @timer_stats_timer_clear_start_info(%struct.timer_list* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int f(long long);
main() {
  if (f(10000000000LL) != 1 || f(100000000000LL) != 10)
    _exit(-1);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x2540be400,%rdi
call   1040 <f@plt>
cmp    $0x1,%eax
jne    115f <main+0x3f>
movabs $0x174876e800,%rdi
call   1040 <f@plt>
cmp    $0xa,%eax
je     1169 <main+0x49>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x2540be400,%rdi
call   1040 <f@plt>
cmp    $0x1,%eax
jne    1150 <main+0x30>
movabs $0x174876e800,%rdi
call   1040 <f@plt>
cmp    $0xa,%eax
jne    1150 <main+0x30>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i64 10000000000)
%3 = icmp ne i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i32 @f(i64 100000000000)
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call i32 @_exit(i32 -1)
unreachable
9: ; preds = %4
%10 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i64 10000000000)
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @f(i64 100000000000)
%5 = icmp eq i32 %4, 10
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 @_exit(i32 -1)
unreachable
8: ; preds = %3
%9 = tail call i32 @_exit(i32 0)
unreachable
}
/* Type definitions */
struct yaffs_stat {
  int dummy;
};
struct yaffs_obj {
  int dummy;
};

/* Variables and functions */
int yaffsfs_DoStatOrLStat_reldir(struct yaffs_obj *, char const *,
                                 struct yaffs_stat *, int);
int yaffs_lstat_reldir(struct yaffs_obj *reldir, const char *path,
                       struct yaffs_stat *buf) {
  return yaffsfs_DoStatOrLStat_reldir(reldir, path, buf, 1);
}


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

x86 assembly (clang, -O2):
<yaffs_lstat_reldir>:
mov    $0x1,%ecx
jmp    1030 <yaffsfs_DoStatOrLStat_reldir@plt>

LLVM IR (-O0):
%struct.yaffs_obj = type { i32 }
%struct.yaffs_stat = type { i32 }
define i32 @yaffs_lstat_reldir(%struct.yaffs_obj* %0, i8* %1, %struct.yaffs_stat* %2) {
%4 = alloca %struct.yaffs_obj*
%5 = alloca i8*
%6 = alloca %struct.yaffs_stat*
store %struct.yaffs_obj* %0, %struct.yaffs_obj** %4
store i8* %1, i8** %5
store %struct.yaffs_stat* %2, %struct.yaffs_stat** %6
%7 = load %struct.yaffs_obj*, %struct.yaffs_obj** %4
%8 = load i8*, i8** %5
%9 = load %struct.yaffs_stat*, %struct.yaffs_stat** %6
%10 = call i32 @yaffsfs_DoStatOrLStat_reldir(%struct.yaffs_obj* %7, i8* %8, %struct.yaffs_stat* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.yaffs_obj = type { i32 }
%struct.yaffs_stat = type { i32 }
define i32 @yaffs_lstat_reldir(%struct.yaffs_obj* %0, i8* %1, %struct.yaffs_stat* %2) {
%4 = tail call i32 @yaffsfs_DoStatOrLStat_reldir(%struct.yaffs_obj* %0, i8* %1, %struct.yaffs_stat* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int getchar();
scalar_t__ kb_hit();
int kb_getch() {
  int c = 0;
  if (kb_hit()) {
    c = getchar();
  }
  return (c);
}


x86 assembly (clang, -O0):
<kb_getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <kb_hit@plt>
cmp    $0x0,%rax
je     114a <kb_getch+0x2a>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_getch>:
push   %rax
xor    %eax,%eax
call   1040 <kb_hit@plt>
test   %rax,%rax
je     1135 <kb_getch+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @kb_getch() {
%1 = tail call i64 (...) @kb_hit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @getchar()
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
char *spaces(int length) {
  static char buf[200];
  int i;
  for (i = 0; i < length; i++)
    buf[i] = ' ';
  buf[i] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1137 <spaces+0x37>
movslq -0x8(%rbp),%rcx
lea    0x2f0b(%rip),%rax
movb   $0x20,(%rax,%rcx,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <spaces+0xe>
movslq -0x8(%rbp),%rcx
lea    0x2eee(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ee3(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaces>:
push   %rbx
test   %edi,%edi
jle    112d <spaces+0x1d>
mov    %edi,%ebx
lea    0x2f22(%rip),%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    112f <spaces+0x1f>
xor    %ebx,%ebx
lea    0x2f0a(%rip),%rax
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@spaces.buf = internal global [200 x i8] zeroinitializer
define i8* @spaces(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [200 x i8], [200 x i8]* @spaces.buf, i64 0, i64 %10
store i8 32, i8* %11
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [200 x i8], [200 x i8]* @spaces.buf, i64 0, i64 %17
store i8 0, i8* %18
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @spaces.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@spaces.buf = internal global [200 x i8] zeroinitializer
define i8* @spaces(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %3, %1
%7 = phi i64 [ 0, %1 ], [ %5, %3 ]
%8 = getelementptr inbounds [200 x i8], [200 x i8]* @spaces.buf, i64 0, i64 %7
store i8 0, i8* %8
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @spaces.buf, i64 0, i64 0)
}
void PinUnlock() {
  if (((*((volatile unsigned long *)(0x00000400))) & 0xFFFF) >= 2) {
    (*((volatile unsigned long *)(0x4402E000 + 0x0000016C))) &= ~(3 << 24);
  }
}


x86 assembly (clang, -O0):
<PinUnlock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%eax
mov    (%rax),%rax
and    $0xffff,%rax
cmp    $0x2,%rax
jb     1133 <PinUnlock+0x33>
mov    $0x4402e16c,%eax
mov    (%rax),%rcx
and    $0xfffffffffcffffff,%rcx
mov    $0x4402e16c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PinUnlock>:
testq  $0xfffe,0x400
je     111a <PinUnlock+0x1a>
andq   $0xfffffffffcffffff,0x4402e16c
44 ff ff ff fc
ret

LLVM IR (-O0):
define void @PinUnlock() {
%1 = load volatile i64, i64* inttoptr (i64 1024 to i64*)
%2 = and i64 %1, 65535
%3 = icmp uge i64 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load volatile i64, i64* inttoptr (i64 1141039468 to i64*)
%6 = and i64 %5, -50331649
store volatile i64 %6, i64* inttoptr (i64 1141039468 to i64*)
br label %7
7: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @PinUnlock() {
%1 = load volatile i64, i64* inttoptr (i64 1024 to i64*)
%2 = and i64 %1, 65534
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load volatile i64, i64* inttoptr (i64 1141039468 to i64*)
%6 = and i64 %5, -50331649
store volatile i64 %6, i64* inttoptr (i64 1141039468 to i64*)
br label %7
7: ; preds = %4, %0
ret void
}
void wifi_rsp_system_sync(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @wifi_rsp_system_sync(i8* nocapture %0) {
ret void
}
unsigned short blend_half16(unsigned short color1, unsigned short color2) {
  return (((((color1 >> 11) + (color2 >> 11)) >> 1) << 11) |
          (((((color1 & 0x7E0) >> 5) + ((color2 & 0x7E0) >> 5)) >> 1) << 5) |
          ((color1 & 0x1F) + (color2 & 0x1F)) >> 1);
}


x86 assembly (clang, -O0):
<blend_half16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0xb,%eax
movzwl -0x4(%rbp),%ecx
sar    $0xb,%ecx
add    %ecx,%eax
sar    $0x1,%eax
shl    $0xb,%eax
movzwl -0x2(%rbp),%ecx
and    $0x7e0,%ecx
sar    $0x5,%ecx
movzwl -0x4(%rbp),%edx
and    $0x7e0,%edx
sar    $0x5,%edx
add    %edx,%ecx
sar    $0x1,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzwl -0x2(%rbp),%ecx
and    $0x1f,%ecx
movzwl -0x4(%rbp),%edx
and    $0x1f,%edx
add    %edx,%ecx
sar    $0x1,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_half16>:
mov    %edi,%eax
shr    $0xb,%eax
mov    %esi,%ecx
shr    $0xb,%ecx
add    %eax,%ecx
shl    $0xa,%ecx
and    $0xfc00f800,%ecx
mov    %edi,%eax
shr    $0x5,%eax
and    $0x3f,%eax
mov    %esi,%edx
shr    $0x5,%edx
and    $0x3f,%edx
add    %eax,%edx
shl    $0x4,%edx
and    $0xffffffe0,%edx
and    $0x1f,%edi
and    $0x1f,%esi
lea    (%rsi,%rdi,1),%eax
shr    %eax
or     %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @blend_half16(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 11
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 11
%11 = add nsw i32 %7, %10
%12 = ashr i32 %11, 1
%13 = shl i32 %12, 11
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = and i32 %15, 2016
%17 = ashr i32 %16, 5
%18 = load i16, i16* %4
%19 = zext i16 %18 to i32
%20 = and i32 %19, 2016
%21 = ashr i32 %20, 5
%22 = add nsw i32 %17, %21
%23 = ashr i32 %22, 1
%24 = shl i32 %23, 5
%25 = or i32 %13, %24
%26 = load i16, i16* %3
%27 = zext i16 %26 to i32
%28 = and i32 %27, 31
%29 = load i16, i16* %4
%30 = zext i16 %29 to i32
%31 = and i32 %30, 31
%32 = add nsw i32 %28, %31
%33 = ashr i32 %32, 1
%34 = or i32 %25, %33
%35 = trunc i32 %34 to i16
ret i16 %35
}

LLVM IR (-O2):
define zeroext i16 @blend_half16(i16 zeroext %0, i16 zeroext %1) {
%3 = lshr i16 %0, 11
%4 = lshr i16 %1, 11
%5 = add nuw nsw i16 %4, %3
%6 = shl nuw i16 %5, 10
%7 = and i16 %6, -2048
%8 = lshr i16 %0, 5
%9 = and i16 %8, 63
%10 = lshr i16 %1, 5
%11 = and i16 %10, 63
%12 = add nuw nsw i16 %11, %9
%13 = shl nuw nsw i16 %12, 4
%14 = and i16 %13, 2016
%15 = and i16 %0, 31
%16 = and i16 %1, 31
%17 = add nuw nsw i16 %16, %15
%18 = lshr i16 %17, 1
%19 = or i16 %7, %18
%20 = or i16 %19, %14
ret i16 %20
}
/* Variables and functions */
scalar_t__ write(int, char *, int);
void clear_display() {
  if (write(1, "\033[2J", 4))
    do {
    } while (0);
}


x86 assembly (clang, -O0):
<clear_display>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
je     1143 <clear_display+0x33>
jmp    1139 <clear_display+0x29>
jmp    113e <clear_display+0x2e>
jmp    1143 <clear_display+0x33>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_display>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
define void @clear_display() {
%1 = call i64 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
define void @clear_display() {
%1 = tail call i64 @write(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int test(int argc, char **argv) {
  printf("test %d %s\n", argc, argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    %edi,%eax
mov    (%rsi),%rdx
lea    0xee3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"test %d %s\0A\00"
define i32 @test(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
ret i32 0
}
int correction(char version[]) { return version[1]; }


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

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

LLVM IR (-O0):
define i32 @correction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @correction(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
uid_t getuid(void) { return __syscall(199); }


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

x86 assembly (clang, -O2):
<getuid>:
mov    $0xc7,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @getuid() {
%1 = call i32 @__syscall(i32 199)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getuid() {
%1 = tail call i32 @__syscall(i32 199)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *mpgdecoder_open(void *, int, int);
FILE *default_mpgdecoder_open(void *ctx, int sample_rate, int stereo) {
  return mpgdecoder_open(ctx, sample_rate, stereo);
}


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

x86 assembly (clang, -O2):
<default_mpgdecoder_open>:
jmp    1030 <mpgdecoder_open@plt>

LLVM IR (-O0):
define i32* @default_mpgdecoder_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32* @mpgdecoder_open(i8* %7, i32 %8, i32 %9)
ret i32* %10
}

LLVM IR (-O2):
define i32* @default_mpgdecoder_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32* @mpgdecoder_open(i8* %0, i32 %1, i32 %2)
ret i32* %4
}
void security_ip_fragment(struct sk_buff *newskb,
                          const struct sk_buff *oldskb) {}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define void @security_ip_fragment(%struct.sk_buff* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.sk_buff*
%4 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define void @security_ip_fragment(%struct.sk_buff* nocapture %0, %struct.sk_buff* nocapture %1) {
ret void
}
int in_set(int ones, int x) {
  while (x > 0) {
    int q = x / 3;
    int r = x - q * 3;
    if (r == 1 && (ones & 1))
      return 0;
    ones = ones >> 1;
    x = q;
  }
  return 1;
}


x86 assembly (clang, -O0):
<in_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1167 <in_set+0x67>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   $0x3,-0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1153 <in_set+0x53>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1153 <in_set+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116e <in_set+0x6e>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110a <in_set+0xa>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_set>:
mov    $0xaaaaaaab,%eax
cs nopw 0x0(%rax,%rax,1)
nop
test   %esi,%esi
jle    113a <in_set+0x3a>
mov    %edi,%ecx
mov    %esi,%edx
imul   %rax,%rdx
shr    $0x21,%rdx
lea    (%rdx,%rdx,2),%edi
sub    %edi,%esi
mov    %ecx,%edi
sar    %edi
cmp    $0x1,%esi
mov    %edx,%esi
jne    1110 <in_set+0x10>
mov    %edx,%esi
and    $0x1,%ecx
je     1110 <in_set+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @in_set(i32 %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %1, %2 ], [ %8, %7 ]
%5 = phi i32 [ %0, %2 ], [ %15, %7 ]
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = udiv i32 %4, 3
%9 = mul nsw i32 %8, -3
%10 = add nsw i32 %9, %4
%11 = icmp ne i32 %10, 1
%12 = and i32 %5, 1
%13 = icmp eq i32 %12, 0
%14 = select i1 %11, i1 true, i1 %13
%15 = ashr i32 %5, 1
br i1 %14, label %3, label %16
16: ; preds = %7, %3
%17 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %17
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int _utimes(const char *filename, const struct timeval times[2]) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<_utimes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @_utimes(i8* %0, %struct.timeval* %1) {
%3 = alloca i8*
%4 = alloca %struct.timeval*
store i8* %0, i8** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @_utimes(i8* nocapture readnone %0, %struct.timeval* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

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


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

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

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define i32 @config_check_prefix_align_more(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @utf8_strlen_screen(i8* %2)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(const void *src, size_t len) {
  void *dst = malloc(len);
  if (dst)
    memcpy(dst, src, len);
  return dst;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <memdup+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t l2cap_event_channel_closed_get_local_cid(const uint8_t *event) {
  return little_endian_read_16(event, 2);
}


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

x86 assembly (clang, -O2):
<l2cap_event_channel_closed_get_local_cid>:
mov    $0x2,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @l2cap_event_channel_closed_get_local_cid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void Done(void) {
  printf("Got it!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<Done>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Done>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Got it!\0A\00"
define void @Done() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Got it!\00"
define void @Done() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int max(int x, int y) {
  if (x > y) {
    return x;
  }
  return y;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void print_timing(size_t pos, unsigned long timing, void *data) {
  printf("%lu ", timing);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu \00"
define void @print_timing(i64 %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
ret void
}
/* Variables and functions */
scalar_t__ matchalpha(char);
scalar_t__ matchdigit(char);
int matchalphanum(char c) {
  return ((c == '_') || matchalpha(c) || matchdigit(c));
}


x86 assembly (clang, -O0):
<matchalphanum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     116e <matchalphanum+0x4e>
movsbl -0x1(%rbp),%edi
call   1040 <matchalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    116e <matchalphanum+0x4e>
movsbl -0x1(%rbp),%edi
call   1030 <matchdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchalphanum>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
cmp    $0x5f,%dil
je     114d <matchalphanum+0x2d>
movsbl %dil,%ebp
mov    %ebp,%edi
call   1040 <matchalpha@plt>
test   %rax,%rax
jne    114d <matchalphanum+0x2d>
mov    %ebp,%edi
call   1030 <matchdigit@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @matchalphanum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 95
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @matchalpha(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = call i64 @matchdigit(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @matchalphanum(i8 signext %0) {
%2 = icmp eq i8 %0, 95
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @matchalpha(i8 signext %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @matchdigit(i8 signext %0)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 1, %3 ], [ 1, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int const uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t getBit(const uint32_t *array, uint32_t bitNumber) {
  return (array[bitNumber / 32] >> (32 - 1 - (bitNumber % 32))) & 0x01;
}


x86 assembly (clang, -O0):
<getBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    $0x1f,%ecx
sub    %edx,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit>:
lea    0x1f(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %ecx,%eax
sar    $0x5,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0xffffffe0,%ecx
sub    %ecx,%esi
mov    $0x1f,%cl
sub    %sil,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getBit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 32
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 32
%13 = sub nsw i32 31, %12
%14 = ashr i32 %10, %13
%15 = and i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @getBit(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 32
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = srem i32 %1, 32
%8 = sub nsw i32 31, %7
%9 = lshr i32 %6, %8
%10 = and i32 %9, 1
ret i32 %10
}
unsigned xrop3_96_0_1(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;
  stk2 = D ^ S;
  stk1 = T & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_96_0_1>:
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    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_96_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
and    %eax,%ecx
and    $0xff00,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_96_0_1(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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = and i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_96_0_1(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 = and i32 %4, 65280
%8 = and i32 %7, %6
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EV_REL;
int /*<<< orphan*/ EV_SYN;
int /*<<< orphan*/ REL_X;
int /*<<< orphan*/ REL_Y;
int /*<<< orphan*/ SYN_REPORT;
int /*<<< orphan*/ input_event(int /*<<< orphan*/, int /*<<< orphan*/, int);
void send_a_motion(int x, int y) {
  input_event(EV_REL, REL_X, x);
  input_event(EV_REL, REL_Y, y);
  input_event(EV_SYN, SYN_REPORT, 0);
}


x86 assembly (clang, -O0):
<send_a_motion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
call   1030 <input_event@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <input_event@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <input_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_a_motion>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%edx
mov    0x2eb9(%rip),%r14
mov    (%r14),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
call   1030 <input_event@plt>
mov    (%r14),%edi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edx
call   1030 <input_event@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <input_event@plt>

LLVM IR (-O0):
@EV_REL = global i32 0
@REL_X = global i32 0
@REL_Y = global i32 0
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define void @send_a_motion(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EV_REL
%6 = load i32, i32* @REL_X
%7 = load i32, i32* %3
%8 = call i32 @input_event(i32 %5, i32 %6, i32 %7)
%9 = load i32, i32* @EV_REL
%10 = load i32, i32* @REL_Y
%11 = load i32, i32* %4
%12 = call i32 @input_event(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* @EV_SYN
%14 = load i32, i32* @SYN_REPORT
%15 = call i32 @input_event(i32 %13, i32 %14, i32 0)
ret void
}

LLVM IR (-O2):
@EV_REL = global i32 0
@REL_X = global i32 0
@REL_Y = global i32 0
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define void @send_a_motion(i32 %0, i32 %1) {
%3 = load i32, i32* @EV_REL
%4 = load i32, i32* @REL_X
%5 = tail call i32 @input_event(i32 %3, i32 %4, i32 %0)
%6 = load i32, i32* @EV_REL
%7 = load i32, i32* @REL_Y
%8 = tail call i32 @input_event(i32 %6, i32 %7, i32 %1)
%9 = load i32, i32* @EV_SYN
%10 = load i32, i32* @SYN_REPORT
%11 = tail call i32 @input_event(i32 %9, i32 %10, i32 0)
ret void
}
void sigidie(n) { sig_die("IOT Trap", 1); }


x86 assembly (clang, -O0):
<sigidie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <sig_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigidie>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <sig_die@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"IOT Trap\00"
define void @sigidie(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @sig_die to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"IOT Trap\00"
define void @sigidie(i32 %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @sig_die to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
void v3f(vec) float vec[3];
{ vcall(vec, 3); }


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

x86 assembly (clang, -O2):
<v3f>:
mov    $0x3,%esi
xor    %eax,%eax
jmp    1030 <vcall@plt>

LLVM IR (-O0):
define void @v3f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %3, i32 3)
ret void
}

LLVM IR (-O2):
define void @v3f(float* %0) {
%2 = tail call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %0, i32 3)
ret void
}
double dbl_neg_mul_add(double a, double b, double c) { return (-(a * b)) + c; }


x86 assembly (clang, -O0):
<dbl_neg_mul_add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_neg_mul_add>:
mulsd  %xmm1,%xmm0
subsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dbl_neg_mul_add(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fmul double %7, %8
%10 = fneg double %9
%11 = load double, double* %6
%12 = fadd double %10, %11
ret double %12
}

LLVM IR (-O2):
define double @dbl_neg_mul_add(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fsub double %2, %4
ret double %5
}