xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isgraph(int /*<<< orphan*/);
int is_empty_substr(const char *s, size_t count) {
  while (count--) {
    if (isgraph(*s++))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_empty_substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     116b <is_empty_substr+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <isgraph@plt>
cmp    $0x0,%rax
je     1166 <is_empty_substr+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1172 <is_empty_substr+0x62>
jmp    1120 <is_empty_substr+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty_substr>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   (%rax)
cmp    %rbx,%r15
je     113c <is_empty_substr+0x2c>
movsbl (%r14,%rbx,1),%edi
call   1030 <isgraph@plt>
add    $0x1,%rbx
test   %rax,%rax
je     1120 <is_empty_substr+0x10>
xor    %eax,%eax
jmp    1141 <is_empty_substr+0x31>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @is_empty_substr(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %9, %7 ]
%5 = phi i64 [ %1, %2 ], [ %8, %7 ]
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %3
%8 = add i64 %5, -1
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = tail call i64 @isgraph(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %3, label %14
14: ; preds = %3, %7
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %15
}
int readval(str, m)
char *str;
int m;
{
  if (str[0] == 'M')
    return (m);
  if (str[0] == '-' && str[1] == 'M')
    return (-m);
  return (atoi(str));
}


x86 assembly (clang, -O0):
<readval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x4d,%eax
jne    113a <readval+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <readval+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1168 <readval+0x58>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x4d,%eax
jne    1168 <readval+0x58>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <readval+0x66>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readval>:
mov    (%rdi),%al
cmp    $0x4d,%al
je     1122 <readval+0x12>
cmp    $0x2d,%al
jne    1125 <readval+0x15>
cmpb   $0x4d,0x1(%rdi)
jne    1125 <readval+0x15>
neg    %esi
mov    %esi,%eax
ret
xor    %eax,%eax
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @readval(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 77
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %31
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 77
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i32, i32* %5
%27 = sub nsw i32 0, %26
store i32 %27, i32* %3
br label %31
28: ; preds = %19, %13
%29 = load i8*, i8** %4
%30 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %29)
store i32 %30, i32* %3
br label %31
31: ; preds = %28, %25, %11
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @readval(i8* %0, i32 %1) {
%3 = load i8, i8* %0
switch i8 %3, label %10 [
i8 77, label %12
i8 45, label %4
]
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 77
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = sub nsw i32 0, %1
br label %12
10: ; preds = %2, %4
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0)
br label %12
12: ; preds = %2, %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ], [ %1, %2 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
bool_t clntraw_control(CLIENT *x, int x1, char *x2) { return (FALSE); }


x86 assembly (clang, -O0):
<clntraw_control>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clntraw_control>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @clntraw_control(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @FALSE
ret i32 %7
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @clntraw_control(i32* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @FALSE
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *allocate_bytes(size_t nbytes) { return malloc(nbytes); }


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

x86 assembly (clang, -O2):
<allocate_bytes>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @allocate_bytes(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ uninitmouse();
void MOUSE_Shutdown(void) { uninitmouse(); }


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

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

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

LLVM IR (-O2):
define void @MOUSE_Shutdown() {
%1 = tail call i32 (...) @uninitmouse()
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print_line_int16_t(uint32_t i, uint32_t j, int16_t v, int magma) {
  if (magma)
    printf("A[%u,%u]:=%d;\n", i, j, v);
  else
    printf("%u %u %d\n", i, j, v);
}


x86 assembly (clang, -O0):
<print_line_int16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1148 <print_line_int16_t+0x38>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <print_line_int16_t+0x4d>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line_int16_t>:
mov    %edx,%eax
mov    %esi,%edx
mov    %edi,%esi
test   %ecx,%ecx
lea    0xef0(%rip),%rcx
lea    0xeda(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"A[%u,%u]:=%d;\0A\00"
@.str.1 = [10 x i8] c"%u %u %d\0A\00"
define void @print_line_int16_t(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int fseek(FILE *stream __attribute__((unused)),
          long offset __attribute__((unused)),
          int whence __attribute__((unused))) {
  printf("fseek\n");
  errno = EBADF;
  return 0;
}


x86 assembly (clang, -O0):
<fseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea1(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
@str = [6 x i8] c"fseek\00"
define i32 @fseek(i32* nocapture readnone %0, i64 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @EBADF
store i32 %5, i32* @errno
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int i2c_write_leuint08(int, int, int, int);
int km2_cfg_set_address(int bus, int chip_addr, uint8_t new_addr) {
  return i2c_write_leuint08(bus, chip_addr, 0xFF, ((new_addr) << 1) | (0x01));
}


x86 assembly (clang, -O0):
<km2_cfg_set_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
or     $0x1,%ecx
mov    $0xff,%edx
call   1030 <i2c_write_leuint08@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<km2_cfg_set_address>:
lea    (%rdx,%rdx,1),%ecx
add    $0x1,%ecx
mov    $0xff,%edx
jmp    1030 <i2c_write_leuint08@plt>

LLVM IR (-O0):
define i32 @km2_cfg_set_address(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = shl i32 %9, 1
%11 = or i32 %10, 1
%12 = call i32 @i2c_write_leuint08(i32 %7, i32 %8, i32 255, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @km2_cfg_set_address(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 1
%5 = or i32 %4, 1
%6 = tail call i32 @i2c_write_leuint08(i32 %0, i32 %1, i32 255, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_BLUE;
int /*<<< orphan*/ ChangeColor(int /*<<< orphan*/);
void SetColorBlue() { ChangeColor(COLOR_BLUE); }


x86 assembly (clang, -O0):
<SetColorBlue>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <ChangeColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetColorBlue>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ChangeColor@plt>

LLVM IR (-O0):
@COLOR_BLUE = global i32 0
define void @SetColorBlue() {
%1 = load i32, i32* @COLOR_BLUE
%2 = call i32 @ChangeColor(i32 %1)
ret void
}

LLVM IR (-O2):
@COLOR_BLUE = global i32 0
define void @SetColorBlue() {
%1 = load i32, i32* @COLOR_BLUE
%2 = tail call i32 @ChangeColor(i32 %1)
ret void
}
/* Type definitions */
struct S {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ foo(int, int, struct S *);
void __attribute__((no)) bar(int x, int z, struct S *p) { foo(z, x, p); }


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

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
%struct.S = type { i32 }
define void @bar(i32 %0, i32 %1, %struct.S* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.S*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.S* %2, %struct.S** %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load %struct.S*, %struct.S** %6
%10 = call i32 @foo(i32 %7, i32 %8, %struct.S* %9)
ret void
}

LLVM IR (-O2):
%struct.S = type { i32 }
define void @bar(i32 %0, i32 %1, %struct.S* %2) {
%4 = tail call i32 @foo(i32 %1, i32 %0, %struct.S* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tape_shutdown();
int /*<<< orphan*/ vdrive_shutdown();
void machine_shutdown(void) {
  tape_shutdown();
  vdrive_shutdown();
}


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

x86 assembly (clang, -O2):
<machine_shutdown>:
push   %rax
xor    %eax,%eax
call   1030 <tape_shutdown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <vdrive_shutdown@plt>

LLVM IR (-O0):
define void @machine_shutdown() {
%1 = call i32 (...) @tape_shutdown()
%2 = call i32 (...) @vdrive_shutdown()
ret void
}

LLVM IR (-O2):
define void @machine_shutdown() {
%1 = tail call i32 (...) @tape_shutdown()
%2 = tail call i32 (...) @vdrive_shutdown()
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __syscall(int, int, struct stat *);
int errno;
int _fstat(int file, struct stat *st) {
  int err;
  err = __syscall(22, file, st);
  if (err < 0) {
    errno = -err;
    return -1;
  }
  return err;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x16,%edi
call   1030 <__syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1157 <_fstat+0x47>
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
mov    0x2e97(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <_fstat+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x16,%edi
call   1030 <__syscall@plt>
test   %eax,%eax
js     1126 <_fstat+0x16>
pop    %rcx
ret
neg    %eax
mov    0x2eb1(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
%7 = load i32, i32* %4
%8 = load %struct.stat*, %struct.stat** %5
%9 = call i32 @__syscall(i32 22, i32 %7, %struct.stat* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* %6
%14 = sub nsw i32 0, %13
store i32 %14, i32* @errno
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = tail call i32 @__syscall(i32 22, i32 %0, %struct.stat* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = sub nsw i32 0, %3
store i32 %6, i32* @errno
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ %3, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int child_function() {
  system("ps -aef > /tmp/eg_container_ps.out");
  system("ip a > /tmp/eg_container_ipa.out");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"ps -aef > /tmp/eg_container_ps.out\00"
@.str.1 = [33 x i8] c"ip a > /tmp/eg_container_ipa.out\00"
define i32 @child_function() {
%1 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"ps -aef > /tmp/eg_container_ps.out\00"
@.str.1 = [33 x i8] c"ip a > /tmp/eg_container_ipa.out\00"
define i32 @child_function() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EthernetDisable(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40048000);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000010;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) &= ~(0x00000001);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) &= ~(0x00000001);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<EthernetDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40048000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetDisable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40048000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
orq    $0x10,0x8(%rbx)
andq   $0xfffffffffffffffe,0xc(%rbx)
andq   $0xfffffffffffffffe,0x8(%rbx)
orq    $0x10,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @EthernetDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074036736
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 8
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = or i64 %10, 16
store volatile i64 %11, i64* %9
%12 = load i64, i64* %2
%13 = add i64 %12, 12
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
%16 = and i64 %15, -2
store volatile i64 %16, i64* %14
%17 = load i64, i64* %2
%18 = add i64 %17, 8
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = and i64 %20, -2
store volatile i64 %21, i64* %19
%22 = load i64, i64* %2
%23 = add i64 %22, 8
%24 = inttoptr i64 %23 to i64*
%25 = load volatile i64, i64* %24
%26 = or i64 %25, 16
store volatile i64 %26, i64* %24
ret void
}

LLVM IR (-O2):
define void @EthernetDisable(i64 %0) {
%2 = icmp eq i64 %0, 1074036736
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 8
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, 16
store volatile i64 %8, i64* %6
%9 = add i64 %0, 12
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -2
store volatile i64 %12, i64* %10
%13 = load volatile i64, i64* %6
%14 = and i64 %13, -2
store volatile i64 %14, i64* %6
%15 = load volatile i64, i64* %6
%16 = or i64 %15, 16
store volatile i64 %16, i64* %6
ret void
}
int PDMCCompare5(P, PDMCQStruct)
struct Person **P;
struct StudentWithNameStruct *PDMCQStruct;
{
  if ((AccessPersonMsc(P) & 3) == 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<PDMCCompare5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <AccessPersonMsc@plt>
and    $0x3,%eax
cmp    $0x0,%eax
jne    1143 <PDMCCompare5+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <PDMCCompare5+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDMCCompare5>:
push   %rax
xor    %eax,%eax
call   1030 <AccessPersonMsc@plt>
and    $0x3,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Person = type opaque
%struct.StudentWithNameStruct = type opaque
define i32 @PDMCCompare5(%struct.Person** %0, %struct.StudentWithNameStruct* %1) {
%3 = alloca i32
%4 = alloca %struct.Person**
%5 = alloca %struct.StudentWithNameStruct*
store %struct.Person** %0, %struct.Person*** %4
store %struct.StudentWithNameStruct* %1, %struct.StudentWithNameStruct** %5
%6 = load %struct.Person**, %struct.Person*** %4
%7 = call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonMsc to i32 (%struct.Person**, ...)*)(%struct.Person** %6)
%8 = and i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.Person = type opaque
%struct.StudentWithNameStruct = type opaque
define i32 @PDMCCompare5(%struct.Person** %0, %struct.StudentWithNameStruct* nocapture readnone %1) {
%3 = tail call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonMsc to i32 (%struct.Person**, ...)*)(%struct.Person** %0)
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *name) {
  fprintf(stderr, "%s: [<options>] <ptfile>.  Use --help or -h for help.\n",
          name);
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"%s: [<options>] <ptfile>. Use --help or -h for help.\0A\00"
define i32 @usage(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 ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"%s: [<options>] <ptfile>. Use --help or -h for help.\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
g(int x[]) { return x[0]; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
double fat(double a) {
  if (a > 0)
    return a * fat(a - 1);
  else
    return 1;
}


x86 assembly (clang, -O0):
<fat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1165 <fat+0x55>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <fat@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1172 <fat+0x62>
movsd  0xe93(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    113c <fat+0x2c>
movsd  0xee1(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <fat@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xebc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fat(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fsub double %8, 1.000000e+00
%10 = call double @fat(double %9)
%11 = fmul double %7, %10
store double %11, double* %2
br label %13
12: ; preds = %1
store double 1.000000e+00, double* %2
br label %13
13: ; preds = %12, %6
%14 = load double, double* %2
ret double %14
}

LLVM IR (-O2):
define double @fat(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi double [ %8, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -1.000000e+00
%7 = tail call double @fat(double %6)
%8 = fmul double %7, %0
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M375_f(char *s) {
  debug("M375_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M375_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M375_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M375_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M375_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M375_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M375_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void output_current_time(FILE *fp) {
  char d[64];
  time_t t;
  t = time(NULL);
  strftime(d, sizeof(d), "%m/%d %H:%M:%S", localtime(&t));
  fprintf(fp, "%s", d);
}


x86 assembly (clang, -O0):
<output_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x54(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x54(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%ecx
mov    $0x40,%esi
lea    0xe85(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe80(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_current_time>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%r14
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe9a(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %eax,%ecx
call   1060 <strftime@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%m/%d %H:%M:%S\00"
@.str.1 = [3 x i8] c"%s\00"
define void @output_current_time(i32* %0) {
%2 = alloca i32*
%3 = alloca [64 x i8]
%4 = alloca i32
store i32* %0, i32** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = call i32 @localtime(i32* %4)
%8 = call i32 @strftime(i8* %6, i32 64, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%m/%d %H:%M:%S\00"
define void @output_current_time(i32* nocapture %0) {
%2 = alloca [64 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 @time(i32* null)
store i32 %6, i32* %3
%7 = call i32 @localtime(i32* %3)
%8 = call i32 @strftime(i8* %4, i32 64, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @fputs(i8* %4, i32* %0)
ret void
}
void foo119() {}


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

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

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

LLVM IR (-O2):
define void @foo119() {
ret void
}
/* Type definitions */
struct bee_client {
  int dummy;
};

/* Variables and functions */
struct bee_client *bee_cli_seek(char *, int);
struct bee_client *bee_client_get(char *id, int fd) {
  if (fd > 0) {
    return bee_cli_seek(NULL, fd);
  }
  if (id) {
    return bee_cli_seek(id, -1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<bee_client_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    113e <bee_client_get+0x2e>
mov    -0x14(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <bee_cli_seek@plt>
mov    %rax,-0x8(%rbp)
jmp    1168 <bee_client_get+0x58>
cmpq   $0x0,-0x10(%rbp)
je     1160 <bee_client_get+0x50>
mov    -0x10(%rbp),%rdi
mov    $0xffffffff,%esi
call   1030 <bee_cli_seek@plt>
mov    %rax,-0x8(%rbp)
jmp    1168 <bee_client_get+0x58>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bee_client_get>:
test   %esi,%esi
jle    111b <bee_client_get+0xb>
xor    %edi,%edi
jmp    1030 <bee_cli_seek@plt>
test   %rdi,%rdi
je     112a <bee_client_get+0x1a>
mov    $0xffffffff,%esi
jmp    1030 <bee_cli_seek@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.bee_client = type { i32 }
define %struct.bee_client* @bee_client_get(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call %struct.bee_client* @bee_cli_seek(i8* null, i32 %1)
br label %10
6: ; preds = %2
%7 = icmp eq i8* %0, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call %struct.bee_client* @bee_cli_seek(i8* %0, i32 -1)
br label %10
10: ; preds = %6, %8, %4
%11 = phi %struct.bee_client* [ %5, %4 ], [ %9, %8 ], [ null, %6 ]
ret %struct.bee_client* %11
}
/* Variables and functions */
int /*<<< orphan*/ Cdgerv2d(int, int, int, double *, int, int, int);
void wcc_Cdgerv2d(int ConTxt, int m, int n, char *A, int lda, int rsrc,
                  int csrc) {
  Cdgerv2d(ConTxt, m, n, (double *)A, lda, rsrc, csrc);
}


x86 assembly (clang, -O0):
<wcc_Cdgerv2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <Cdgerv2d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_Cdgerv2d>:
jmp    1030 <Cdgerv2d@plt>

LLVM IR (-O0):
define void @wcc_Cdgerv2d(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = bitcast i8* %18 to double*
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = call i32 @Cdgerv2d(i32 %15, i32 %16, i32 %17, double* %19, i32 %20, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
define void @wcc_Cdgerv2d(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = bitcast i8* %3 to double*
%9 = tail call i32 @Cdgerv2d(i32 %0, i32 %1, i32 %2, double* %8, i32 %4, i32 %5, i32 %6)
ret void
}
int irda_init(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @irda_init() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @irda_init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ShowIntData(int data) { printf("%d ", data); }


x86 assembly (clang, -O0):
<ShowIntData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowIntData>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @ShowIntData(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void print_ffArray(Array_p, size) long size;
double *Array_p;
{
  while (size--)
    printf("%f\t", *Array_p++);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print_ffArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115f <print_ffArray+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  (%rax),%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1120 <print_ffArray+0x10>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ffArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1159 <print_ffArray+0x39>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_ffArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_ffArray(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add nsw i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i32 1
store double* %11, double** %3
%12 = load double, double* %10
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %12)
br label %5
14: ; preds = %5
%15 = 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 = [4 x i8] c"%f\09\00"
define void @print_ffArray(double* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi double* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i64 %5, -1
%8 = getelementptr inbounds double, double* %6, i64 1
%9 = load double, double* %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
__typeof__(realloc(1, "")) test_realloc_106(void) { return realloc(1, ""); }


x86 assembly (clang, -O0):
<test_realloc_106>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <realloc@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_realloc_106() {
%1 = call i8* @realloc(i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define noalias i8* @test_realloc_106() {
%1 = tail call i8* @realloc(i8* inttoptr (i64 1 to i8*), i64 ptrtoint ([1 x i8]* @.str to i64))
ret i8* %1
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int sival_int;
};
struct TYPE_5__ {
  TYPE_1__ si_value;
};
typedef TYPE_2__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void handler(int s, siginfo_t *info, void *cntx) {
  printf("recv sig %d, data%d\n", s, info->si_value.sival_int);
}


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

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%eax
mov    (%rsi),%edx
lea    0xee5(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@.str = [21 x i8] c"recv sig %d, data%d\0A\00"
define void @handler(i32 %0, %struct.TYPE_5__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_5__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_5__* %1, %struct.TYPE_5__** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load %struct.TYPE_5__*, %struct.TYPE_5__** %5
%9 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { %struct.TYPE_4__ }
%struct.TYPE_4__ = type { i32 }
@.str = [21 x i8] c"recv sig %d, data%d\0A\00"
define void @handler(i32 %0, %struct.TYPE_5__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %5)
ret void
}
void ARGBMirror() {}


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

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

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

LLVM IR (-O2):
define void @ARGBMirror() {
ret void
}
/* Variables and functions */
double pow(double, double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("%f\n", pow(10.0, 3.0));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @pow(double 1.000000e+01, double 3.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 1.000000e+03)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
double *ShareMallocM1d(int size) {
  double *s = NULL;
  if ((s = (double *)calloc(size, sizeof(double))) == NULL) {
    printf("double * malloc error!\n");
    exit(1);
  }
  return s;
}


x86 assembly (clang, -O0):
<ShareMallocM1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1174 <ShareMallocM1d+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShareMallocM1d>:
push   %rax
mov    $0x8,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     1142 <ShareMallocM1d+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"double * malloc error!\0A\00"
define double* @ShareMallocM1d(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
store double* null, double** %3
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 8)
%6 = inttoptr i64 %5 to double*
store double* %6, double** %3
%7 = icmp eq double* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load double*, double** %3
ret double* %12
}

LLVM IR (-O2):
@str = [23 x i8] c"double * malloc error!\00"
define double* @ShareMallocM1d(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 8)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to double*
ret double* %8
}
/* Variables and functions */
char *xstrdup(char *);
char *null_get_mixer_channel_name() { return xstrdup("FakeMixer"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"FakeMixer\00"
define i8* @null_get_mixer_channel_name() {
%1 = call i8* @xstrdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"FakeMixer\00"
define i8* @null_get_mixer_channel_name() {
%1 = tail call i8* @xstrdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}