xunge/DecIR huggingface dataset:
char rotateR_fun_char(char x, int i) {
  if ((i %= 8) == 0)
    return x;
  return (x << (8 - i)) | ((0x7f >> (i - 1)) & (x >> i));
}


x86 assembly (clang, -O0):
<rotateR_fun_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmp    $0x0,%edx
jne    112f <rotateR_fun_char+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1160 <rotateR_fun_char+0x60>
movsbl -0x2(%rbp),%eax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x7f,%edx
sar    %cl,%edx
mov    %edx,-0xc(%rbp)
movsbl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    -0xc(%rbp),%ecx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateR_fun_char>:
mov    %edi,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%esi
je     112f <rotateR_fun_char+0x2f>
movsbl %al,%eax
mov    $0x8,%cl
sub    %sil,%cl
mov    %eax,%edx
shl    %cl,%edx
lea    -0x1(%rsi),%ecx
mov    $0x7f,%edi
shr    %cl,%edi
mov    %esi,%ecx
sar    %cl,%eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @rotateR_fun_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 8
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i8, i8* %4
store i8 %10, i8* %3
br label %27
11: ; preds = %2
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = load i32, i32* %5
%15 = sub nsw i32 8, %14
%16 = shl i32 %13, %15
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 1
%19 = ashr i32 127, %18
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = load i32, i32* %5
%23 = ashr i32 %21, %22
%24 = and i32 %19, %23
%25 = or i32 %16, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %3
br label %27
27: ; preds = %11, %9
%28 = load i8, i8* %3
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @rotateR_fun_char(i8 signext %0, i32 %1) {
%3 = srem i32 %1, 8
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = sext i8 %0 to i32
%7 = sub nsw i32 8, %3
%8 = shl nsw i32 %6, %7
%9 = add nsw i32 %3, -1
%10 = lshr i32 127, %9
%11 = ashr i32 %6, %3
%12 = and i32 %10, %11
%13 = or i32 %12, %8
%14 = trunc i32 %13 to i8
br label %15
15: ; preds = %2, %5
%16 = phi i8 [ %14, %5 ], [ %0, %2 ]
ret i8 %16
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void uint32Clear(uint32_t *data) { *data = 0; }


x86 assembly (clang, -O0):
<uint32Clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32Clear>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @uint32Clear(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t entry(void *arg) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @entry(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t uint_32_le(const uint8_t *const p) {
  return (((int)p[0] & 0xff) | (((int)p[1] & 0xff) << 8) |
          (((int)p[2] & 0xff) << 16) | (((int)p[3] & 0xff) << 24));
}


x86 assembly (clang, -O0):
<uint_32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_32_le>:
movzbl (%rdi),%eax
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
movzwl %cx,%ecx
or     %eax,%ecx
movzbl %dl,%edx
shl    $0x10,%edx
or     %ecx,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @uint_32_le(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 255
%8 = load i64*, i64** %2
%9 = getelementptr inbounds i64, i64* %8, i64 1
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i64*, i64** %2
%16 = getelementptr inbounds i64, i64* %15, i64 2
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 3
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = and i32 %25, 255
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @uint_32_le(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 255
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = and i32 %8, 65280
%10 = or i32 %9, %4
%11 = getelementptr inbounds i64, i64* %0, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = and i32 %14, 16711680
%16 = or i32 %10, %15
%17 = getelementptr inbounds i64, i64* %0, i64 3
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 24
%21 = or i32 %16, %20
ret i32 %21
}
/* Type definitions */
struct ts_value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ts_value *);
int /*<<< orphan*/ ts_destroy_value(struct ts_value *);
void ts_free_value(struct ts_value *tsv) {
  ts_destroy_value(tsv);
  free(tsv);
}


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

x86 assembly (clang, -O2):
<ts_free_value>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ts_destroy_value@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ts_value = type { i32 }
define void @ts_free_value(%struct.ts_value* %0) {
%2 = alloca %struct.ts_value*
store %struct.ts_value* %0, %struct.ts_value** %2
%3 = load %struct.ts_value*, %struct.ts_value** %2
%4 = call i32 @ts_destroy_value(%struct.ts_value* %3)
%5 = load %struct.ts_value*, %struct.ts_value** %2
%6 = call i32 @free(%struct.ts_value* %5)
ret void
}

LLVM IR (-O2):
%struct.ts_value = type { i32 }
define void @ts_free_value(%struct.ts_value* %0) {
%2 = tail call i32 @ts_destroy_value(%struct.ts_value* %0)
%3 = tail call i32 @free(%struct.ts_value* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int CED_GetChar(int fh) { return ioctl(fh, _IO(0xce, 4)); }


x86 assembly (clang, -O0):
<CED_GetChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xce,%edi
mov    $0x4,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CED_GetChar>:
push   %rbx
mov    %edi,%ebx
mov    $0xce,%edi
mov    $0x4,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @CED_GetChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 206, i32 4)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @CED_GetChar(i32 %0) {
%2 = tail call i32 @_IO(i32 206, i32 4)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sol_http_client_shutdown();
int /*<<< orphan*/ sol_http_server_shutdown();
int /*<<< orphan*/ sol_network_shutdown();
void sol_comms_shutdown(void) {
  sol_http_client_shutdown();
  sol_http_server_shutdown();
  sol_network_shutdown();
}


x86 assembly (clang, -O0):
<sol_comms_shutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sol_http_client_shutdown@plt>
mov    $0x0,%al
call   1030 <sol_http_server_shutdown@plt>
mov    $0x0,%al
call   1040 <sol_network_shutdown@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sol_comms_shutdown>:
push   %rax
xor    %eax,%eax
call   1050 <sol_http_client_shutdown@plt>
xor    %eax,%eax
call   1030 <sol_http_server_shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sol_network_shutdown@plt>

LLVM IR (-O0):
define void @sol_comms_shutdown() {
%1 = call i32 (...) @sol_http_client_shutdown()
%2 = call i32 (...) @sol_http_server_shutdown()
%3 = call i32 (...) @sol_network_shutdown()
ret void
}

LLVM IR (-O2):
define void @sol_comms_shutdown() {
%1 = tail call i32 (...) @sol_http_client_shutdown()
%2 = tail call i32 (...) @sol_http_server_shutdown()
%3 = tail call i32 (...) @sol_network_shutdown()
ret void
}
char const *rcs_id_findroot_c() {
  static char const rcsid[] =
      "$Id: findroot.c 393 2015-10-05 14:02:11Z kny48981 $";
  return (rcsid);
}


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

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

LLVM IR (-O0):
@rcs_id_findroot_c.rcsid = internal constant [52 x i8] c"$Id: findroot.c 393 2015-10-05 14:02:11Z kny48981 $\00"
define i8* @rcs_id_findroot_c() {
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @rcs_id_findroot_c.rcsid, i64 0, i64 0)
}

LLVM IR (-O2):
@rcs_id_findroot_c.rcsid = internal constant [52 x i8] c"$Id: findroot.c 393 2015-10-05 14:02:11Z kny48981 $\00"
define i8* @rcs_id_findroot_c() {
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @rcs_id_findroot_c.rcsid, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
void nextline(FILE *config_fp) {
  int c = getc(config_fp);
  while (c != '\n' && c != EOF)
    c = getc(config_fp);
}


x86 assembly (clang, -O0):
<nextline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0xa,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1149 <nextline+0x39>
mov    -0xc(%rbp),%eax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <nextline+0x49>
jmp    116a <nextline+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
jmp    1128 <nextline+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
cmp    $0xa,%eax
je     1142 <nextline+0x32>
mov    0x2ec0(%rip),%r14
nopl   0x0(%rax,%rax,1)
cmp    (%r14),%eax
je     1142 <nextline+0x32>
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0xa,%eax
jne    1130 <nextline+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @nextline(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %15, %1
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ false, %6 ], [ %12, %9 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32*, i32** %2
%17 = call i32 @getc(i32* %16)
store i32 %17, i32* %3
br label %6
18: ; preds = %13
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @nextline(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = icmp ne i32 %2, 10
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = tail call i32 @getc(i32* %0)
%9 = icmp ne i32 %8, 10
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %8, %10
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
/* Variables and functions */
long posixtime(char *);
long dt_posix_date(char *date) { return posixtime(date); }


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

x86 assembly (clang, -O2):
<dt_posix_date>:
jmp    1030 <posixtime@plt>

LLVM IR (-O0):
define i64 @dt_posix_date(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @posixtime(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @dt_posix_date(i8* %0) {
%2 = tail call i64 @posixtime(i8* %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void xexit(int rc) {
  if (rc != 0)
    printf("!%ld\n", rc);
  exit(rc);
}


x86 assembly (clang, -O0):
<xexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <xexit+0x24>
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<xexit>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
je     1135 <xexit+0x15>
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"!%ld\0A\00"
define void @xexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"!%ld\0A\00"
define void @xexit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int is_excess_seq(char *expect_buf_idx __attribute__((unused)),
                  char *expect_buf_end __attribute__((unused)),
                  char *actual_buf_idx __attribute__((unused)),
                  char *actual_buf_end __attribute__((unused)),
                  size_t *missing_len __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<is_excess_seq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_excess_seq(i8* %0, i8* %1, i8* %2, i8* %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i64* %4, i64** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @is_excess_seq(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i64* nocapture readnone %4) {
ret i32 0
}
/* Type definitions */
typedef int x;
typedef int uint64_t;

/* Variables and functions */
uint64_t bswap_64(uint64_t x) {
  return (
      (((x)&0xff00000000000000ULL) >> 56) |
      (((x)&0x00ff000000000000ULL) >> 40) |
      (((x)&0x0000ff0000000000ULL) >> 24) | (((x)&0x000000ff00000000ULL) >> 8) |
      (((x)&0x00000000ff000000ULL) << 8) | (((x)&0x0000000000ff0000ULL) << 24) |
      (((x)&0x000000000000ff00ULL) << 40) |
      (((x)&0x00000000000000ffULL) << 56));
}


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

x86 assembly (clang, -O2):
<bswap_64>:
movslq %edi,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i32 @bswap_64(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i64 @llvm.bswap.i64(i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void effEcr() { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @effEcr() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @effEcr() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parallel_work();
void __cl_spec_parallel3() { parallel_work(); }


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

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

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

LLVM IR (-O2):
define void @__cl_spec_parallel3() {
%1 = tail call i32 (...) @parallel_work()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_ipreg_cell(int /*<<< orphan*/);
int /*<<< orphan*/ set_running_status(int);
void init_exec() {
  set_ipreg_cell(0);
  set_running_status(1);
}


x86 assembly (clang, -O0):
<init_exec>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <set_ipreg_cell@plt>
mov    $0x1,%edi
call   1040 <set_running_status@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_exec>:
push   %rax
xor    %edi,%edi
call   1030 <set_ipreg_cell@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <set_running_status@plt>

LLVM IR (-O0):
define void @init_exec() {
%1 = call i32 @set_ipreg_cell(i32 0)
%2 = call i32 @set_running_status(i32 1)
ret void
}

LLVM IR (-O2):
define void @init_exec() {
%1 = tail call i32 @set_ipreg_cell(i32 0)
%2 = tail call i32 @set_running_status(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int /*<<< orphan*/ SYS_futex;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, void *, int /*<<< orphan*/, int,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void futex_wait(void *futex, int comparand) {
  while (*(int *)futex == comparand) {
    syscall(SYS_futex, futex, FUTEX_WAIT, comparand, NULL, NULL, 0);
  }
}


x86 assembly (clang, -O0):
<futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1162 <futex_wait+0x52>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
jmp    111f <futex_wait+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_wait>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,(%rdi)
jne    1151 <futex_wait+0x41>
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%r14
mov    0x2eba(%rip),%r15
xchg   %ax,%ax
mov    (%r14),%edi
mov    (%r15),%edx
movl   $0x0,(%rsp)
mov    %rbx,%rsi
mov    %ebp,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
cmp    %ebp,(%rbx)
je     1130 <futex_wait+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
@FUTEX_WAIT = global i32 0
define void @futex_wait(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %11, %2
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %5
%12 = load i32, i32* @SYS_futex
%13 = load i8*, i8** %3
%14 = load i32, i32* @FUTEX_WAIT
%15 = load i32, i32* %4
%16 = call i32 @syscall(i32 %12, i8* %13, i32 %14, i32 %15, i32* null, i32* null, i32 0)
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
@SYS_futex = global i32 0
@FUTEX_WAIT = global i32 0
define void @futex_wait(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, %1
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = load i32, i32* @SYS_futex
%8 = load i32, i32* @FUTEX_WAIT
%9 = tail call i32 @syscall(i32 %7, i8* %0, i32 %8, i32 %1, i32* null, i32* null, i32 0)
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, %1
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int dobldobl_Newton_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(198, a, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<dobldobl_Newton_step>:
mov    $0xc6,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @dobldobl_Newton_step() {
%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 198, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_Newton_step() {
%1 = tail call i32 @_ada_use_c2phc(i32 198, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ decrypt(unsigned int *, unsigned int const *,
                           unsigned int *);
void TWOFISH_decrypt(int *key, char *input, char *output) {
  decrypt((unsigned int *)key, (const unsigned int *)input,
          (unsigned int *)output);
}


x86 assembly (clang, -O0):
<TWOFISH_decrypt>:
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
call   1030 <decrypt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TWOFISH_decrypt>:
jmp    1030 <decrypt@plt>

LLVM IR (-O0):
define void @TWOFISH_decrypt(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to i32*
%12 = call i32 @decrypt(i32* %7, i32* %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @TWOFISH_decrypt(i32* %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to i32*
%5 = bitcast i8* %2 to i32*
%6 = tail call i32 @decrypt(i32* %0, i32* %4, i32* %5)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_connect_error(int);
int /*<<< orphan*/ fd_nrf8001_connect_success();
void fd_nrf8001_dispatch_connect_response(uint8_t status,
                                          uint8_t *response_data
                                          __attribute__((unused)),
                                          uint32_t response_data_length
                                          __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_connect_error(status);
    return;
  }
  fd_nrf8001_connect_success();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_connect_response+0x29>
mov    -0x4(%rbp),%edi
call   1040 <fd_nrf8001_connect_error@plt>
jmp    1150 <fd_nrf8001_dispatch_connect_response+0x30>
mov    $0x0,%al
call   1030 <fd_nrf8001_connect_success@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_connect_response+0x9>
jmp    1040 <fd_nrf8001_connect_error@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_connect_success@plt>

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

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_connect_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_connect_error(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @fd_nrf8001_connect_success()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header_sv(void) {
  printf("   Date         dD          dI           dH       dX       dY       "
         "dZ       dF\n");
  printf("   (yr)      (min/yr)    (min/yr)    (nT/yr)  (nT/yr)  (nT/yr)  "
         "(nT/yr)  (nT/yr)\n");
}


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

x86 assembly (clang, -O2):
<print_header_sv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [81 x i8] c" Date dD dI dH dX dY dZ dF\0A\00"
@.str.1 = [82 x i8] c" (yr) (min/yr) (min/yr) (nT/yr) (nT/yr) (nT/yr) (nT/yr) (nT/yr)\0A\00"
define void @print_header_sv() {
%1 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [80 x i8] c" Date dD dI dH dX dY dZ dF\00"
@str.2 = [81 x i8] c" (yr) (min/yr) (min/yr) (nT/yr) (nT/yr) (nT/yr) (nT/yr) (nT/yr)\00"
define void @print_header_sv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.2, i64 0, i64 0))
ret void
}
int ei_close_arg(char arg, char *optarg) { return 1; }


x86 assembly (clang, -O0):
<ei_close_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ei_close_arg(i8 signext %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello World 1!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello World 1!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void _M2_bounce5_finish(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_bounce5_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int *a, int size) {
  int i;
  for (i = 0; i < size; i++)
    printf("%d\t", a[i]);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *config_get_user(char const *);
int config_has_user(const char *name) {
  if (NULL == config_get_user(name)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<config_has_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <config_get_user@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    113f <config_has_user+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <config_has_user+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_has_user>:
push   %rax
call   1030 <config_get_user@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @config_has_user(i8* %0) {
%2 = tail call i32* @config_get_user(i8* %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ stepperInit(int, int, int, int, int);
void coreInitSteppers(void) {
  stepperInit(0, 4, 17, 18, 27);
  stepperInit(1, 22, 23, 24, 25);
}


x86 assembly (clang, -O0):
<coreInitSteppers>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x11,%edx
mov    $0x12,%ecx
mov    $0x1b,%r8d
call   1030 <stepperInit@plt>
mov    $0x1,%edi
mov    $0x16,%esi
mov    $0x17,%edx
mov    $0x18,%ecx
mov    $0x19,%r8d
call   1030 <stepperInit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<coreInitSteppers>:
push   %rax
xor    %edi,%edi
mov    $0x4,%esi
mov    $0x11,%edx
mov    $0x12,%ecx
mov    $0x1b,%r8d
call   1030 <stepperInit@plt>
mov    $0x1,%edi
mov    $0x16,%esi
mov    $0x17,%edx
mov    $0x18,%ecx
mov    $0x19,%r8d
pop    %rax
jmp    1030 <stepperInit@plt>

LLVM IR (-O0):
define void @coreInitSteppers() {
%1 = call i32 @stepperInit(i32 0, i32 4, i32 17, i32 18, i32 27)
%2 = call i32 @stepperInit(i32 1, i32 22, i32 23, i32 24, i32 25)
ret void
}

LLVM IR (-O2):
define void @coreInitSteppers() {
%1 = tail call i32 @stepperInit(i32 0, i32 4, i32 17, i32 18, i32 27)
%2 = tail call i32 @stepperInit(i32 1, i32 22, i32 23, i32 24, i32 25)
ret void
}
/* Variables and functions */
int LOCK_NB;
int LOCK_SH;
int flock(int, int);
int SHlockNB(int fd) { return flock(fd, LOCK_SH | LOCK_NB); }


x86 assembly (clang, -O0):
<SHlockNB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2ea2(%rip),%rax
or     (%rax),%esi
call   1030 <flock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHlockNB>:
mov    0x2ed1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <flock@plt>

LLVM IR (-O0):
@LOCK_SH = global i32 0
@LOCK_NB = global i32 0
define i32 @SHlockNB(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_SH
%5 = load i32, i32* @LOCK_NB
%6 = or i32 %4, %5
%7 = call i32 @flock(i32 %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@LOCK_SH = global i32 0
@LOCK_NB = global i32 0
define i32 @SHlockNB(i32 %0) {
%2 = load i32, i32* @LOCK_SH
%3 = load i32, i32* @LOCK_NB
%4 = or i32 %3, %2
%5 = tail call i32 @flock(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ mat3f_copy(float *, float const *);
int /*<<< orphan*/ mat3f_transpose(float *);
void mat3f_transpose_new(float dest[9], const float src[9]) {
  mat3f_copy(dest, src);
  mat3f_transpose(dest);
}


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

x86 assembly (clang, -O2):
<mat3f_transpose_new>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3f_copy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mat3f_transpose@plt>

LLVM IR (-O0):
define void @mat3f_transpose_new(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @mat3f_copy(float* %5, float* %6)
%8 = load float*, float** %3
%9 = call i32 @mat3f_transpose(float* %8)
ret void
}

LLVM IR (-O2):
define void @mat3f_transpose_new(float* %0, float* %1) {
%3 = tail call i32 @mat3f_copy(float* %0, float* %1)
%4 = tail call i32 @mat3f_transpose(float* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t trunnel_get_uint8(const void *p) { return *(const uint8_t *)p; }


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

x86 assembly (clang, -O2):
<trunnel_get_uint8>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @trunnel_get_uint8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
void X509_REQ_sign(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_sign() {
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *);
int yylex();
int main(int argc, char **argv) {
  int token;
  printf(" !! Tokenize ptuc from standard input\n");
  while ((token = yylex()) != EOF) {
  }
  printf(" ** End of flex parsing -- success\n");
}


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),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <yylex@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
je     1160 <main+0x40>
jmp    1142 <main+0x22>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <yylex@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c" !! Tokenize ptuc from standard input\0A\00"
@EOF = global i32 0
@.str.1 = [36 x i8] c" ** End of flex parsing -- success\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %12, %2
%9 = call i32 (...) @yylex()
store i32 %9, i32* %6
%10 = load i32, i32* @EOF
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EOF = global i32 0
@str = [38 x i8] c" !! Tokenize ptuc from standard input\00"
@str.2 = [35 x i8] c" ** End of flex parsing -- success\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @yylex()
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %4
8: ; preds = %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  while (s[i]) {
    f(i, &s[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <ft_striteri+0x49>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ft_striteri+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %0, %2 ]
%7 = phi i32 [ %8, %5 ], [ 0, %2 ]
tail call void %1(i32 %7, i8* %6)
%8 = add i32 %7, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int eight();
int main(void) { return eight() - 8; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @eight()
%2 = add nsw i32 %1, -8
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void foo(int id) {
  if (id == 1) {
    sleep(3);
  }
  printf("[%d] Completed foo\n", id);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113f <foo+0x1f>
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%edi
jne    1132 <foo+0x12>
mov    $0x3,%edi
call   1040 <sleep@plt>
lea    0xec7(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"[%d] Completed foo\0A\00"
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @sleep(i32 3)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int gm_gpio_pin_index(unsigned port, unsigned pin) {
  int ret = port * 32 + pin;
  return ret < (32 * 3) ? ret : -1;
}


x86 assembly (clang, -O0):
<gm_gpio_pin_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x60,-0xc(%rbp)
jge    112b <gm_gpio_pin_index+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <gm_gpio_pin_index+0x38>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <gm_gpio_pin_index+0x38>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gm_gpio_pin_index>:
shl    $0x5,%edi
lea    (%rdi,%rsi,1),%ecx
cmp    $0x60,%ecx
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gm_gpio_pin_index(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 32
%8 = load i32, i32* %4
%9 = add i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 96
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %5
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %12
%16 = phi i32 [ %13, %12 ], [ -1, %14 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @gm_gpio_pin_index(i32 %0, i32 %1) {
%3 = shl i32 %0, 5
%4 = add i32 %3, %1
%5 = icmp slt i32 %4, 96
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
void UARTIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000038))) &= ~(ulIntFlags);
}


x86 assembly (clang, -O0):
<UARTIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntDisable>:
not    %rsi
and    %rsi,0x38(%rdi)
ret

LLVM IR (-O0):
define void @UARTIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 56
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @UARTIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 56
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}