xunge/DecIR huggingface dataset:
/* Type definitions */
struct project {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cleanup(struct project *);
int emit_file(struct project *);
struct project *options_parse(int, char **);
int main(int argc, char **argv) {
  struct project *p;
  int err = 0;
  p = options_parse(argc, argv);
  if (p) {
    err = emit_file(p);
    cleanup(p);
  }
  return err;
}


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)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <options_parse@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117d <main+0x4d>
mov    -0x18(%rbp),%rdi
call   1030 <emit_file@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <cleanup@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
call   1040 <options_parse@plt>
test   %rax,%rax
je     1156 <main+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <emit_file@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <cleanup@plt>
mov    %ebp,%eax
jmp    1158 <main+0x28>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.project = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.project*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call %struct.project* @options_parse(i32 %8, i8** %9)
store %struct.project* %10, %struct.project** %6
%11 = load %struct.project*, %struct.project** %6
%12 = icmp ne %struct.project* %11, null
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load %struct.project*, %struct.project** %6
%15 = call i32 @emit_file(%struct.project* %14)
store i32 %15, i32* %7
%16 = load %struct.project*, %struct.project** %6
%17 = call i32 @cleanup(%struct.project* %16)
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
%struct.project = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = tail call %struct.project* @options_parse(i32 %0, i8** %1)
%4 = icmp eq %struct.project* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @emit_file(%struct.project* %3)
%7 = tail call i32 @cleanup(%struct.project* %3)
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void noCh(char arr[]) {
  int i, chCt = 0;
  for (i = 0; arr[i] != '\0'; i++) {
    chCt++;
  }
  printf("There are %d characters in appC.\n", chCt);
}


x86 assembly (clang, -O0):
<noCh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <noCh+0x46>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <noCh+0x1a>
mov    -0x10(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noCh>:
cmpb   $0x0,(%rdi)
je     1137 <noCh+0x27>
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rsi,1)
lea    0x1(%rsi),%rsi
jne    1120 <noCh+0x10>
lea    0xece(%rip),%rdi
jmp    1030 <printf@plt>
xor    %esi,%esi
lea    0xec0(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [34 x i8] c"There are %d characters in appC.\0A\00"
define void @noCh(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
%14 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %13)
ret void
}
long PinValueInRange(long value, long rangeStart, long rangeEnd) {
  return ((value > rangeEnd) ? rangeEnd
                             : ((value < rangeStart) ? rangeStart : value));
}


x86 assembly (clang, -O0):
<PinValueInRange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    112b <PinValueInRange+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <PinValueInRange+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1146 <PinValueInRange+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <PinValueInRange+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PinValueInRange>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovge %rdi,%rax
cmp    %rdx,%rdi
cmovg  %rdx,%rax
ret

LLVM IR (-O0):
define i64 @PinValueInRange(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %6
%9 = icmp sgt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %6
br label %22
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = icmp slt i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i64, i64* %5
br label %20
18: ; preds = %12
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i64 [ %11, %10 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @PinValueInRange(i64 %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %0, %2
%5 = icmp slt i64 %0, %1
%6 = select i1 %5, i64 %1, i64 %0
%7 = select i1 %4, i64 %2, i64 %6
ret i64 %7
}
int proxyclientmanager_size() { return 30; }


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

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

LLVM IR (-O0):
define i32 @proxyclientmanager_size() {
ret i32 30
}

LLVM IR (-O2):
define i32 @proxyclientmanager_size() {
ret i32 30
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t pes_get_headerlength(const uint8_t *p_pes) { return p_pes[8]; }


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

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

LLVM IR (-O0):
define i32 @pes_get_headerlength(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @pes_get_headerlength(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hvqm2_decode(struct hle_t *, int /*<<< orphan*/);
void hvqm2_decode_sp1_task(struct hle_t *hle) { hvqm2_decode(hle, 0); }


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

x86 assembly (clang, -O2):
<hvqm2_decode_sp1_task>:
xor    %esi,%esi
jmp    1030 <hvqm2_decode@plt>

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

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @hvqm2_decode_sp1_task(%struct.hle_t* %0) {
%2 = tail call i32 @hvqm2_decode(%struct.hle_t* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *);
void __print_param(char *param) {
  char buffer[100];
  memset(buffer, '\0', 100);
  snprintf(buffer, 100 - 1, param);
  printf("\n[%s]\n", buffer);
}


x86 assembly (clang, -O0):
<__print_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x63,%esi
call   1040 <snprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__print_param>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    $0x63,%esi
mov    %rbx,%rdx
call   1040 <snprintf@plt>
lea    0xe9d(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\0A[%s]\0A\00"
define void @__print_param(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i8 signext 0, i32 100)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 99, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0A[%s]\0A\00"
define void @__print_param(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i8 signext 0, i32 100)
%5 = call i32 @snprintf(i8* %3, i32 99, i8* %0)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
bool func(bool r, bool y) { return y || r; }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jne    1123 <func+0x23>
cmpl   $0x0,-0x4(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
xor    %eax,%eax
or     %esi,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cc_asprintf(char **, char *, int);
char *cc_string_alloc_from_int(int value) {
  char *string;
  cc_asprintf(&string, "%i", value);
  return string;
}


x86 assembly (clang, -O0):
<cc_string_alloc_from_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
lea    0xed7(%rip),%rsi
call   1030 <cc_asprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_string_alloc_from_int>:
push   %rax
mov    %edi,%edx
lea    0xee6(%rip),%rsi
mov    %rsp,%rdi
call   1030 <cc_asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i8* @cc_string_alloc_from_int(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @cc_asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i8*, i8** %2
ret i8* %5
}
/* Variables and functions */
scalar_t__ is_transmit_empty();
int /*<<< orphan*/ outportb(int, char);
void serial_write_one(char a) {
  while (is_transmit_empty() == 0)
    ;
  outportb(0x3f8, a);
}


x86 assembly (clang, -O0):
<serial_write_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <is_transmit_empty@plt>
cmp    $0x0,%rax
jne    1144 <serial_write_one+0x24>
jmp    112e <serial_write_one+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1040 <outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write_one>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <is_transmit_empty@plt>
test   %rax,%rax
je     1130 <serial_write_one+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1040 <outportb@plt>

LLVM IR (-O0):
define void @serial_write_one(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 (...) @is_transmit_empty()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outportb(i32 1016, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @serial_write_one(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @is_transmit_empty()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outportb(i32 1016, i8 signext %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ blue_mult;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
unsigned long get_XStandardColormap_blue_mult(void *_p) {
  return (unsigned long)((XStandardColormap *)_p)->blue_mult;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XStandardColormap_blue_mult(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XStandardColormap_blue_mult(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void die(const char *prefix) {
  perror(prefix);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int test_imm_55uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x55 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_55uint64_midword_reg>:
test   $0x550000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_55uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5570560
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memmove8_impl(void *dest, const void *src, size_t n) {
  memmove(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memmove8_impl>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memmove8_impl(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printchar(char);
int /*<<< orphan*/ shell();
void shell_enterpressed() {
  printchar('\n');
  shell();
}


x86 assembly (clang, -O0):
<shell_enterpressed>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <printchar@plt>
mov    $0x0,%al
call   1040 <shell@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_enterpressed>:
push   %rax
mov    $0xa,%edi
call   1030 <printchar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <shell@plt>

LLVM IR (-O0):
define void @shell_enterpressed() {
%1 = call i32 @printchar(i8 signext 10)
%2 = call i32 (...) @shell()
ret void
}

LLVM IR (-O2):
define void @shell_enterpressed() {
%1 = tail call i32 @printchar(i8 signext 10)
%2 = tail call i32 (...) @shell()
ret void
}
int tramp() {
  *(void **)0x1234567813578765L = (void *)0x7355471143622155L;
  return (*(int (*)())0xbabebec0dea0ffabL)();
}


x86 assembly (clang, -O0):
<tramp>:
push   %rbp
mov    %rsp,%rbp
movabs $0x1234567813578765,%rax
56 34 12
movabs $0x7355471143622155,%rcx
47 55 73
mov    %rcx,(%rax)
movabs $0xbabebec0dea0ffab,%rcx
be be ba
mov    $0x0,%al
call   *%rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tramp>:
movabs $0x7355471143622155,%rax
47 55 73
movabs $0x1234567813578765,%rcx
56 34 12
mov    %rax,(%rcx)
movabs $0xbabebec0dea0ffab,%rcx
be be ba
xor    %eax,%eax
jmp    *%rcx

LLVM IR (-O0):
define i32 @tramp() {
store i8* inttoptr (i64 8310626826852639061 to i8*), i8** inttoptr (i64 1311768465192224613 to i8**)
%1 = call i32 (...) inttoptr (i64 -4990341601501839445 to i32 (...)*)()
ret i32 %1
}

LLVM IR (-O2):
define i32 @tramp() {
store i8* inttoptr (i64 8310626826852639061 to i8*), i8** inttoptr (i64 1311768465192224613 to i8**)
%1 = tail call i32 (...) inttoptr (i64 -4990341601501839445 to i32 (...)*)()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Program to converting case\n"
         "\t-h|--help to get help\n"
         "\t-v|--version to get version infor\n"
         "\t-l|--lower convert into lowercase\n"
         "\t-u|--upper convert to uppercase\n");
}


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

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

LLVM IR (-O0):
@.str = [154 x i8] c"Program to converting case\0A\09-h|--help to get help\0A\09-v|--version to get version infor\0A\09-l|--lower convert into lowercase\0A\09-u|--upper convert to uppercase\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [153 x i8] c"Program to converting case\0A\09-h|--help to get help\0A\09-v|--version to get version infor\0A\09-l|--lower convert into lowercase\0A\09-u|--upper convert to uppercase\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([153 x i8], [153 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ digi_init();
int /*<<< orphan*/ msecDelay(int);
int app_main() {
  int ii;
  digi_init();
  while (1) {
    (*(volatile unsigned int *)((0x3FF0000 + 0x5008)) = (0x0));
    msecDelay(100);
    (*(volatile unsigned int *)((0x3FF0000 + 0x5008)) = (0xf));
    msecDelay(900);
  }
}


x86 assembly (clang, -O0):
<app_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <digi_init@plt>
mov    $0x3ff5008,%eax
movl   $0x0,(%rax)
mov    $0x64,%edi
call   1040 <msecDelay@plt>
mov    $0x3ff5008,%eax
movl   $0xf,(%rax)
mov    $0x384,%edi
call   1040 <msecDelay@plt>
jmp    112f <app_main+0xf>

x86 assembly (clang, -O2):
<app_main>:
push   %rax
xor    %eax,%eax
call   1030 <digi_init@plt>
nopl   0x0(%rax,%rax,1)
movl   $0x0,0x3ff5008
mov    $0x64,%edi
call   1040 <msecDelay@plt>
movl   $0xf,0x3ff5008
mov    $0x384,%edi
call   1040 <msecDelay@plt>
jmp    1130 <app_main+0x10>

LLVM IR (-O0):
define i32 @app_main() {
%1 = alloca i32
%2 = call i32 (...) @digi_init()
br label %3
3: ; preds = %0, %3
store volatile i32 0, i32* inttoptr (i64 67063816 to i32*)
%4 = call i32 @msecDelay(i32 100)
store volatile i32 15, i32* inttoptr (i64 67063816 to i32*)
%5 = call i32 @msecDelay(i32 900)
br label %3
}

LLVM IR (-O2):
define i32 @app_main() {
%1 = tail call i32 (...) @digi_init()
br label %2
2: ; preds = %2, %0
store volatile i32 0, i32* inttoptr (i64 67063816 to i32*)
%3 = tail call i32 @msecDelay(i32 100)
store volatile i32 15, i32* inttoptr (i64 67063816 to i32*)
%4 = tail call i32 @msecDelay(i32 900)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ __dl_fpp_mutex_unlock();
scalar_t__ initialized();
void fpp_mutex_unlock(void) {
  if (initialized())
    __dl_fpp_mutex_unlock();
}


x86 assembly (clang, -O0):
<fpp_mutex_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initialized@plt>
cmp    $0x0,%rax
je     113c <fpp_mutex_unlock+0x1c>
mov    $0x0,%al
call   1030 <__dl_fpp_mutex_unlock@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fpp_mutex_unlock() {
%1 = call i64 (...) @initialized()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @__dl_fpp_mutex_unlock()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @fpp_mutex_unlock() {
%1 = tail call i64 (...) @initialized()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__dl_fpp_mutex_unlock()
br label %5
5: ; preds = %3, %0
ret void
}
int __attribute__((no, noclone)) k(int a, int b) { return (2 * a) * b; }


x86 assembly (clang, -O0):
<k>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<k>:
imul   %esi,%edi
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @k(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 = mul nsw i32 2, %5
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @k(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = mul nsw i32 %3, %1
ret i32 %4
}
unsigned int hash(char *s) {
  unsigned int hashval;
  for (hashval = 0; *s != '\0'; ++s)
    hashval = hashval * 257 + *s;
  return hashval % 30000000;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <hash+0x43>
imul   $0x101,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x1c9c380,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1140 <hash+0x40>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x8,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
shr    $0x7,%ecx
imul   $0x11e54c7,%rcx,%rcx
shr    $0x2a,%rcx
imul   $0x1c9c380,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 257
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 30000000
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ circle(int, int, int, int);
int /*<<< orphan*/ line(int, int, int, int);
int /*<<< orphan*/ star(int, int, int, int);
void test() {
  circle(28, 43, 25, 11);
  star(28, 43, 25, 11);
  line(5, 5, 75, 15);
  line(5, 8, 75, 12);
  line(75, 5, 65, 70);
  line(72, 5, 67, 70);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
mov    $0x2b,%esi
mov    $0x19,%edx
mov    $0xb,%ecx
call   1040 <circle@plt>
mov    $0x1c,%edi
mov    $0x2b,%esi
mov    $0x19,%edx
mov    $0xb,%ecx
call   1030 <star@plt>
mov    $0x5,%esi
mov    $0x4b,%edx
mov    $0xf,%ecx
mov    %esi,%edi
call   1050 <line@plt>
mov    $0x5,%edi
mov    $0x8,%esi
mov    $0x4b,%edx
mov    $0xc,%ecx
call   1050 <line@plt>
mov    $0x4b,%edi
mov    $0x5,%esi
mov    $0x41,%edx
mov    $0x46,%ecx
call   1050 <line@plt>
mov    $0x48,%edi
mov    $0x5,%esi
mov    $0x43,%edx
mov    $0x46,%ecx
call   1050 <line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1c,%edi
mov    $0x2b,%esi
mov    $0x19,%edx
mov    $0xb,%ecx
call   1040 <circle@plt>
mov    $0x1c,%edi
mov    $0x2b,%esi
mov    $0x19,%edx
mov    $0xb,%ecx
call   1030 <star@plt>
mov    $0x5,%edi
mov    $0x5,%esi
mov    $0x4b,%edx
mov    $0xf,%ecx
call   1050 <line@plt>
mov    $0x5,%edi
mov    $0x8,%esi
mov    $0x4b,%edx
mov    $0xc,%ecx
call   1050 <line@plt>
mov    $0x4b,%edi
mov    $0x5,%esi
mov    $0x41,%edx
mov    $0x46,%ecx
call   1050 <line@plt>
mov    $0x48,%edi
mov    $0x5,%esi
mov    $0x43,%edx
mov    $0x46,%ecx
pop    %rax
jmp    1050 <line@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @circle(i32 28, i32 43, i32 25, i32 11)
%2 = call i32 @star(i32 28, i32 43, i32 25, i32 11)
%3 = call i32 @line(i32 5, i32 5, i32 75, i32 15)
%4 = call i32 @line(i32 5, i32 8, i32 75, i32 12)
%5 = call i32 @line(i32 75, i32 5, i32 65, i32 70)
%6 = call i32 @line(i32 72, i32 5, i32 67, i32 70)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @circle(i32 28, i32 43, i32 25, i32 11)
%2 = tail call i32 @star(i32 28, i32 43, i32 25, i32 11)
%3 = tail call i32 @line(i32 5, i32 5, i32 75, i32 15)
%4 = tail call i32 @line(i32 5, i32 8, i32 75, i32 12)
%5 = tail call i32 @line(i32 75, i32 5, i32 65, i32 70)
%6 = tail call i32 @line(i32 72, i32 5, i32 67, i32 70)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void set_pmu_sleep_clk_high() {
  mbus_remote_register_write(0x7, 0x19,
                             ((1 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x7, 0x19,
                             ((1 << 13) | (1 << 9) | (1 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x7, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (1 << 13) | (1 << 9) | (1 << 5) | (6)));
  delay(100 * 10);
}


x86 assembly (clang, -O0):
<set_pmu_sleep_clk_high>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x15,%esi
mov    $0xe226,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_sleep_clk_high>:
push   %rax
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x19,%esi
mov    $0x2221,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x7,%edi
mov    $0x15,%esi
mov    $0xe226,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @set_pmu_sleep_clk_high() {
%1 = call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8737)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8737)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 7, i32 21, i32 57894)
%6 = call i32 @delay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @set_pmu_sleep_clk_high() {
%1 = tail call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8737)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 7, i32 25, i32 8737)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 7, i32 21, i32 57894)
%6 = tail call i32 @delay(i32 1000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ klog(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ tcp_close(int);
void faulter(int fd, void *privatedata) {
  klog(0, "faulter: %d", fd);
  tcp_close(fd);
}


x86 assembly (clang, -O0):
<faulter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
xor    %edi,%edi
lea    0xec5(%rip),%rsi
call   1030 <klog@plt>
mov    -0x4(%rbp),%edi
call   1040 <tcp_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<faulter>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
xor    %edi,%edi
mov    %ebx,%edx
call   1030 <klog@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <tcp_close@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"faulter: %d\00"
define void @faulter(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 = call i32 @klog(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @tcp_close(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"faulter: %d\00"
define void @faulter(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @klog(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @tcp_close(i32 %0)
ret void
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mfn_to_local_pfn(int /*<<< orphan*/);
int /*<<< orphan*/ page_to_pfn(struct page *);
int /*<<< orphan*/ pfn_to_mfn(int /*<<< orphan*/);
int pfn_valid(int /*<<< orphan*/);
int gnttab_dma_local_pfn(struct page *page) {
  return pfn_valid(mfn_to_local_pfn(pfn_to_mfn(page_to_pfn(page))));
}


x86 assembly (clang, -O0):
<gnttab_dma_local_pfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <page_to_pfn@plt>
mov    %eax,%edi
call   1050 <pfn_to_mfn@plt>
mov    %eax,%edi
call   1030 <mfn_to_local_pfn@plt>
mov    %eax,%edi
call   1060 <pfn_valid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnttab_dma_local_pfn>:
push   %rax
call   1040 <page_to_pfn@plt>
mov    %eax,%edi
call   1050 <pfn_to_mfn@plt>
mov    %eax,%edi
call   1030 <mfn_to_local_pfn@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <pfn_valid@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define i32 @gnttab_dma_local_pfn(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i32 @page_to_pfn(%struct.page* %3)
%5 = call i32 @pfn_to_mfn(i32 %4)
%6 = call i32 @mfn_to_local_pfn(i32 %5)
%7 = call i32 @pfn_valid(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.page = type { i32 }
define i32 @gnttab_dma_local_pfn(%struct.page* %0) {
%2 = tail call i32 @page_to_pfn(%struct.page* %0)
%3 = tail call i32 @pfn_to_mfn(i32 %2)
%4 = tail call i32 @mfn_to_local_pfn(i32 %3)
%5 = tail call i32 @pfn_valid(i32 %4)
ret i32 %5
}
long int _f_lrint(double x) {
  long int _result;
  asm("fistpl %0" : "=m"(_result) : "t"(x) : "st");
  return _result;
}


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

x86 assembly (clang, -O2):
<_f_lrint>:
movsd  %xmm0,-0x10(%rsp)
fldl   -0x10(%rsp)
fistpl -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @_f_lrint(double %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_spooler_close();
int /*<<< orphan*/ test_spooler_open_successful();
int /*<<< orphan*/ test_spooler_open_unsuccessful();
int /*<<< orphan*/ test_spooler_read();
int /*<<< orphan*/ test_spooler_read_after_close_no_action();
int main() {
  test_spooler_open_successful();
  test_spooler_open_unsuccessful();
  test_spooler_close();
  test_spooler_read();
  test_spooler_read_after_close_no_action();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_spooler_open_successful@plt>
mov    $0x0,%al
call   1060 <test_spooler_open_unsuccessful@plt>
mov    $0x0,%al
call   1070 <test_spooler_close@plt>
mov    $0x0,%al
call   1030 <test_spooler_read@plt>
mov    $0x0,%al
call   1050 <test_spooler_read_after_close_no_action@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_spooler_open_successful@plt>
xor    %eax,%eax
call   1060 <test_spooler_open_unsuccessful@plt>
xor    %eax,%eax
call   1070 <test_spooler_close@plt>
xor    %eax,%eax
call   1030 <test_spooler_read@plt>
xor    %eax,%eax
call   1050 <test_spooler_read_after_close_no_action@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_spooler_open_successful()
%3 = call i32 (...) @test_spooler_open_unsuccessful()
%4 = call i32 (...) @test_spooler_close()
%5 = call i32 (...) @test_spooler_read()
%6 = call i32 (...) @test_spooler_read_after_close_no_action()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_spooler_open_successful()
%2 = tail call i32 (...) @test_spooler_open_unsuccessful()
%3 = tail call i32 (...) @test_spooler_close()
%4 = tail call i32 (...) @test_spooler_read()
%5 = tail call i32 (...) @test_spooler_read_after_close_no_action()
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, "Error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void tty_write_char(char c) {
  putchar(c);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<tty_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_write_char>:
push   %rax
call   1030 <putchar@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @tty_write_char(i8 signext %0) {
%2 = tail call i32 @putchar(i8 signext %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int);
int getBufferStringOfInteger(int j, char *buffer) {
  int i = 0;
  i = sprintf(&buffer[i], "%d", j);
  return i;
}


x86 assembly (clang, -O0):
<getBufferStringOfInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBufferStringOfInteger>:
mov    %rsi,%rax
mov    %edi,%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @getBufferStringOfInteger(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %3
}
int range_patch_ver(unsigned patch_ver) {
  if (patch_ver > 40) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<range_patch_ver>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x28,-0x8(%rbp)
jbe    111d <range_patch_ver+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <range_patch_ver+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_patch_ver>:
xor    %eax,%eax
cmp    $0x29,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @range_patch_ver(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ugt i32 %4, 40
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @range_patch_ver(i32 %0) {
%2 = icmp ugt i32 %0, 40
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int _msgctl(char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  (void)argc;
  ret |= _msgctl(argv[0]);
  return (ret == 0) ? 0 : 2;
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_msgctl@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @_msgctl(i8* %10)
%12 = load i32, i32* %6
%13 = or i32 %12, %11
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 2
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @_msgctl(i8* %3)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 2
ret i32 %6
}
unsigned int net_load32(unsigned char data[4]) {
  return (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | (data[3] << 0);
}


x86 assembly (clang, -O0):
<net_load32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @net_load32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
scalar_t__ ceil(int);
int len_calc(int base, int len) {
  int n = 1;
  while ((1 << n) < base)
    n++;
  return (int)ceil(n * len / 8);
}


x86 assembly (clang, -O0):
<len_calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jge    1146 <len_calc+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <len_calc+0x15>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_calc>:
mov    $0x1,%ecx
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edx
shl    %cl,%edx
add    $0x1,%ecx
add    %esi,%eax
cmp    %edi,%edx
jl     1120 <len_calc+0x10>
lea    0x7(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x3,%edi
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @len_calc(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 1, i32* %5
br label %6
6: ; preds = %11, %2
%7 = load i32, i32* %5
%8 = shl i32 1, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
br label %6
14: ; preds = %6
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = sdiv i32 %17, 8
%19 = call i64 @ceil(i32 %18)
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @len_calc(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 1, %2 ], [ %7, %3 ]
%5 = shl nuw i32 1, %4
%6 = icmp slt i32 %5, %0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = mul nsw i32 %4, %1
%10 = sdiv i32 %9, 8
%11 = tail call i64 @ceil(i32 %10)
%12 = trunc i64 %11 to i32
ret i32 %12
}