xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ allocate_row(int, char **);
int /*<<< orphan*/ draw_trailing_space(int, int, char **);
void draw_init(int floor, int column, char **output, int *row,
               int *small_column) {
  *row = floor * 2;
  *small_column = column * 4;
  allocate_row(*row, output);
  draw_trailing_space(*row, *small_column, output);
}


x86 assembly (clang, -O0):
<draw_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <allocate_row@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <draw_trailing_space@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_init>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r15
add    %edi,%edi
mov    %edi,(%rcx)
shl    $0x2,%esi
mov    %esi,(%r8)
mov    (%rcx),%edi
mov    %rdx,%rsi
call   1030 <allocate_row@plt>
mov    (%rbx),%edi
mov    (%r14),%esi
mov    %r15,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <draw_trailing_space@plt>

LLVM IR (-O0):
define void @draw_init(i32 %0, i32 %1, i8** %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8** %2, i8*** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = mul nsw i32 %11, 2
%13 = load i32*, i32** %9
store i32 %12, i32* %13
%14 = load i32, i32* %7
%15 = mul nsw i32 %14, 4
%16 = load i32*, i32** %10
store i32 %15, i32* %16
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i8**, i8*** %8
%20 = call i32 @allocate_row(i32 %18, i8** %19)
%21 = load i32*, i32** %9
%22 = load i32, i32* %21
%23 = load i32*, i32** %10
%24 = load i32, i32* %23
%25 = load i8**, i8*** %8
%26 = call i32 @draw_trailing_space(i32 %22, i32 %24, i8** %25)
ret void
}

LLVM IR (-O2):
define void @draw_init(i32 %0, i32 %1, i8** %2, i32* nocapture %3, i32* nocapture %4) {
%6 = shl nsw i32 %0, 1
store i32 %6, i32* %3
%7 = shl nsw i32 %1, 2
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = tail call i32 @allocate_row(i32 %8, i8** %2)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = tail call i32 @draw_trailing_space(i32 %10, i32 %11, i8** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printErrorMessage(char *message) { fprintf(stderr, "\n%s", message); }


x86 assembly (clang, -O0):
<printErrorMessage>:
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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printErrorMessage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"\0A%s\00"
define void @printErrorMessage(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"\0A%s\00"
define void @printErrorMessage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(const void *a, const void *b) { return strcmp((char *)a, (char *)b); }


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

x86 assembly (clang, -O2):
<cmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp(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 i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void back_dir(void) {}


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

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

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

LLVM IR (-O2):
define void @back_dir() {
ret void
}
int test_imm_B7uint8_mem(unsigned char *val) {
  return ((*val) & (-0xB7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B7uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff49,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B7uint8_mem>:
testb  $0x49,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B7uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 73
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t mstrlen(char *str) {
  size_t len;
  len = 0;
  while (str[len] != '\0') {
    len += 1;
  }
  return (len);
}


x86 assembly (clang, -O0):
<mstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <mstrlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <mstrlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @mstrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
void *malloc(size_t);
void *cson_malloc(size_t n, char const *descr) { return malloc(n); }


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

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

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

LLVM IR (-O2):
define noalias i8* @cson_malloc(i64 %0, i8* nocapture readnone %1) {
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ shutdownClient();
void onSignal(int signal) {
  shutdownClient();
  exit(0);
}


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

x86 assembly (clang, -O2):
<onSignal>:
push   %rax
xor    %eax,%eax
call   1030 <shutdownClient@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @onSignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @shutdownClient()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @onSignal(i32 %0) {
%2 = tail call i32 (...) @shutdownClient()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int flock(int, int);
int bee_flock_fd(int fd, int operation, int flags) {
  int res;
  res = flock(fd, operation);
  return res;
}


x86 assembly (clang, -O0):
<bee_flock_fd>:
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
call   1030 <flock@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bee_flock_fd>:
jmp    1030 <flock@plt>

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

LLVM IR (-O2):
define i32 @bee_flock_fd(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @flock(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ task1(int *);
int main(int argc, char *argv[]) {
  int a = 5;
  task1(&a);
#pragma omp taskwait
  if (a != 7) {
    fprintf(stderr, "a == %d != 7\n", a);
    abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <task1@plt>
cmpl   $0x7,-0x14(%rbp)
je     117f <main+0x4f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1050 <task1@plt>
mov    0x4(%rsp),%edx
cmp    $0x7,%edx
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"a == %d != 7\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
%7 = call i32 @task1(i32* %6)
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 7
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* %6
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"a == %d != 7\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 5, i32* %3
%5 = call i32 @task1(i32* %3)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 7
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6)
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error_msg(int);
int /*<<< orphan*/ logmsg(int, char *, int /*<<< orphan*/);
int error_log(int level, int e) {
  logmsg(level, "%s", error_msg(e));
  return e;
}


x86 assembly (clang, -O0):
<error_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <error_msg@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xeb8(%rip),%rsi
call   1040 <logmsg@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_log>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <error_msg@plt>
lea    0xecb(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
call   1040 <logmsg@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @error_log(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 @error_msg(i32 %6)
%8 = call i32 @logmsg(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @error_log(i32 %0, i32 returned %1) {
%3 = tail call i32 @error_msg(i32 %1)
%4 = tail call i32 @logmsg(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ eputc(char);
void eputs(char s[]) {
  for (int i = 0; s[i]; i++) {
    eputc(s[i]);
  }
}


x86 assembly (clang, -O0):
<eputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1154 <eputs+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <eputc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <eputs+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <eputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <eputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <eputs+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @eputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @eputc(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ sleep(int);
void gdb_sleep(int *t, int i) {
  sleep(5);
  printf("gdb_check: %i %i\n", *t, i);
}


x86 assembly (clang, -O0):
<gdb_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_sleep>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    (%rbx),%esi
lea    0xec5(%rip),%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"gdb_check: %i %i\0A\00"
define void @gdb_sleep(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @sleep(i32 5)
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"gdb_check: %i %i\0A\00"
define void @gdb_sleep(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @sleep(i32 5)
%4 = load i32, i32* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inmidi_aftertouch(int, int, int);
int libpd_aftertouch(int channel, int value) {
  if (channel < 0)
    return -1;
  if (value < 0 || value > 0x7f)
    return -1;
  inmidi_aftertouch((channel >> 4), (channel & 0x0f), value);
  return 0;
}


x86 assembly (clang, -O0):
<libpd_aftertouch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1134 <libpd_aftertouch+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <libpd_aftertouch+0x5f>
cmpl   $0x0,-0xc(%rbp)
jl     1148 <libpd_aftertouch+0x38>
cmpl   $0x7f,-0xc(%rbp)
jle    1154 <libpd_aftertouch+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <libpd_aftertouch+0x5f>
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
mov    -0x8(%rbp),%esi
and    $0xf,%esi
mov    -0xc(%rbp),%edx
call   1030 <inmidi_aftertouch@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libpd_aftertouch>:
mov    $0xffffffff,%eax
test   %edi,%edi
js     1134 <libpd_aftertouch+0x24>
mov    %esi,%edx
cmp    $0x7f,%esi
ja     1134 <libpd_aftertouch+0x24>
push   %rax
mov    %edi,%esi
shr    $0x4,%edi
and    $0xf,%esi
call   1030 <inmidi_aftertouch@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @libpd_aftertouch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %23
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 127
br i1 %14, label %15, label %16
15: ; preds = %12, %9
store i32 -1, i32* %3
br label %23
16: ; preds = %12
%17 = load i32, i32* %4
%18 = ashr i32 %17, 4
%19 = load i32, i32* %4
%20 = and i32 %19, 15
%21 = load i32, i32* %5
%22 = call i32 @inmidi_aftertouch(i32 %18, i32 %20, i32 %21)
store i32 0, i32* %3
br label %23
23: ; preds = %16, %15, %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @libpd_aftertouch(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = icmp ugt i32 %1, 127
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = lshr i32 %0, 4
%8 = and i32 %0, 15
%9 = tail call i32 @inmidi_aftertouch(i32 %7, i32 %8, i32 %1)
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ 0, %6 ], [ -1, %2 ]
ret i32 %11
}
double calculateExtraSize(int partitions) {
  double x = (double)partitions;
  return (x / (15 + 3 * x)) - 0.058f;
}


x86 assembly (clang, -O0):
<calculateExtraSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee5(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xee1(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateExtraSize>:
cvtsi2sd %edi,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calculateExtraSize(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %7, double 1.500000e+01)
%9 = fdiv double %6, %8
%10 = fsub double %9, 0x3FADB22D00000000
ret double %10
}

LLVM IR (-O2):
define double @calculateExtraSize(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 3.000000e+00, double 1.500000e+01)
%4 = fdiv double %2, %3
%5 = fadd double %4, 0xBFADB22D00000000
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ nrf_drv_radio802154_swi_notify_received(int /*<<< orphan*/ *,
                                                           int /*<<< orphan*/,
                                                           int /*<<< orphan*/);
void nrf_drv_radio802154_notify_received(uint8_t *p_data, int8_t power,
                                         int8_t lqi) {
  nrf_drv_radio802154_swi_notify_received(p_data, power, lqi);
}


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

x86 assembly (clang, -O2):
<nrf_drv_radio802154_notify_received>:
jmp    1030 <nrf_drv_radio802154_swi_notify_received@plt>

LLVM IR (-O0):
define void @nrf_drv_radio802154_notify_received(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 = call i32 @nrf_drv_radio802154_swi_notify_received(i32* %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @nrf_drv_radio802154_notify_received(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @nrf_drv_radio802154_swi_notify_received(i32* %0, i32 %1, i32 %2)
ret void
}
void d2i_PROXY_POLICY(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PROXY_POLICY() {
ret void
}
unsigned f(void) {
  unsigned ret = 3;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ tprintf(char *, char *);
FILE *Fappend(char *filename) {
  FILE *out;
  if ((out = fopen(filename, "a")) == NULL) {
    tprintf("ERROR: The file %s could not opened to write!\n", filename);
    exit(0);
  }
  return (out);
}


x86 assembly (clang, -O0):
<Fappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1171 <Fappend+0x41>
mov    -0x8(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <tprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fappend>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <Fappend+0x17>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <tprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [47 x i8] c"ERROR: The file %s could not opened to write!\0A\00"
define i32* @Fappend(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @tprintf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [47 x i8] c"ERROR: The file %s could not opened to write!\0A\00"
define noalias i32* @Fappend(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @tprintf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ xml_read();
void yahoo_read(void) { xml_read(); }


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

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

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

LLVM IR (-O2):
define void @yahoo_read() {
%1 = tail call i32 (...) @xml_read()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(char const *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
void write_file(const char *fname, const char *buf) {
  FILE *f;
  f = fopen(fname, "w");
  fwrite(buf, strlen(buf), 1, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @write_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fwrite(i8* %8, i32 %10, i32 1, i32* %11)
%13 = load i32*, i32** %5
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @write_file(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @fwrite(i8* %1, i32 %4, i32 1, i32* %3)
%6 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_raw(int *, int *, int /*<<< orphan*/);
void U(int *a, int *b) { U_raw(a, b, 0); }


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

x86 assembly (clang, -O2):
<U>:
xor    %edx,%edx
jmp    1030 <U_raw@plt>

LLVM IR (-O0):
define void @U(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 @U_raw(i32* %5, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @U(i32* %0, i32* %1) {
%3 = tail call i32 @U_raw(i32* %0, i32* %1, i32 0)
ret void
}
/* Variables and functions */
unsigned long get_error_values(int /*<<< orphan*/, char const **, int *,
                               char const **, int *);
unsigned long ERR_peek_error_line_data(const char **file, int *line,
                                       const char **data, int *flags) {
  return (get_error_values(0, file, line, data, flags));
}


x86 assembly (clang, -O0):
<ERR_peek_error_line_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %edi,%edi
call   1030 <get_error_values@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_peek_error_line_data>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <get_error_values@plt>

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

LLVM IR (-O2):
define i64 @ERR_peek_error_line_data(i8** %0, i32* %1, i8** %2, i32* %3) {
%5 = tail call i64 @get_error_values(i32 0, i8** %0, i32* %1, i8** %2, i32* %3)
ret i64 %5
}
int main(int argc, char **argv) {
  asm("int $129");
  exit(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)
int    $0x81
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
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
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void asm sideeffect "int $$129", "~{dirflag},~{fpsr},~{flags}"()
tail call void @exit(i32 0)
unreachable
}
int consoleGetState(void) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @consoleGetState() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sha204p_set_device_id(int);
int /*<<< orphan*/ sha204p_sleep();
void sha204e_sleep() {
  sha204p_set_device_id((0xCA));
  (void)sha204p_sleep();
  sha204p_set_device_id((0xC8));
  (void)sha204p_sleep();
}


x86 assembly (clang, -O0):
<sha204e_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0xca,%edi
call   1030 <sha204p_set_device_id@plt>
mov    $0x0,%al
call   1040 <sha204p_sleep@plt>
mov    $0xc8,%edi
call   1030 <sha204p_set_device_id@plt>
mov    $0x0,%al
call   1040 <sha204p_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha204e_sleep>:
push   %rax
mov    $0xca,%edi
call   1030 <sha204p_set_device_id@plt>
xor    %eax,%eax
call   1040 <sha204p_sleep@plt>
mov    $0xc8,%edi
call   1030 <sha204p_set_device_id@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sha204p_sleep@plt>

LLVM IR (-O0):
define void @sha204e_sleep() {
%1 = call i32 @sha204p_set_device_id(i32 202)
%2 = call i32 (...) @sha204p_sleep()
%3 = call i32 @sha204p_set_device_id(i32 200)
%4 = call i32 (...) @sha204p_sleep()
ret void
}

LLVM IR (-O2):
define void @sha204e_sleep() {
%1 = tail call i32 @sha204p_set_device_id(i32 202)
%2 = tail call i32 (...) @sha204p_sleep()
%3 = tail call i32 @sha204p_set_device_id(i32 200)
%4 = tail call i32 (...) @sha204p_sleep()
ret void
}
char *ClearBeg(register char *cp) {
  while (*cp++ < 33)
    ;
  return (--cp);
}


x86 assembly (clang, -O0):
<ClearBeg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x21,%eax
jge    1128 <ClearBeg+0x28>
jmp    1108 <ClearBeg+0x8>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @ClearBeg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 33
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 -1
store i8* %12, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @ClearBeg(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp slt i8 %5, 33
br i1 %6, label %2, label %7
7: ; preds = %2
ret i8* %3
}
void interrupt_low() {}


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

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

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

LLVM IR (-O2):
define void @interrupt_low() {
ret void
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
void foo(void) {
  printf("foo called by %d of %d\n", omp_get_thread_num(),
         omp_get_num_threads());
#pragma omp parallel
  {
    printf("foo parallel reached by %d of %d\n", omp_get_thread_num(),
           omp_get_num_threads());
  }
  return;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"foo called by %d of %d\0A\00"
@.str.1 = [34 x i8] c"foo parallel reached by %d of %d\0A\00"
define void @foo() {
%1 = call i32 (...) @omp_get_thread_num()
%2 = call i32 (...) @omp_get_num_threads()
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = call i32 (...) @omp_get_thread_num()
%5 = call i32 (...) @omp_get_num_threads()
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"foo called by %d of %d\0A\00"
@.str.1 = [34 x i8] c"foo parallel reached by %d of %d\0A\00"
define void @foo() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 (...) @omp_get_num_threads()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 (...) @omp_get_thread_num()
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret void
}
/* Variables and functions */
double floor(float);
double q1(float a) { return floor(a); }


x86 assembly (clang, -O0):
<q1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1>:
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define double @q1(float %0) {
%2 = tail call double @floor(float %0)
ret double %2
}
char *apnumber(const int number) { return ""; }


x86 assembly (clang, -O0):
<apnumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @apnumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @apnumber(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
int readCounter(void) {
  int volatile *IO = (int *)(0x3c000000 + 5 * 0x00000020);
  return *IO;
}


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

x86 assembly (clang, -O2):
<readCounter>:
mov    0x3c0000a0,%eax
ret

LLVM IR (-O0):
define i32 @readCounter() {
%1 = alloca i32*
store i32* inttoptr (i64 1006633120 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load volatile i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @readCounter() {
%1 = load volatile i32, i32* inttoptr (i64 1006633120 to i32*)
ret i32 %1
}
int hmax(const int a, const int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<hmax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <hmax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <hmax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hmax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @hmax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_SYS_GetBusClockFreq();
uint32_t CLOCK_SYS_GetCmtFreq(uint32_t instance) {
  (void)instance;
  return CLOCK_SYS_GetBusClockFreq();
}


x86 assembly (clang, -O0):
<CLOCK_SYS_GetCmtFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <CLOCK_SYS_GetBusClockFreq@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @CLOCK_SYS_GetCmtFreq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @CLOCK_SYS_GetBusClockFreq()
ret i32 %4
}

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetCmtFreq(i32 %0) {
%2 = tail call i32 (...) @CLOCK_SYS_GetBusClockFreq()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_addr_spec_free(char *addr_spec) { free(addr_spec); }


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

x86 assembly (clang, -O2):
<mailimf_addr_spec_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @mailimf_addr_spec_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @mailimf_addr_spec_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int __attribute__((pure)) string_comparator(char *str_a, char *str_b) {
  if (str_a && str_b && str_a != str_b)
    return !strcmp(str_a, str_b);
  else
    return str_a == str_b;
}


x86 assembly (clang, -O0):
<string_comparator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <string_comparator+0x56>
cmpq   $0x0,-0x18(%rbp)
je     1166 <string_comparator+0x56>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1166 <string_comparator+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <string_comparator+0x69>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_comparator>:
cmp    %rsi,%rdi
sete   %al
je     1131 <string_comparator+0x21>
test   %rdi,%rdi
je     1131 <string_comparator+0x21>
test   %rsi,%rsi
je     1131 <string_comparator+0x21>
push   %rax
call   1030 <strcmp@plt>
test   %eax,%eax
sete   %al
add    $0x8,%rsp
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @string_comparator(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %22
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = icmp ne i8* %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = call i32 @strcmp(i8* %16, i8* %17)
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
store i32 %21, i32* %3
br label %27
22: ; preds = %11, %8, %2
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = icmp eq i8* %23, %24
%26 = zext i1 %25 to i32
store i32 %26, i32* %3
br label %27
27: ; preds = %22, %15
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @string_comparator(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
%6 = icmp eq i8* %0, %1
%7 = or i1 %6, %5
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %2, %8
%12 = phi i1 [ %10, %8 ], [ %6, %2 ]
%13 = zext i1 %12 to i32
ret i32 %13
}
void outl(unsigned short port, unsigned val) {
  asm volatile("outl %0, %1" : : "a"(val), "Nd"(port));
}


x86 assembly (clang, -O0):
<outl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x2(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outl(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outl(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "outl $0, $1", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
char *strdup(char const *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
char *checked_strdup(const char *s) {
  char *ns = strdup(s);
  if (ns == NULL) {
    errx(1, "Failed to duplicate a string: %s", strerror(errno));
  }
  return (ns);
}


x86 assembly (clang, -O0):
<checked_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <checked_strdup+0x45>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe90(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_strdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115f <checked_strdup+0x2f>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xead(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Failed to duplicate a string: %s\00"
@errno = global i32 0
define i8* @checked_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [33 x i8] c"Failed to duplicate a string: %s\00"
@errno = global i32 0
define noalias i8* @checked_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
int atexit(void (*func)(void)) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @atexit(void ()* nocapture readnone %0) {
ret i32 0
}
int intcmp(int *i, int *j) { return *i - *j; }


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

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

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

LLVM IR (-O2):
define i32 @intcmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}