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

/* Variables and functions */
scalar_t__ usb_endpoint_dir_out(struct usb_endpoint_descriptor const *);
scalar_t__ usb_endpoint_xfer_isoc(struct usb_endpoint_descriptor const *);
int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd) {
  return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd));
}


x86 assembly (clang, -O0):
<usb_endpoint_is_isoc_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <usb_endpoint_xfer_isoc@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <usb_endpoint_is_isoc_out+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <usb_endpoint_dir_out@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_endpoint_is_isoc_out>:
push   %rbx
mov    %rdi,%rbx
call   1040 <usb_endpoint_xfer_isoc@plt>
test   %rax,%rax
je     1143 <usb_endpoint_is_isoc_out+0x23>
mov    %rbx,%rdi
call   1030 <usb_endpoint_dir_out@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_isoc_out(%struct.usb_endpoint_descriptor* %0) {
%2 = alloca %struct.usb_endpoint_descriptor*
store %struct.usb_endpoint_descriptor* %0, %struct.usb_endpoint_descriptor** %2
%3 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%4 = call i64 @usb_endpoint_xfer_isoc(%struct.usb_endpoint_descriptor* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.usb_endpoint_descriptor*, %struct.usb_endpoint_descriptor** %2
%8 = call i64 @usb_endpoint_dir_out(%struct.usb_endpoint_descriptor* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.usb_endpoint_descriptor = type { i32 }
define i32 @usb_endpoint_is_isoc_out(%struct.usb_endpoint_descriptor* %0) {
%2 = tail call i64 @usb_endpoint_xfer_isoc(%struct.usb_endpoint_descriptor* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @usb_endpoint_dir_out(%struct.usb_endpoint_descriptor* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int m;
  int n;
  if (!(m >= 0 && m <= n - 1 && x == 0))
    return 0;
  while (x <= n - 1) {
    x++;
    if (x > m)
      m++;
  }
  assert(m <= n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1144 <main+0x34>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1144 <main+0x34>
cmpl   $0x0,-0x8(%rbp)
je     1150 <main+0x40>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <main+0x93>
jmp    1155 <main+0x45>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1189 <main+0x79>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1184 <main+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <main+0x45>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = icmp sle i32 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %12, %7, %0
store i32 0, i32* %1
br label %38
16: ; preds = %12
br label %17
17: ; preds = %31, %16
%18 = load i32, i32* %2
%19 = load i32, i32* %4
%20 = sub nsw i32 %19, 1
%21 = icmp sle i32 %18, %20
br i1 %21, label %22, label %32
22: ; preds = %17
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = icmp sgt i32 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %22
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %31
31: ; preds = %28, %22
br label %17
32: ; preds = %17
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = icmp sle i32 %33, %34
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
store i32 0, i32* %1
br label %38
38: ; preds = %32, %15
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_decim_sac(char *arg) {
  fprintf(stderr, "Syntax: %s  i_sac_file_name o_dir [o_sac_file_name]\n", arg);
  exit(1);
}


x86 assembly (clang, -O0):
<error_decim_sac>:
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_decim_sac>:
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 = [53 x i8] c"Syntax: %s i_sac_file_name o_dir [o_sac_file_name]\0A\00"
define void @error_decim_sac(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 ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Syntax: %s i_sac_file_name o_dir [o_sac_file_name]\0A\00"
define void @error_decim_sac(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
unsigned long long strtoull(char const *, int /*<<< orphan*/ *, int);
unsigned long long fromhex(const char *s) { return (strtoull(s, NULL, 16)); }


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

x86 assembly (clang, -O2):
<fromhex>:
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <strtoull@plt>

LLVM IR (-O0):
define i64 @fromhex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtoull(i8* %3, i32* null, i32 16)
ret i64 %4
}

LLVM IR (-O2):
define i64 @fromhex(i8* nocapture %0) {
%2 = tail call i64 @strtoull(i8* nocapture %0, i32* null, i32 16)
ret i64 %2
}
char *langRomTypeTheCastle() { return "The Castle"; }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"The Castle\00"
define i8* @langRomTypeTheCastle() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
int XSetWMProtocols() {}


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

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

LLVM IR (-O0):
define i32 @XSetWMProtocols() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetWMProtocols() {
ret i32 undef
}
int is_space(char character) {
  int temp_ascii = (int)character;
  if (temp_ascii == 32) {
    return 7;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jne    1127 <is_space+0x27>
movl   $0x7,-0x4(%rbp)
jmp    112e <is_space+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
xor    %ecx,%ecx
cmp    $0x20,%dil
mov    $0x7,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 7, 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):
define i32 @is_space(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = select i1 %2, i32 7, i32 0
ret i32 %3
}
unsigned long TimerCounterGet(unsigned long ulBase) {

  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000024))));
}


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

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

LLVM IR (-O0):
define i64 @TimerCounterGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 36
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @TimerCounterGet(i64 %0) {
%2 = add i64 %0, 36
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char const *, int);
void copy_string(char *dst, const char *src, int dstsiz) {
  dst[0] = '\0';
  strncat(dst, src, dstsiz - 1);
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
movb   $0x0,(%rdi)
add    $0xffffffff,%edx
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define void @copy_string(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 0, i8* %8
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = call i32 @strncat(i8* %9, i8* %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @copy_string(i8* %0, i8* %1, i32 %2) {
store i8 0, i8* %0
%4 = add nsw i32 %2, -1
%5 = tail call i32 @strncat(i8* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ strcasecmp(char const *, char const *);
int seatest_is_string_equal_i(const char *s1, const char *s2) {
  return strcasecmp(s1, s2) == 0;
}


x86 assembly (clang, -O0):
<seatest_is_string_equal_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @seatest_is_string_equal_i(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ curses_done();
int /*<<< orphan*/ free_functions();
int /*<<< orphan*/ kernel_done();
void game_done(void) {
  free_functions();
  curses_done();
  kernel_done();
}


x86 assembly (clang, -O0):
<game_done>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <free_functions@plt>
mov    $0x0,%al
call   1050 <curses_done@plt>
mov    $0x0,%al
call   1040 <kernel_done@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_done>:
push   %rax
xor    %eax,%eax
call   1030 <free_functions@plt>
xor    %eax,%eax
call   1050 <curses_done@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <kernel_done@plt>

LLVM IR (-O0):
define void @game_done() {
%1 = call i32 (...) @free_functions()
%2 = call i32 (...) @curses_done()
%3 = call i32 (...) @kernel_done()
ret void
}

LLVM IR (-O2):
define void @game_done() {
%1 = tail call i32 (...) @free_functions()
%2 = tail call i32 (...) @curses_done()
%3 = tail call i32 (...) @kernel_done()
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
long long new_gettime(void) {
  struct timeval tv;
  int ret;
  ret = gettimeofday(&tv, 0);
  if (ret < 0) {
    perror("get time of day\n");
    exit(1);
  }
  return ((long long)tv.tv_usec + ((long long)tv.tv_sec) * 1000000LL);
}


x86 assembly (clang, -O0):
<new_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1166 <new_gettime+0x36>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,-0x10(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %eax,%eax
js     1157 <new_gettime+0x27>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [17 x i8] c"get time of day\0A\00"
define i64 @new_gettime() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%13 = load i64, i64* %12
%14 = mul nsw i64 %13, 1000000
%15 = add nsw i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [17 x i8] c"get time of day\0A\00"
define i64 @new_gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%12 = load i64, i64* %11
%13 = mul nsw i64 %12, 1000000
%14 = add nsw i64 %13, %10
ret i64 %14
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_position_mask_fu(void) {
  char ctrl_reg2 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1C, &ctrl_reg2, 1) == 0) {
    ctrl_reg2 |= 0x01;
    KIONIX_ACCEL_write_byte(0x1C, ctrl_reg2);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_position_mask_fu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1c,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116d <KIONIX_ACCEL_position_mask_fu+0x4d>
movsbl -0x1(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x1(%rbp)
mov    $0x1c,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1174 <KIONIX_ACCEL_position_mask_fu+0x54>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_position_mask_fu>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1c,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_position_mask_fu+0x41>
movsbl 0xf(%rsp),%esi
or     $0x1,%esi
mov    %sil,0xf(%rsp)
mov    $0x1c,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_position_mask_fu() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = or i32 %7, 1
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_position_mask_fu() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 28, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = or i8 %5, 1
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 28, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gen_pop();
int /*<<< orphan*/ output_line(char *);
void gen_sub(void) {
  gen_pop();
  output_line("ex de,hl");
  output_line("or a");
  output_line("sbc hl,de");
}


x86 assembly (clang, -O0):
<gen_sub>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <output_line@plt>
lea    0xecb(%rip),%rdi
call   1040 <output_line@plt>
lea    0xec4(%rip),%rdi
call   1040 <output_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_sub>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
call   1040 <output_line@plt>
lea    0xece(%rip),%rdi
call   1040 <output_line@plt>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <output_line@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ex de,hl\00"
@.str.1 = [5 x i8] c"or a\00"
@.str.2 = [10 x i8] c"sbc hl,de\00"
define void @gen_sub() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ex de,hl\00"
@.str.1 = [5 x i8] c"or a\00"
@.str.2 = [10 x i8] c"sbc hl,de\00"
define void @gen_sub() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void XQueryPointer() {}


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

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

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

LLVM IR (-O2):
define void @XQueryPointer() {
ret void
}
void nop(char *s, ...) {}


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

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

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

LLVM IR (-O2):
define void @nop(i8* nocapture %0, ...) {
ret void
}
__attribute__((no, noclone)) void foo(void *p, const void *q) {
  *(long int *)p = *(const long int *)q;
}


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

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

LLVM IR (-O0):
define void @foo(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i64*
store i64 %7, i64* %9
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %0 to i64*
store i64 %4, i64* %5
ret void
}
void _gfortran_caf_sync_images(int count __attribute__((unused)),
                               int images[] __attribute__((unused)), int *stat,
                               char *errmsg __attribute__((unused)),
                               int errmsg_len __attribute__((unused))) {
  __asm__ __volatile__("" ::: "memory");
  if (stat)
    *stat = 0;
}


x86 assembly (clang, -O0):
<_gfortran_caf_sync_images>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     112c <_gfortran_caf_sync_images+0x2c>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gfortran_caf_sync_images>:
test   %rdx,%rdx
je     110b <_gfortran_caf_sync_images+0xb>
movl   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define void @_gfortran_caf_sync_images(i32 %0, i32* nocapture readnone %1, i32* writeonly %2, i8* nocapture readnone %3, i32 %4) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%6 = icmp eq i32* %2, null
br i1 %6, label %8, label %7
7: ; preds = %5
store i32 0, i32* %2
br label %8
8: ; preds = %7, %5
ret void
}
use_a(struct a *a) {}


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

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

LLVM IR (-O0):
%struct.a = type opaque
define i32 @use_a(%struct.a* %0) {
%2 = alloca i32
%3 = alloca %struct.a*
store %struct.a* %0, %struct.a** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.a = type opaque
define i32 @use_a(%struct.a* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArr(int *arr, int length) {
  int i = 0;
  for (i = 0; i < length; i++) {
    printf("%3d ", arr[i]);
  }
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <printArr+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <printArr+0x1d>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%3d \00"
define void @printArr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
float vector3d_modulus(float *);
void vector3d_normalize(float *vector) {
  static float R;
  R = vector3d_modulus(vector);
  vector[0] /= R;
  vector[1] /= R;
  vector[2] /= R;
}


x86 assembly (clang, -O0):
<vector3d_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vector3d_modulus@plt>
movss  %xmm0,0x2eff(%rip)
movss  0x2ef7(%rip),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax)
movss  0x2edf(%rip),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
movss  0x2ec5(%rip),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector3d_normalize>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vector3d_modulus@plt>
movss  (%rbx),%xmm1
movss  0x4(%rbx),%xmm2
divss  %xmm0,%xmm1
movss  %xmm1,(%rbx)
divss  %xmm0,%xmm2
movss  %xmm2,0x4(%rbx)
movss  0x8(%rbx),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@vector3d_normalize.R = internal global float 0.000000e+00
define void @vector3d_normalize(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call float @vector3d_modulus(float* %3)
store float %4, float* @vector3d_normalize.R
%5 = load float, float* @vector3d_normalize.R
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fdiv float %8, %5
store float %9, float* %7
%10 = load float, float* @vector3d_normalize.R
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fdiv float %13, %10
store float %14, float* %12
%15 = load float, float* @vector3d_normalize.R
%16 = load float*, float** %2
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fdiv float %18, %15
store float %19, float* %17
ret void
}

LLVM IR (-O2):
define void @vector3d_normalize(float* %0) {
%2 = tail call float @vector3d_modulus(float* %0)
%3 = load float, float* %0
%4 = fdiv float %3, %2
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fdiv float %6, %2
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fdiv float %9, %2
store float %10, float* %8
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
scalar_t__ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/,
                  int /*<<< orphan*/, struct timeval *);
int waitForChar(void) {
  fd_set fdMask;
  struct timeval tvWait;
  tvWait.tv_sec = 1;
  tvWait.tv_usec = 0;
  FD_SET(0, &fdMask);
  if (select(32, &fdMask, 0, 0, &tvWait) == 0) {
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<waitForChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1040 <FD_SET@plt>
mov    $0x20,%edi
lea    -0x8(%rbp),%rsi
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
mov    %ecx,%edx
call   1030 <select@plt>
cmp    $0x0,%rax
jne    116e <waitForChar+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1175 <waitForChar+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForChar>:
push   %rbx
sub    $0x20,%rsp
movl   $0x1,0x10(%rsp)
movq   $0x0,0x18(%rsp)
lea    0xc(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <FD_SET@plt>
lea    0x10(%rsp),%r8
mov    $0x20,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @waitForChar() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %6
%7 = call i32 @FD_SET(i32 0, i32* %1)
%8 = call i64 @select(i32 32, i32* %1, i32 0, i32 0, %struct.timeval* %2)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
struct iommu_group {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int iommu_group_id(struct iommu_group *group) { return -ENODEV; }


x86 assembly (clang, -O0):
<iommu_group_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iommu_group_id>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_id(%struct.iommu_group* %0) {
%2 = alloca %struct.iommu_group*
store %struct.iommu_group* %0, %struct.iommu_group** %2
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.iommu_group = type { i32 }
@ENODEV = global i32 0
define i32 @iommu_group_id(%struct.iommu_group* nocapture readnone %0) {
%2 = load i32, i32* @ENODEV
%3 = sub nsw i32 0, %2
ret i32 %3
}
void gtk_calendar_get_display_options() {}


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

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

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

LLVM IR (-O2):
define void @gtk_calendar_get_display_options() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t ip_get_id(const uint8_t *p_ip) { return (p_ip[4] << 8) | p_ip[5]; }


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

x86 assembly (clang, -O2):
<ip_get_id>:
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ip_get_id(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ip_get_id(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 5
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int vfork();
int main() {
  int pid;
  pid = 1;
  pid = vfork();
  if (pid == 0) {
    printf("I'm the child!\n");
    _exit(0);
  } else {
    printf("I'm the proud parent of child #%d!\n", pid);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
call   1050 <vfork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    116d <main+0x3d>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    -0x8(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1060 <vfork@plt>
test   %eax,%eax
je     1160 <main+0x20>
mov    %eax,%esi
lea    0xead(%rip),%rdi
xor    %ebx,%ebx
mov    %ebx,%eax
call   1050 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"I'm the child!\0A\00"
@.str.1 = [36 x i8] c"I'm the proud parent of child #%d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i32 @vfork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @_exit(i32 0)
unreachable
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"I'm the proud parent of child #%d!\0A\00"
@str = [15 x i8] c"I'm the child!\00"
define i32 @main() {
%1 = call i32 @vfork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = call i32 @_exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int LINUX_VERSION_CODE;
int /*<<< orphan*/ printf(char *, int);
int main(int argc __attribute__((unused)),
         char **argv __attribute__((unused))) {
  printf("LINUX_VERSION_CODE = %x\n", LINUX_VERSION_CODE);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"LINUX_VERSION_CODE = %x\0A\00"
@LINUX_VERSION_CODE = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @LINUX_VERSION_CODE
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_add_network(struct wpa_ctrl *ctrl, int argc,
                            const char *argv[]) {
  return wpa_ctrl_command(ctrl, "ADD_NETWORK");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_add_network>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_add_network>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"ADD_NETWORK\00"
define i32 @wpa_cli_cmd_add_network(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"ADD_NETWORK\00"
define i32 @wpa_cli_cmd_add_network(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
long long __builtin_wasm_trunc_saturate_u_i64_f64(double);
long long trunc_saturate_u_i64_f64(double f) {
  return __builtin_wasm_trunc_saturate_u_i64_f64(f);
}


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

x86 assembly (clang, -O2):
<trunc_saturate_u_i64_f64>:
jmp    1030 <__builtin_wasm_trunc_saturate_u_i64_f64@plt>

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

LLVM IR (-O2):
define i64 @trunc_saturate_u_i64_f64(double %0) {
%2 = tail call i64 @__builtin_wasm_trunc_saturate_u_i64_f64(double %0)
ret i64 %2
}
unsigned RORc(unsigned word, const int i) {
  asm("rorl %%cl,%0" : "=r"(word) : "0"(word), "c"(i));
  return word;
}


x86 assembly (clang, -O0):
<RORc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
ror    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RORc>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @RORc(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 asm "rorl %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @RORc(i32 %0, i32 %1) {
%3 = tail call i32 asm "rorl %cl,$0", "=r,0,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, unsigned long long);
unsigned long long rdtsc();
int main(int argc, char *argv[]) {
  unsigned long long a, b;
  char *p;
  a = rdtsc();
  p = (char *)malloc((1024 * 4));
  b = rdtsc();
  b = b - a;
  printf("cycles spent in allocating %d bytes of memory: %llu\n", (1024 * 4),
         b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
lea    0xe7f(%rip),%rdi
mov    $0x1000,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%rbx
mov    $0x1000,%edi
call   1050 <malloc@plt>
xor    %eax,%eax
call   1040 <rdtsc@plt>
sub    %rbx,%rax
lea    0xeaa(%rip),%rdi
mov    $0x1000,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"cycles spent in allocating %d bytes of memory: %llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i64 (...) @rdtsc()
store i64 %9, i64* %6
%10 = call i64 @malloc(i32 4096)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %8
%12 = call i64 (...) @rdtsc()
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %6
%15 = sub i64 %13, %14
store i64 %15, i64* %7
%16 = load i64, i64* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 4096, i64 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"cycles spent in allocating %d bytes of memory: %llu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @rdtsc()
%4 = tail call i64 @malloc(i32 4096)
%5 = tail call i64 (...) @rdtsc()
%6 = sub i64 %5, %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 4096, i64 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void write32(unsigned long addr, uint32_t value) {
  *((volatile uint32_t *)(addr)) = value;
}


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

x86 assembly (clang, -O2):
<write32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @write32(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @write32(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ expression();
int /*<<< orphan*/ match(char);
void greater() {
  match('>');
  expression();
  emitln("pop\t%%ebx");
  emitln("cmp\t%%eax,%%ebx");
  emitln("setg\t%%al");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


x86 assembly (clang, -O0):
<greater>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%edi
call   1050 <match@plt>
mov    $0x0,%al
call   1040 <expression@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb2(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb6(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater>:
push   %rax
mov    $0x3e,%edi
call   1050 <match@plt>
xor    %eax,%eax
call   1040 <expression@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb5(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb9(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"cmp\09%%eax,%%ebx\00"
@.str.2 = [10 x i8] c"setg\09%%al\00"
@.str.3 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @greater() {
%1 = call i32 @match(i8 signext 62)
%2 = call i32 (...) @expression()
%3 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"cmp\09%%eax,%%ebx\00"
@.str.2 = [10 x i8] c"setg\09%%al\00"
@.str.3 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @greater() {
%1 = tail call i32 @match(i8 signext 62)
%2 = tail call i32 (...) @expression()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
void j() { (void)malloc(11); }


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

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

LLVM IR (-O0):
define void @j() {
%1 = call i32 @malloc(i32 11)
ret void
}

LLVM IR (-O2):
define void @j() {
%1 = tail call i32 @malloc(i32 11)
ret void
}