xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *d_charsetEncode(char *, int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ free(char *);
FILE *fopen_c64(const char *filename, const char *mode) {
  FILE *retval;
  char *encoded = d_charsetEncode((char *)filename, 15, NULL, NULL);
  retval = fopen(encoded, mode);
  free(encoded);
  return retval;
}


x86 assembly (clang, -O0):
<fopen_c64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xf,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1040 <d_charsetEncode@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_c64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    $0xf,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <d_charsetEncode@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @fopen_c64(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @d_charsetEncode(i8* %7, i32 15, i32* null, i32* null)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = call i32* @fopen(i8* %9, i8* %10)
store i32* %11, i32** %5
%12 = load i8*, i8** %6
%13 = call i32 @free(i8* %12)
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
define noalias i32* @fopen_c64(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @d_charsetEncode(i8* %0, i32 15, i32* null, i32* null)
%4 = tail call i32* @fopen(i8* %3, i8* %1)
%5 = tail call i32 @free(i8* %3)
ret i32* %4
}
char snck_line_init(struct snck_ctxt const *const p_ctxt) {
  char b_result;
  (void)(p_ctxt);
  b_result = 1;
  return b_result;
}


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

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

LLVM IR (-O0):
%struct.snck_ctxt = type opaque
define signext i8 @snck_line_init(%struct.snck_ctxt* %0) {
%2 = alloca %struct.snck_ctxt*
%3 = alloca i8
store %struct.snck_ctxt* %0, %struct.snck_ctxt** %2
%4 = load %struct.snck_ctxt*, %struct.snck_ctxt** %2
store i8 1, i8* %3
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
%struct.snck_ctxt = type opaque
define signext i8 @snck_line_init(%struct.snck_ctxt* nocapture readnone %0) {
ret i8 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int distance = 100;
  printf("Dhaka is %d kilometers distance form Tangail", distance);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Dhaka is %d kilometers distance form Tangail\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
store i32 100, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"Dhaka is %d kilometers distance form Tangail\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
int hashmapShortHash(void *key) { return (int)*((short *)key); }


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

x86 assembly (clang, -O2):
<hashmapShortHash>:
movswl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hashmapShortHash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i16*
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ adc_a_n();
void opcode_ce() { adc_a_n(); }


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

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

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

LLVM IR (-O2):
define void @opcode_ce() {
%1 = tail call i32 (...) @adc_a_n()
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf27(int f, int n) { return (cbuf(f, n, 27)); }


x86 assembly (clang, -O0):
<cbuf27>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1b,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf27>:
mov    $0x1b,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf27(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 27)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int get_time_correct_period(int input) {
  if (input > 0)
    return (input);
  else {
    fprintf(stderr, "Incorrect time, it is must be >0\n");
    exit(EXIT_FAILURE);
  }
  return (0);
}


x86 assembly (clang, -O0):
<get_time_correct_period>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113e <get_time_correct_period+0x1e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<get_time_correct_period>:
test   %edi,%edi
jle    1127 <get_time_correct_period+0x7>
mov    %edi,%eax
ret
push   %rax
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Incorrect time, it is must be >0\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @get_time_correct_period(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
ret i32 %6
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Incorrect time, it is must be >0\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @get_time_correct_period(i32 returned %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
ret i32 %0
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
size_t strlen(const char *s) {
  register const char *p;
  for (p = s; *p; p++)
    ;
  return p - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_dbcreate();
int main(void) {
  runAllTests_dbcreate();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_dbcreate()
ret i32 0
}
const char *return_string() { return "foobarbazquux"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"foobarbazquux\00"
define i8* @return_string() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"foobarbazquux\00"
define i8* @return_string() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void gtk_icon_view_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_type() {
ret void
}
void ExttTypeAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttTypeAuxTable() {
ret void
}
/* Variables and functions */
scalar_t__ recv_termination_ack(int /*<<< orphan*/);
scalar_t__ send_termination_ack(int /*<<< orphan*/);
int pp_client_termination() {
  if (send_termination_ack(0))
    return 1;
  if (recv_termination_ack(0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<pp_client_termination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <send_termination_ack@plt>
cmp    $0x0,%rax
je     1145 <pp_client_termination+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1169 <pp_client_termination+0x49>
xor    %edi,%edi
call   1040 <recv_termination_ack@plt>
cmp    $0x0,%rax
je     1162 <pp_client_termination+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1169 <pp_client_termination+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp_client_termination>:
push   %rax
xor    %edi,%edi
call   1030 <send_termination_ack@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <pp_client_termination+0x17>
pop    %rcx
ret
xor    %edi,%edi
call   1040 <recv_termination_ack@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pp_client_termination() {
%1 = tail call i64 @send_termination_ack(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @recv_termination_ack(i32 0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int);
main() {
  f(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long current_milliseconds() {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<current_milliseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_milliseconds>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @current_milliseconds() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i64 @current_milliseconds() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
%12 = sext i32 %11 to i64
ret i64 %12
}
/* Variables and functions */
int readl(int);
int /*<<< orphan*/ writel(int, int);
void set_slot_extbyte(void) {
  writel((readl(0xBE000018) & 0xffffbf00) | 0x18, 0xBE000018);
}


x86 assembly (clang, -O0):
<set_slot_extbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbe000018,%edi
call   1030 <readl@plt>
mov    %eax,%edi
and    $0xffffbf00,%edi
or     $0x18,%edi
mov    $0xbe000018,%esi
call   1040 <writel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_slot_extbyte>:
push   %rax
mov    $0xbe000018,%edi
call   1030 <readl@plt>
and    $0xffffbf00,%eax
lea    0x18(%rax),%edi
mov    $0xbe000018,%esi
pop    %rax
jmp    1040 <writel@plt>

LLVM IR (-O0):
define void @set_slot_extbyte() {
%1 = call i32 @readl(i32 -1107296232)
%2 = and i32 %1, -16640
%3 = or i32 %2, 24
%4 = call i32 @writel(i32 %3, i32 -1107296232)
ret void
}

LLVM IR (-O2):
define void @set_slot_extbyte() {
%1 = tail call i32 @readl(i32 -1107296232)
%2 = and i32 %1, -16640
%3 = or i32 %2, 24
%4 = tail call i32 @writel(i32 %3, i32 -1107296232)
ret void
}
/* Variables and functions */
unsigned int xstrtoull_range(char const *, int, unsigned int, unsigned int);
__attribute__((always_)) unsigned int
xstrtou_range(const char *str, int b, unsigned int l, unsigned int u) {
  return xstrtoull_range(str, b, l, u);
}


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

x86 assembly (clang, -O2):
<xstrtou_range>:
jmp    1030 <xstrtoull_range@plt>

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

LLVM IR (-O2):
define i32 @xstrtou_range(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @xstrtoull_range(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ emit(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void get_echo(char *aux) {
  char line[140];
  sprintf(line, "command %s", aux);
  emit(line);
}


x86 assembly (clang, -O0):
<get_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <emit@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_echo>:
push   %rbx
sub    $0x90,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <emit@plt>
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"command %s\00"
define void @get_echo(i8* %0) {
%2 = alloca i8*
%3 = alloca [140 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [140 x i8], [140 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [140 x i8], [140 x i8]* %3, i64 0, i64 0
%8 = call i32 @emit(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"command %s\00"
define void @get_echo(i8* %0) {
%2 = alloca [140 x i8]
%3 = getelementptr inbounds [140 x i8], [140 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @emit(i8* %3)
ret void
}
long double cube(float n) { return n * n * n; }


x86 assembly (clang, -O0):
<cube>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movaps %xmm1,%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
flds   -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,-0x4(%rsp)
flds   -0x4(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @cube(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fpext float %7 to x86_fp80
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @cube(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fpext float %3 to x86_fp80
ret x86_fp80 %4
}
char hash(char *key) {
  char i;
  short sum = 0;
  for (i = 0; key[i]; ++i) {
    sum += key[i] * (i + 1);
  }
  return 19 * sum % 101;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xc(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbq -0x9(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1153 <hash+0x53>
mov    -0x8(%rbp),%rax
movsbq -0x9(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%eax
add    $0x1,%eax
imul   %eax,%ecx
movswl -0xc(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xc(%rbp)
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1112 <hash+0x12>
movswl -0xc(%rbp),%eax
imul   $0x13,%eax,%eax
mov    $0x65,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1151 <hash+0x51>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movsbl %dl,%edx
movsbl %cl,%ecx
lea    0x1(%rcx),%esi
imul   %edx,%esi
add    %eax,%esi
add    $0x1,%cl
movswl %si,%eax
movsbq %cl,%rdx
movzbl (%rdi,%rdx,1),%edx
test   %dl,%dl
jne    1110 <hash+0x10>
lea    (%rax,%rax,8),%ecx
lea    (%rax,%rcx,2),%eax
cltq
imul   $0x288df0cb,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x24,%rcx
add    %edx,%ecx
imul   $0x65,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %4
store i8 0, i8* %3
br label %5
5: ; preds = %27, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %3
%8 = sext i8 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %30
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i8, i8* %3
%15 = sext i8 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = add nsw i32 %20, 1
%22 = mul nsw i32 %18, %21
%23 = load i16, i16* %4
%24 = sext i16 %23 to i32
%25 = add nsw i32 %24, %22
%26 = trunc i32 %25 to i16
store i16 %26, i16* %4
br label %27
27: ; preds = %12
%28 = load i8, i8* %3
%29 = add i8 %28, 1
store i8 %29, i8* %3
br label %5
30: ; preds = %5
%31 = load i16, i16* %4
%32 = sext i16 %31 to i32
%33 = mul nsw i32 19, %32
%34 = srem i32 %33, 101
%35 = trunc i32 %34 to i8
ret i8 %35
}

LLVM IR (-O2):
define signext i8 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %24, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %18, %4 ], [ %2, %1 ]
%6 = phi i32 [ %15, %4 ], [ 0, %1 ]
%7 = phi i8 [ %13, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = sext i8 %7 to i32
%10 = add nsw i32 %9, 1
%11 = mul nsw i32 %10, %8
%12 = add nsw i32 %11, %6
%13 = add i8 %7, 1
%14 = shl i32 %12, 16
%15 = ashr exact i32 %14, 16
%16 = sext i8 %13 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %4
20: ; preds = %4
%21 = mul nsw i32 %15, 19
%22 = srem i32 %21, 101
%23 = trunc i32 %22 to i8
br label %24
24: ; preds = %20, %1
%25 = phi i8 [ 0, %1 ], [ %23, %20 ]
ret i8 %25
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @quit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @quit(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ vx86_NBSB_Write(int, unsigned char, unsigned long);
void nb1_Write(unsigned char offset, unsigned long val) {
  vx86_NBSB_Write(1, offset, val);
}


x86 assembly (clang, -O0):
<nb1_Write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
movzbl %al,%esi
call   1030 <vx86_NBSB_Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb1_Write>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <vx86_NBSB_Write@plt>

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

LLVM IR (-O2):
define void @nb1_Write(i8 zeroext %0, i64 %1) {
%3 = tail call i32 @vx86_NBSB_Write(i32 1, i8 zeroext %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvEnableMultipleROI(char byBoardNum, short wNumRegions, short wLeft,
                        short wRight, short *pOffsets, short *pHeights,
                        char bBinROI) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvEnableMultipleROI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %dil,%sil
mov    0x10(%rbp),%dil
mov    %sil,-0x1(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %r8,-0x10(%rbp)
mov    %r9,-0x18(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvEnableMultipleROI(i8 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16* %4, i16* %5, i8 signext %6) {
%8 = alloca i8
%9 = alloca i16
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16*
%13 = alloca i16*
%14 = alloca i8
store i8 %0, i8* %8
store i16 %1, i16* %9
store i16 %2, i16* %10
store i16 %3, i16* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
store i8 %6, i8* %14
%15 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvEnableMultipleROI(i8 signext %0, i16 signext %1, i16 signext %2, i16 signext %3, i16* nocapture readnone %4, i16* nocapture readnone %5, i8 signext %6) {
%8 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
char *xstrdup(str)
char *str;
{
  char *buf = xmalloc(strlen(str) + 1);
  (void)strcpy(buf, str);
  return (buf);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <xmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <xmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @xmalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void swap_uint32(uint32_t *i) {
  *i = (((*i >> 24) & 0xff) | ((*i << 8) & 0xff0000) | ((*i >> 8) & 0xff00) |
        ((*i << 24) & 0xff000000));
}


x86 assembly (clang, -O0):
<swap_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x8,%eax
and    $0xff00,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swap_uint32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 24
%6 = and i32 %5, 255
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = and i32 %9, 16711680
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = ashr i32 %13, 8
%15 = and i32 %14, 65280
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = shl i32 %18, 24
%20 = and i32 %19, -16777216
%21 = or i32 %16, %20
%22 = load i32*, i32** %2
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @swap_uint32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
store i32 %3, i32* %0
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xreparent_x(void *_p) {
  return (int)((XEvent *)_p)->xreparent.x;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xreparent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int);
int main(void) {
  if (foo(0x8000) != 1)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8000,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1149 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8000,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 32768)
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 32768)
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_DimmingService_GetLoadLevelStatus(void *, int);
int /*<<< orphan*/ printf(char *);
void DimmingService_GetLoadLevelStatus(void *upnptoken) {
  printf("UPnP Invoke: DimmingService_GetLoadLevelStatus();\r\n");
  UPnPResponse_DimmingService_GetLoadLevelStatus(upnptoken, 250);
}


x86 assembly (clang, -O0):
<DimmingService_GetLoadLevelStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0xfa,%esi
call   1040 <UPnPResponse_DimmingService_GetLoadLevelStatus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DimmingService_GetLoadLevelStatus>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0xfa,%esi
pop    %rbx
jmp    1040 <UPnPResponse_DimmingService_GetLoadLevelStatus@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"UPnP Invoke: DimmingService_GetLoadLevelStatus();\0D\0A\00"
define void @DimmingService_GetLoadLevelStatus(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @UPnPResponse_DimmingService_GetLoadLevelStatus(i8* %4, i32 250)
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"UPnP Invoke: DimmingService_GetLoadLevelStatus();\0D\00"
define void @DimmingService_GetLoadLevelStatus(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @UPnPResponse_DimmingService_GetLoadLevelStatus(i8* %0, i32 250)
ret void
}
/* Type definitions */
struct dirent {
  scalar_t__ d_type;
};

/* Variables and functions */
scalar_t__ DT_DIR;
int filter_dir(const struct dirent *entry) {
  if (entry->d_type == DT_DIR) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<filter_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2eca(%rip),%rcx
cmp    (%rcx),%rax
jne    112b <filter_dir+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1132 <filter_dir+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_dir>:
mov    (%rdi),%rcx
mov    0x2ed6(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
ret

LLVM IR (-O0):
%struct.dirent = type { i64 }
@DT_DIR = global i64 0
define i32 @filter_dir(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @DT_DIR
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.dirent = type { i64 }
@DT_DIR = global i64 0
define i32 @filter_dir(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = load i64, i64* @DT_DIR
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ pthread_mutex_unlock(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void xunlock(pthread_mutex_t *m) {
  if (pthread_mutex_unlock(m)) {
    fputs("xunlock\n", stderr);
    abort();
  }
}


x86 assembly (clang, -O0):
<xunlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_unlock@plt>
cmp    $0x0,%rax
je     116b <xunlock+0x3b>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xunlock>:
push   %rax
call   1050 <pthread_mutex_unlock@plt>
test   %rax,%rax
jne    113d <xunlock+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"xunlock\0A\00"
@stderr = global i32 0
define void @xunlock(i32* %0) {
%2 = tail call i64 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
struct rblists {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rb_closelist(struct rblists *);
void rbcloselist(struct rblists *rblistp) {
  if (rblistp == NULL)
    return;
  rb_closelist(rblistp);
}


x86 assembly (clang, -O0):
<rbcloselist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <rbcloselist+0x1c>
jmp    1135 <rbcloselist+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <rb_closelist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbcloselist>:
test   %rdi,%rdi
je     111a <rbcloselist+0xa>
jmp    1030 <rb_closelist@plt>
ret

LLVM IR (-O0):
%struct.rblists = type { i32 }
define void @rbcloselist(%struct.rblists* %0) {
%2 = alloca %struct.rblists*
store %struct.rblists* %0, %struct.rblists** %2
%3 = load %struct.rblists*, %struct.rblists** %2
%4 = icmp eq %struct.rblists* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.rblists*, %struct.rblists** %2
%8 = call i32 @rb_closelist(%struct.rblists* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.rblists = type { i32 }
define void @rbcloselist(%struct.rblists* %0) {
%2 = icmp eq %struct.rblists* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @rb_closelist(%struct.rblists* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
unsigned char *xsalsa8_decrypt(unsigned char *, size_t *, unsigned char const *,
                               size_t, unsigned char const *,
                               unsigned char const *);
unsigned char *crypt_decrypt_xsalsa8(unsigned char *out, size_t *out_len,
                                     const unsigned char *in, size_t in_len,
                                     const unsigned char *nonce,
                                     const unsigned char *key) {
  return xsalsa8_decrypt(out, out_len, in, in_len, nonce, key);
}


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

x86 assembly (clang, -O2):
<crypt_decrypt_xsalsa8>:
jmp    1030 <xsalsa8_decrypt@plt>

LLVM IR (-O0):
define i8* @crypt_decrypt_xsalsa8(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @xsalsa8_decrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_decrypt_xsalsa8(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @xsalsa8_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
void _M2_bagatelle_finish(__attribute__((unused)) int argc,
                          __attribute__((unused)) char *argv[]) {}


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

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

LLVM IR (-O0):
define void @_M2_bagatelle_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_bagatelle_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_grid_great_circle_area(int const *, int const *,
                                              double const *, double const *,
                                              double const *, double *);
void get_grid_great_circle_area_(const int *nlon, const int *nlat,
                                 const double *x, const double *y,
                                 const double *z, double *area) {
  get_grid_great_circle_area(nlon, nlat, x, y, z, area);
}


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

x86 assembly (clang, -O2):
<get_grid_great_circle_area_>:
jmp    1030 <get_grid_great_circle_area@plt>

LLVM IR (-O0):
define void @get_grid_great_circle_area_(i32* %0, i32* %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
store i32* %0, i32** %7
store i32* %1, i32** %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = load double*, double** %9
%16 = load double*, double** %10
%17 = load double*, double** %11
%18 = load double*, double** %12
%19 = call i32 @get_grid_great_circle_area(i32* %13, i32* %14, double* %15, double* %16, double* %17, double* %18)
ret void
}

LLVM IR (-O2):
define void @get_grid_great_circle_area_(i32* %0, i32* %1, double* %2, double* %3, double* %4, double* %5) {
%7 = tail call i32 @get_grid_great_circle_area(i32* %0, i32* %1, double* %2, double* %3, double* %4, double* %5)
ret void
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int iswcntrl(wint_t wc) {
  return (wc >= 0 && wc < 128 ? (wc & ~0x1f) == 0 || wc == 0x7f : 0);
}


x86 assembly (clang, -O0):
<iswcntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     114c <iswcntrl+0x4c>
cmpl   $0x80,-0x4(%rbp)
jge    114c <iswcntrl+0x4c>
mov    -0x4(%rbp),%ecx
and    $0xffffffe0,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
je     113c <iswcntrl+0x3c>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <iswcntrl+0x56>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1156 <iswcntrl+0x56>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswcntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iswcntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, -32
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 127
br label %15
15: ; preds = %12, %8
%16 = phi i1 [ true, %8 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
br label %19
18: ; preds = %5, %1
br label %19
19: ; preds = %18, %15
%20 = phi i32 [ %17, %15 ], [ 0, %18 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @iswcntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleRegisterRequest() { printf("Function unimplemented!\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Function unimplemented!\0A\00"
define void @handleRegisterRequest() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Function unimplemented!\00"
define void @handleRegisterRequest() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
void sort(int array[], int size) { qsort(array, 0, size - 1); }


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

x86 assembly (clang, -O2):
<sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <qsort@plt>

LLVM IR (-O0):
define void @sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @qsort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @qsort(i32* %0, i32 0, i32 %3)
ret void
}