xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xd9() {
  Assert_real((isspace(217) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              1090, ("isspace should be 0 for 0xd9"));
}


x86 assembly (clang, -O0):
<t_isspace_0xd9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x442,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0xd9>:
push   %rax
mov    $0xd9,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x442,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xd9\00"
define void @t_isspace_0xd9() {
%1 = call i64 @isspace(i32 217)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1090, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xd9\00"
define void @t_isspace_0xd9() {
%1 = tail call i64 @isspace(i32 217)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1090, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ bspwm_check(scalar_t__);
int /*<<< orphan*/ terminate(int);
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void check(int signum) {
  (void)signum;
  for (;;) {
    pid_t pid = waitpid(-1, NULL, WNOHANG);
    if (pid <= 0)
      break;
    if (bspwm_check(pid)) {
      terminate(signum);
      break;
    }
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <waitpid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1166 <check+0x36>
jmp    118b <check+0x5b>
mov    -0x10(%rbp),%rdi
call   1030 <bspwm_check@plt>
cmp    $0x0,%rax
je     1186 <check+0x56>
mov    -0x4(%rbp),%edi
call   1040 <terminate@plt>
jmp    118b <check+0x5b>
jmp    113b <check+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    0x2eac(%rip),%rbx
nopl   0x0(%rax)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1050 <waitpid@plt>
test   %rax,%rax
jle    116d <check+0x3d>
mov    %rax,%rdi
call   1030 <bspwm_check@plt>
test   %rax,%rax
je     1140 <check+0x10>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <terminate@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @check(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @waitpid(i32 -1, i32* null, i32 %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = icmp sle i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
br label %19
11: ; preds = %5
%12 = load i64, i64* %3
%13 = call i64 @bspwm_check(i64 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %2
%17 = call i32 @terminate(i32 %16)
br label %19
18: ; preds = %11
br label %5
19: ; preds = %15, %10
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @check(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp slt i64 %4, 1
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i64 @bspwm_check(i64 %4)
%8 = icmp eq i64 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %6
%10 = tail call i32 @terminate(i32 %0)
br label %11
11: ; preds = %2, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emscripten_run_script(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void c_write_char(char *str) {
  char *buf = malloc(1024 * 2);
  if (!buf)
    exit(1);
  sprintf(buf, "write_char(\"%s\");", str);
  emscripten_run_script(buf);
  free(buf);
}


x86 assembly (clang, -O0):
<c_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x800,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <c_write_char+0x2f>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe72(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <emscripten_run_script@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_write_char>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x800,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1192 <c_write_char+0x42>
mov    %rax,%rbx
lea    0xe90(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1050 <emscripten_run_script@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"write_char(\22%s\22);\00"
define void @c_write_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 2048)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @emscripten_run_script(i8* %13)
%15 = load i8*, i8** %3
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"write_char(\22%s\22);\00"
define void @c_write_char(i8* %0) {
%2 = tail call dereferenceable_or_null(2048) i8* @malloc(i32 2048)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @emscripten_run_script(i8* %2)
%9 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int count_sum();
int count_sum2();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int sum = count_sum();
  int sum2 = count_sum2();
  printf("Day 1 pt 1! Sum: %d Sum2: %d \n", sum, sum2);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <count_sum@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <count_sum2@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Day 1 pt 1! Sum: %d Sum2: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @count_sum()
store i32 %3, i32* %1
%4 = call i32 (...) @count_sum2()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Day 1 pt 1! Sum: %d Sum2: %d \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @count_sum()
%2 = tail call i32 (...) @count_sum2()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *mem = malloc(size);
  if (mem == NULL) {
    fprintf(stderr, "Fatal Error - Couldn't allocate heap\n");
    exit(EXIT_FAILURE);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Fatal Error - Couldn't allocate heap\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Fatal Error - Couldn't allocate heap\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
void *OP1_TYPECAST(void *);
void *op_UNARY_MINUS(void *inp) {
  inp = OP1_TYPECAST(inp);
  int operand = (int)inp;
  return (void *)(-1 * operand);
}


x86 assembly (clang, -O0):
<op_UNARY_MINUS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <OP1_TYPECAST@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
imul   $0xffffffff,-0xc(%rbp),%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_UNARY_MINUS>:
push   %rax
call   1030 <OP1_TYPECAST@plt>
shl    $0x20,%rax
neg    %rax
sar    $0x20,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @op_UNARY_MINUS(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @OP1_TYPECAST(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 -1, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define i8* @op_UNARY_MINUS(i8* %0) {
%2 = tail call i8* @OP1_TYPECAST(i8* %0)
%3 = ptrtoint i8* %2 to i64
%4 = mul i64 %3, -4294967296
%5 = ashr exact i64 %4, 32
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void yyDeL1free(void *ptr) { free((char *)ptr); }


x86 assembly (clang, -O0):
<yyDeL1free>:
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):
<yyDeL1free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @yyDeL1free(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 @yyDeL1free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
__attribute((__gnu___)) extern int f(int a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
void foo280(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo280(i32 %0) {
ret void
}
/* Variables and functions */
int process_move_internal(char **, int /*<<< orphan*/, int);
int process_into(char **x) { return process_move_internal(x, 0, 1); }


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

x86 assembly (clang, -O2):
<process_into>:
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <process_move_internal@plt>

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

LLVM IR (-O2):
define i32 @process_into(i8** %0) {
%2 = tail call i32 @process_move_internal(i8** %0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
int strlen(char *);
void chomp(char string[]) {
  int i;
  i = strlen(string);
  --i;
  if (string[i] == '\n') {
    string[i] = '\0';
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1152 <chomp+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <chomp+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
int primos(int n) {
  int i, j, cont;
  for (i = 0; i <= n; i++) {
    cont = 0;
    for (j = 1; j <= i; j++) {
      if (i % j == 0) {
        cont++;
      }
    }
    if (cont == 2) {
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<primos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1189 <primos+0x89>
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1160 <primos+0x60>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    114d <primos+0x4d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <primos+0x52>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <primos+0x28>
cmpl   $0x2,-0x14(%rbp)
jne    1176 <primos+0x76>
movl   $0x1,-0x4(%rbp)
jmp    1189 <primos+0x89>
jmp    117b <primos+0x7b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <primos+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @primos(i32 %0) {
ret i32 1
}
int op_div(int a, int b) { return a / b; }


x86 assembly (clang, -O0):
<op_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_div>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @op_div(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 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op_div(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
void g_value_get_string() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_INC_OUTPUT() { set_io_bit(0x36, 2); }


x86 assembly (clang, -O0):
<TOSH_MAKE_INC_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
mov    $0x2,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_INC_OUTPUT>:
mov    $0x36,%edi
mov    $0x2,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_INC_OUTPUT() {
%1 = call i32 @set_io_bit(i32 54, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_INC_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 54, i32 2)
ret void
}
int ARR_equals(int vet_a[], int vet_b[], int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (vet_a[i] != vet_b[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<ARR_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <ARR_equals+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <ARR_equals+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1164 <ARR_equals+0x64>
jmp    114f <ARR_equals+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <ARR_equals+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARR_equals>:
mov    $0x1,%eax
test   %edx,%edx
jle    1121 <ARR_equals+0x21>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <ARR_equals+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <ARR_equals+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ARR_equals(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %27, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %30
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = icmp ne i32 %18, %23
br i1 %24, label %25, label %26
25: ; preds = %13
store i32 0, i32* %4
br label %31
26: ; preds = %13
br label %27
27: ; preds = %26
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
br label %9
30: ; preds = %9
store i32 1, i32* %4
br label %31
31: ; preds = %30, %25
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
define i32 @ARR_equals(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
void RTSgBufAdvance(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSgBufAdvance() {
ret void
}
unsigned left_node(unsigned i) { return i << 1; }


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

x86 assembly (clang, -O2):
<left_node>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @left_node(i32 %0) {
%2 = shl i32 %0, 1
ret i32 %2
}
int my_change_hexa(int R, int G, int B) {
  if (R > 255)
    R = 255;
  if (G > 255)
    G = 255;
  if (B > 255)
    B = 255;
  return (B * 256 * 256 + G * 256 + R);
}


x86 assembly (clang, -O0):
<my_change_hexa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1121 <my_change_hexa+0x21>
movl   $0xff,-0x4(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    1135 <my_change_hexa+0x35>
movl   $0xff,-0x8(%rbp)
cmpl   $0xff,-0xc(%rbp)
jle    1149 <my_change_hexa+0x49>
movl   $0xff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_change_hexa>:
cmp    $0xff,%edi
mov    $0xff,%eax
cmovge %eax,%edi
cmp    $0xff,%esi
cmovge %eax,%esi
cmp    $0xff,%edx
cmovl  %edx,%eax
shl    $0x10,%eax
shl    $0x8,%esi
add    %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @my_change_hexa(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 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %3
store i32 255, i32* %4
br label %10
10: ; preds = %9, %3
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 255
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 255, i32* %5
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 255
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 255, i32* %6
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %6
%20 = mul nsw i32 %19, 256
%21 = mul nsw i32 %20, 256
%22 = load i32, i32* %5
%23 = mul nsw i32 %22, 256
%24 = add nsw i32 %21, %23
%25 = load i32, i32* %4
%26 = add nsw i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @my_change_hexa(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 255
%5 = select i1 %4, i32 %0, i32 255
%6 = icmp slt i32 %1, 255
%7 = select i1 %6, i32 %1, i32 255
%8 = icmp slt i32 %2, 255
%9 = select i1 %8, i32 %2, i32 255
%10 = shl nsw i32 %9, 16
%11 = shl nsw i32 %7, 8
%12 = add i32 %11, %5
%13 = add i32 %12, %10
ret i32 %13
}
char *dngettext(const char *domainname, const char *msgid,
                const char *msgid_plural, unsigned long int n) {
  (void)domainname;
  return (char *)(n == 1 ? msgid : msgid_plural);
}


x86 assembly (clang, -O0):
<dngettext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    112c <dngettext+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1134 <dngettext+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dngettext>:
mov    %rsi,%rax
cmp    $0x1,%rcx
cmovne %rdx,%rax
ret

LLVM IR (-O0):
define i8* @dngettext(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %8
%11 = icmp eq i64 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = load i8*, i8** %6
br label %16
14: ; preds = %4
%15 = load i8*, i8** %7
br label %16
16: ; preds = %14, %12
%17 = phi i8* [ %13, %12 ], [ %15, %14 ]
ret i8* %17
}

LLVM IR (-O2):
define i8* @dngettext(i8* nocapture readnone %0, i8* readnone %1, i8* readnone %2, i64 %3) {
%5 = icmp eq i64 %3, 1
%6 = select i1 %5, i8* %1, i8* %2
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
uint16_t hton16(uint16_t n) { return htons(n); }


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

x86 assembly (clang, -O2):
<hton16>:
jmp    1030 <htons@plt>

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

LLVM IR (-O2):
define i32 @hton16(i32 %0) {
%2 = tail call i32 @htons(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *atrf_default_driver_name();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr,
          "usage: %s [-a|-t] [-d driver[:arg]]\n\n"
          "  -a               reset MCU and transceiver\n"
          "  -d driver[:arg]  use the specified driver (default: %s)\n"
          "  -t               reset transceiver (default)\n",
          name, atrf_default_driver_name());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <atrf_default_driver_name@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <atrf_default_driver_name@plt>
lea    0xeb3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [188 x i8] c"usage: %s [-a|-t] [-d driver[:arg]]\0A\0A -a reset MCU and transceiver\0A -d driver[:arg] use the specified driver (default: %s)\0A -t reset transceiver (default)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i8* (...) @atrf_default_driver_name()
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [188 x i8] c"usage: %s [-a|-t] [-d driver[:arg]]\0A\0A -a reset MCU and transceiver\0A -d driver[:arg] use the specified driver (default: %s)\0A -t reset transceiver (default)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* (...) @atrf_default_driver_name()
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Quit(void) { exit(0); }


x86 assembly (clang, -O0):
<Quit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @Quit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Quit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct io_event {
  int dummy;
};
typedef int /*<<< orphan*/ aio_context_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_io_getevents;
long syscall(int /*<<< orphan*/, int /*<<< orphan*/, long, long,
             struct io_event *, struct timespec *);
long io_getevents(aio_context_t ctx, long min_nr, long nr,
                  struct io_event *events, struct timespec *tmo) {
  return syscall(__NR_io_getevents, ctx, min_nr, nr, events, tmo);
}


x86 assembly (clang, -O0):
<io_getevents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_getevents>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.io_event = type { i32 }
%struct.timespec = type { i32 }
@__NR_io_getevents = global i32 0
define i64 @io_getevents(i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca %struct.io_event*
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store %struct.io_event* %3, %struct.io_event** %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* @__NR_io_getevents
%12 = load i32, i32* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load %struct.io_event*, %struct.io_event** %9
%16 = load %struct.timespec*, %struct.timespec** %10
%17 = call i64 @syscall(i32 %11, i32 %12, i64 %13, i64 %14, %struct.io_event* %15, %struct.timespec* %16)
ret i64 %17
}

LLVM IR (-O2):
%struct.io_event = type { i32 }
%struct.timespec = type { i32 }
@__NR_io_getevents = global i32 0
define i64 @io_getevents(i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4) {
%6 = load i32, i32* @__NR_io_getevents
%7 = tail call i64 @syscall(i32 %6, i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4)
ret i64 %7
}
/* Variables and functions */
int Test();
int main(int argc, char *argv[]) { return (Test()); }


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <Test@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
%6 = call i32 (...) @Test()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Test()
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t ip_get_srcaddr(const uint8_t *p_ip) {
  return (p_ip[12] << 24) | (p_ip[13] << 16) | (p_ip[14] << 8) | p_ip[15];
}


x86 assembly (clang, -O0):
<ip_get_srcaddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x34(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x38(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x3c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_srcaddr>:
mov    0x30(%rdi),%eax
mov    0x34(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x38(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x3c(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ip_get_srcaddr(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 13
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 14
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 15
%14 = load i32, i32* %13
%15 = or i32 %12, %14
ret i32 %15
}
void splice_setnetworkpid(short pid) {}


x86 assembly (clang, -O0):
<splice_setnetworkpid>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @splice_setnetworkpid(i16 signext %0) {
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
int select_changes_time(void) {
  struct timeval t;
  t.tv_sec = 0;
  t.tv_usec = 100000;
  select(0, NULL, NULL, NULL, &t);
  return t.tv_usec != 100000;
}


x86 assembly (clang, -O0):
<select_changes_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x186a0,-0x10(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
cmpl   $0x186a0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_changes_time>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x186a0,0x8(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
xor    %eax,%eax
cmpl   $0x186a0,0x8(%rsp)
setne  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @select_changes_time() {
%1 = alloca %struct.timeval
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
store i64 0, i64* %2
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
store i32 100000, i32* %3
%4 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %1)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 100000
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @select_changes_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 100000, i32* %4
%5 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %1)
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 100000
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned long strhash(char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <strhash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strhash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <strhash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ tabTransp(int);
void IF_TabTranspN(void) { tabTransp(1); }


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

x86 assembly (clang, -O2):
<IF_TabTranspN>:
mov    $0x1,%edi
jmp    1030 <tabTransp@plt>

LLVM IR (-O0):
define void @IF_TabTranspN() {
%1 = call i32 @tabTransp(i32 1)
ret void
}

LLVM IR (-O2):
define void @IF_TabTranspN() {
%1 = tail call i32 @tabTransp(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGTSTP;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  signal(SIGTSTP, SIG_DFL);
  signal(SIGINT, SIG_DFL);
  execvp(argv[1], argv + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%r14
mov    (%r14),%esi
call   1030 <signal@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%esi
call   1030 <signal@plt>
mov    0x8(%rbx),%rdi
add    $0x8,%rbx
mov    %rbx,%rsi
call   1040 <execvp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGTSTP = global i32 0
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @SIGTSTP
%6 = load i32, i32* @SIG_DFL
%7 = call i32 @signal(i32 %5, i32 %6)
%8 = load i32, i32* @SIGINT
%9 = load i32, i32* @SIG_DFL
%10 = call i32 @signal(i32 %8, i32 %9)
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = call i32 @execvp(i8* %13, i8** %15)
ret i32 0
}

LLVM IR (-O2):
@SIGTSTP = global i32 0
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @SIGTSTP
%4 = load i32, i32* @SIG_DFL
%5 = tail call i32 @signal(i32 %3, i32 %4)
%6 = load i32, i32* @SIGINT
%7 = load i32, i32* @SIG_DFL
%8 = tail call i32 @signal(i32 %6, i32 %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @execvp(i8* %10, i8** %9)
ret i32 0
}
int test_imm_90int8_mem(signed char *val) {
  return ((*val) & (-0x90 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_90int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff70,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_90int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -144
%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_90int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -144
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
int ls_cost_nm9_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm9_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm9_n_in() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC16F18855_stop(void) {
  serial_close(0);
  ;
}


x86 assembly (clang, -O0):
<PIC16F18855_stop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <serial_close@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F18855_stop>:
xor    %edi,%edi
jmp    1030 <serial_close@plt>

LLVM IR (-O0):
define void @PIC16F18855_stop() {
%1 = call i32 @serial_close(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F18855_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_init_green_led();
int /*<<< orphan*/ gpio_toggle_green_led();
int /*<<< orphan*/ some_delay(unsigned int);
int main(void) {
  gpio_init_green_led();
  while (1) {
    gpio_toggle_green_led();
    some_delay(1000000u);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gpio_init_green_led@plt>
mov    $0x0,%al
call   1030 <gpio_toggle_green_led@plt>
mov    $0xf4240,%edi
call   1050 <some_delay@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <gpio_init_green_led@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gpio_toggle_green_led@plt>
mov    $0xf4240,%edi
call   1050 <some_delay@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gpio_init_green_led()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @gpio_toggle_green_led()
%5 = call i32 @some_delay(i32 1000000)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gpio_init_green_led()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @gpio_toggle_green_led()
%4 = tail call i32 @some_delay(i32 1000000)
br label %2
}