xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strsep(char **, char *);
void main() {
  char str2[] = "112112desf.213 @1.1.1.2";
  char *buf;
  char *token;
  buf = str2;
  strsep(&buf, "@");
  token = strsep(&buf, "@");
  printf("%s\n", token);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1040 <strsep@plt>
lea    -0x28(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strsep@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x322e312e312e31,%rax
mov    %rax,0x20(%rsp)
lea    0x10(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    0xec5(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strsep@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strsep@plt>
lea    0xea5(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str2 = [24 x i8] c"112112desf.213 @1.1.1.2\00"
@.str = [2 x i8] c"@\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [24 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast [24 x i8]* %1 to i8*
%5 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
store i8* %5, i8** %2
%6 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@__const.main.str2 = [24 x i8] c"112112desf.213 @1.1.1.2\00"
@.str = [2 x i8] c"@\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [24 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%4 = bitcast i8** %2 to i8*
store i8* %3, i8** %2
%5 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i8* @strsep(i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_strbuf_putc() {
  printf("NOT IMPLEMENTED:"
         "pa_strbuf_putc"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_strbuf_putc\0A\00"
define i32 @pa_strbuf_putc() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_strbuf_putc\00"
define i32 @pa_strbuf_putc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int ftruncate(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int dotrunc(int fd, off_t offset) {
  int ret;
  ret = ftruncate(fd, offset);
  if (ret == -1)
    perror("truncate failed");
  return ret;
}


x86 assembly (clang, -O0):
<dotrunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1152 <dotrunc+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotrunc>:
push   %rbx
call   1030 <ftruncate@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1131 <dotrunc+0x11>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
jmp    112d <dotrunc+0xd>

LLVM IR (-O0):
@.str = [16 x i8] c"truncate failed\00"
define i32 @dotrunc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @ftruncate(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"truncate failed\00"
define i32 @dotrunc(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
const char *stress_get_uname_info(void) { return "unknown"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"unknown\00"
define i8* @stress_get_uname_info() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  printf("EOF is: %d\n", EOF);
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%eax
je     117a <main+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1154 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%esi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
je     1164 <main+0x34>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"EOF is: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %9, %6 ], [ %3, %0 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int is_doi(char *);
int is_reference_database(char *);
int is_uri_remote_scheme(char *);
int is_embedded_link(char *s) {
  if (is_uri_remote_scheme(s) != -1)
    return 1;
  if (is_reference_database(s) != -1)
    return 1;
  if (is_doi(s) != -1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_embedded_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <is_uri_remote_scheme@plt>
cmp    $0xffffffff,%eax
je     115a <is_embedded_link+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    119d <is_embedded_link+0x6d>
mov    -0x10(%rbp),%rdi
call   1030 <is_reference_database@plt>
cmp    $0xffffffff,%eax
je     1178 <is_embedded_link+0x48>
movl   $0x1,-0x4(%rbp)
jmp    119d <is_embedded_link+0x6d>
mov    -0x10(%rbp),%rdi
call   1040 <is_doi@plt>
cmp    $0xffffffff,%eax
je     1196 <is_embedded_link+0x66>
movl   $0x1,-0x4(%rbp)
jmp    119d <is_embedded_link+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_embedded_link>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <is_uri_remote_scheme@plt>
mov    $0x1,%ebp
cmp    $0xffffffff,%eax
jne    1163 <is_embedded_link+0x33>
mov    %rbx,%rdi
call   1030 <is_reference_database@plt>
cmp    $0xffffffff,%eax
jne    1163 <is_embedded_link+0x33>
mov    %rbx,%rdi
call   1040 <is_doi@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_embedded_link(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @is_uri_remote_scheme(i8* %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @is_reference_database(i8* %9)
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %19
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i32 @is_doi(i8* %14)
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %19
18: ; preds = %13
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_embedded_link(i8* %0) {
%2 = tail call i32 @is_uri_remote_scheme(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i32 @is_reference_database(i8* %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @is_doi(i8* %0)
%9 = icmp ne i32 %8, -1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
void *test_anti_range_88(unsigned char n) {
  extern void *alloc_anti_range_88(unsigned char)
      __attribute__((alloc_size(1)));
  if ((0x7f * 2 + 1) - 2 <= n && n <= (0x7f * 2 + 1) - 1)
    n = (0x7f * 2 + 1) - 2 - 1;
  return alloc_anti_range_88(n);
}


x86 assembly (clang, -O0):
<test_anti_range_88>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0xfd,%eax
cmp    %ecx,%eax
jg     1142 <test_anti_range_88+0x32>
movzbl -0x1(%rbp),%eax
cmp    $0xfe,%eax
jg     1142 <test_anti_range_88+0x32>
movb   $0xfc,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_88@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_88>:
lea    0x3(%rdi),%eax
cmp    $0x2,%al
mov    $0xfc,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_88@plt>

LLVM IR (-O0):
define i8* @test_anti_range_88(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 253, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 254
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 -4, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_88(i8 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_88(i8 zeroext %0) {
%2 = add i8 %0, 3
%3 = icmp ult i8 %2, 2
%4 = select i1 %3, i8 -4, i8 %0
%5 = tail call i8* @alloc_anti_range_88(i8 zeroext %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void runUI() { printf("Hello!"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hello!\00"
define void @runUI() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
pid_t fork_aux(void) {
  pid_t ret = fork();
  if (ret < 0) {
    error("esh: forking failed.");
    exit(EXIT_FAILURE);
  }
  return ret;
}


x86 assembly (clang, -O0):
<fork_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1168 <fork_aux+0x38>
lea    0xeab(%rip),%rdi
call   1030 <error@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_aux>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
js     113f <fork_aux+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <error@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"esh: forking failed.\00"
@EXIT_FAILURE = global i32 0
define i64 @fork_aux() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
@.str = [21 x i8] c"esh: forking failed.\00"
@EXIT_FAILURE = global i32 0
define i64 @fork_aux() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i64 %1
}
char __ocl_convert_char_float(float src) { return (char)src; }


x86 assembly (clang, -O0):
<__ocl_convert_char_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_convert_char_float>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define signext i8 @__ocl_convert_char_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @__ocl_convert_char_float(float %0) {
%2 = fptosi float %0 to i8
ret i8 %2
}
int gcd(int e, int f) {
  int g;
  while (e != 0) {
    g = e;
    e = f % e;
    f = g;
  }
  return f;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int main(void) {
  char keyboard_chr;
  int result = -1;
  while (1) {
    result = read(STDIN_FILENO, &keyboard_chr, 1);
    if (result != -1)
      write(STDOUT_FILENO, &keyboard_chr, 1);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     1171 <main+0x51>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2ea8(%rip),%r14
lea    0xf(%rsp),%rbx
mov    0x2eb4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0xffffffff,%eax
je     1140 <main+0x20>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %3
br label %4
4: ; preds = %0, %12
%5 = load i32, i32* @STDIN_FILENO
%6 = call i32 @read(i32 %5, i8* %2, i32 1)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* @STDOUT_FILENO
%11 = call i32 @write(i32 %10, i8* %2, i32 1)
br label %12
12: ; preds = %9, %4
br label %4
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* @STDIN_FILENO
%4 = call i32 @read(i32 %3, i8* %1, i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* @STDOUT_FILENO
%8 = call i32 @write(i32 %7, i8* %1, i32 1)
br label %9
9: ; preds = %6, %2
br label %2
}
void *thread_function(void *arg) {
  asm("    .global "
      "set_point1"
      "\n"
      "set_point1"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)

x86 assembly (clang, -O2):
<thread_function>:
call   1030 <x86_trace_dummy@plt>
ret

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

LLVM IR (-O2):
define i8* @thread_function(i8* nocapture readnone %0) {
tail call void asm sideeffect " .global set_point1\0Aset_point1:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
ret i8* undef
}
int match(const void *key1, const void *key2) {
  return *(int *)key1 == *(int *)key2;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @match(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct entry_list {
  int dummy;
};
struct entry {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_front(struct genlist const *);
struct entry *entry_list_front(const struct entry_list *tthis) {
  return (struct entry *)genlist_front((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<entry_list_front>:
jmp    1030 <genlist_front@plt>

LLVM IR (-O0):
%struct.entry = type { i32 }
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.entry* @entry_list_front(%struct.entry_list* %0) {
%2 = alloca %struct.entry_list*
store %struct.entry_list* %0, %struct.entry_list** %2
%3 = load %struct.entry_list*, %struct.entry_list** %2
%4 = bitcast %struct.entry_list* %3 to %struct.genlist*
%5 = call i64 @genlist_front(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.entry*
ret %struct.entry* %6
}

LLVM IR (-O2):
%struct.entry = type { i32 }
%struct.entry_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.entry* @entry_list_front(%struct.entry_list* %0) {
%2 = bitcast %struct.entry_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_front(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.entry*
ret %struct.entry* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int handleRecvErr(int fd, const char *reason, double lastPingTime) {
  fd = fd;
  if (reason) {
    printf("%s\n", reason);
  } else {
    printf("Destination unreachable "
           "(closed, filtered or TTL exceeded)\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<handleRecvErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <handleRecvErr+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115a <handleRecvErr+0x4a>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleRecvErr>:
push   %rax
test   %rsi,%rsi
je     111b <handleRecvErr+0xb>
mov    %rsi,%rdi
jmp    1122 <handleRecvErr+0x12>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [60 x i8] c"Destination unreachable (closed, filtered or TTL exceeded)\0A\00"
define i32 @handleRecvErr(i32 %0, i8* %1, double %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double
store i32 %0, i32* %4
store i8* %1, i8** %5
store double %2, double* %6
%7 = load i32, i32* %4
store i32 %7, i32* %4
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
ret i32 0
}

LLVM IR (-O2):
@str = [59 x i8] c"Destination unreachable (closed, filtered or TTL exceeded)\00"
define i32 @handleRecvErr(i32 %0, i8* %1, double %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @puts(i8* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ read(int /*<<< orphan*/, char *, int);
int countStdin() {
  char ch[1];
  int n = 0;
  while (read(0, ch, 1) > 0) {
    printf("%s", ch);
    n++;
  }
  return n - 1;
}


x86 assembly (clang, -O0):
<countStdin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    -0x1(%rbp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
jle    1167 <countStdin+0x47>
lea    -0x1(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <countStdin+0xf>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countStdin>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
jle    1172 <countStdin+0x52>
lea    0xeb5(%rip),%r14
lea    0xf(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
add    $0x1,%ebx
test   %rax,%rax
jg     1150 <countStdin+0x30>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @countStdin() {
%1 = alloca [1 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%5 = call i64 @read(i32 0, i8* %4, i32 1)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @countStdin() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = call i64 @read(i32 0, i8* %2, i32 1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ 0, %0 ]
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = add nuw nsw i32 %6, 1
%9 = call i64 @read(i32 0, i8* %2, i32 1)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
%12 = phi i32 [ -1, %0 ], [ %6, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ iFree(int **);
void IptFree(int m, int *ipt[]) {
  int i;
  for (i = 0; i < m; i++)
    iFree(&ipt[i]);
}


x86 assembly (clang, -O0):
<IptFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <IptFree+0x44>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <iFree@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <IptFree+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IptFree>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1132 <IptFree+0x22>
mov    %rsi,%rbx
mov    %edi,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <iFree@plt>
add    $0x8,%rbx
add    $0xffffffffffffffff,%r14
jne    1120 <IptFree+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @IptFree(i32 %0, i32** %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32*, i32** %1, i64 %7
%9 = tail call i32 @iFree(i32** %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_PNaClSetResult0() {
  char msg[] = "Aborting: "
               "_Unwind_PNaClSetResult0"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_PNaClSetResult0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x4f,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x4e,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_PNaClSetResult0>:
sub    $0x58,%rsp
movups 0xf14(%rip),%xmm0
movups %xmm0,0x3f(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x4e,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_PNaClSetResult0.msg = [79 x i8] c"Aborting: _Unwind_PNaClSetResult0 called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_PNaClSetResult0() {
%1 = alloca [79 x i8]
%2 = bitcast [79 x i8]* %1 to i8*
%3 = getelementptr inbounds [79 x i8], [79 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 78)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_PNaClSetResult0.msg = [79 x i8] c"Aborting: _Unwind_PNaClSetResult0 called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_PNaClSetResult0() {
%1 = alloca [79 x i8]
%2 = getelementptr inbounds [79 x i8], [79 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 78)
%4 = tail call i32 (...) @abort()
unreachable
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  if (s && f) {
    while (*s != '\0') {
      (*f)(i, s);
      i++;
      s++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116e <ft_striteri+0x6e>
cmpq   $0x0,-0x10(%rbp)
je     116e <ft_striteri+0x6e>
jmp    1132 <ft_striteri+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <ft_striteri+0x69>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <ft_striteri+0x32>
jmp    116e <ft_striteri+0x6e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1135 <ft_striteri+0x35>
mov    %rsi,%r14
test   %rsi,%rsi
je     1135 <ft_striteri+0x35>
mov    %rdi,%r15
cmpb   $0x0,(%rdi)
je     1135 <ft_striteri+0x35>
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%r15,%rbx,1),%rsi
mov    %ebx,%edi
call   *%r14
cmpb   $0x0,0x1(%r15,%rbx,1)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i32, i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6, %9
%10 = phi i32 [ %12, %9 ], [ 0, %6 ]
%11 = phi i8* [ %13, %9 ], [ %0, %6 ]
tail call void %1(i32 %10, i8* %11)
%12 = add i32 %10, 1
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %6, %2
ret void
}
int min(int a, int b) {
  if (a > b)
    return (b);
  return (a);
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkF() {
  blinkdot();
  blinkdot();
  blinkdash();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xea8(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkF>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkF() {
%1 = call i32 (...) @blinkdot()
%2 = call i32 (...) @blinkdot()
%3 = call i32 (...) @blinkdash()
%4 = call i32 (...) @blinkdot()
%5 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkF() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: rarpd [ -dveaA ] [ -b tftpdir ] [ interface]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: rarpd [ -dveaA ] [ -b tftpdir ] [ interface]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Usage: rarpd [ -dveaA ] [ -b tftpdir ] [ interface]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float floorf(float const);
void glmFloor3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = floorf(x[i]);
}


x86 assembly (clang, -O0):
<glmFloor3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmFloor3f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <floorf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmFloor3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmFloor3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmFloor3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @llvm.floor.f32(float %13)
%15 = load float*, float** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds float, float* %15, i64 %16
store float %14, float* %17
br label %18
18: ; preds = %9
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmFloor3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @llvm.floor.f32(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @llvm.floor.f32(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @llvm.floor.f32(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ mill_cr_postfork();
int /*<<< orphan*/ mill_poller_postfork();
int /*<<< orphan*/ mill_timer_postfork();
pid_t mill_mfork_(void) {
  pid_t pid = fork();
  if (pid != 0) {
    return pid;
  }
  mill_cr_postfork();
  mill_poller_postfork();
  mill_timer_postfork();
  return 0;
}


x86 assembly (clang, -O0):
<mill_mfork_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <mill_mfork_+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1188 <mill_mfork_+0x48>
mov    $0x0,%al
call   1040 <mill_cr_postfork@plt>
mov    $0x0,%al
call   1030 <mill_poller_postfork@plt>
mov    $0x0,%al
call   1050 <mill_timer_postfork@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mill_mfork_>:
push   %rbx
xor    %eax,%eax
call   1060 <fork@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1165 <mill_mfork_+0x25>
xor    %eax,%eax
call   1040 <mill_cr_postfork@plt>
xor    %eax,%eax
call   1030 <mill_poller_postfork@plt>
xor    %eax,%eax
call   1050 <mill_timer_postfork@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @mill_mfork_() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i64, i64* %2
store i64 %7, i64* %1
br label %12
8: ; preds = %0
%9 = call i32 (...) @mill_cr_postfork()
%10 = call i32 (...) @mill_poller_postfork()
%11 = call i32 (...) @mill_timer_postfork()
store i64 0, i64* %1
br label %12
12: ; preds = %8, %6
%13 = load i64, i64* %1
ret i64 %13
}

LLVM IR (-O2):
define i64 @mill_mfork_() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @mill_cr_postfork()
%5 = tail call i32 (...) @mill_poller_postfork()
%6 = tail call i32 (...) @mill_timer_postfork()
br label %7
7: ; preds = %0, %3
ret i64 %1
}
/* Variables and functions */
unsigned int chipid_get_power_epoch();
unsigned int chipid_get_nand_epoch() { return chipid_get_power_epoch(); }


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

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

LLVM IR (-O0):
define i32 @chipid_get_nand_epoch() {
%1 = call i32 (...) @chipid_get_power_epoch()
ret i32 %1
}

LLVM IR (-O2):
define i32 @chipid_get_nand_epoch() {
%1 = tail call i32 (...) @chipid_get_power_epoch()
ret i32 %1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_standard_pole_radius(double *frp) {
  int fail;
  int precision = 0;
  int *b;
  fail = _ada_use_c2phc4c(865, &precision, b, frp, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_standard_pole_radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x361,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_standard_pole_radius>:
push   %rax
mov    %rdi,%rcx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x361,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_get_standard_pole_radius(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store double* %0, double** %2
store i32 0, i32* %4
%6 = load i32*, i32** %5
%7 = load double*, double** %2
%8 = call i32 @_ada_use_c2phc4c(i32 865, i32* %4, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @padcon_get_standard_pole_radius(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 865, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
int fun526() { return 526; }


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

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

LLVM IR (-O0):
define i32 @fun526() {
ret i32 526
}

LLVM IR (-O2):
define i32 @fun526() {
ret i32 526
}
/* Variables and functions */
int /*<<< orphan*/ general_uintformat(char *, unsigned long, int, int);
void hex_str(char *buf, unsigned long value, int num_chr) {
  general_uintformat(buf, value, 16, (num_chr - 1) ? num_chr : 8);
}


x86 assembly (clang, -O0):
<hex_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
je     114d <hex_str+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    115a <hex_str+0x4a>
mov    $0x8,%eax
mov    %eax,-0x2c(%rbp)
jmp    115a <hex_str+0x4a>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%ecx
mov    $0x10,%edx
call   1030 <general_uintformat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_str>:
cmp    $0x1,%edx
mov    $0x8,%ecx
cmovne %edx,%ecx
mov    $0x10,%edx
jmp    1030 <general_uintformat@plt>

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

LLVM IR (-O2):
define void @hex_str(i8* %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 1
%5 = select i1 %4, i32 8, i32 %2
%6 = tail call i32 @general_uintformat(i8* %0, i64 %1, i32 16, i32 %5)
ret void
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t ret = 0;
  while (str[ret] != 0) {
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
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 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca 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 @strlen(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
}