xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ add_textual_variation_from_line(char *);
char *read_line(int /*<<< orphan*/ *);
void add_textual_variations_from_file(FILE *fpin) {
  char *line;
  while ((line = read_line(fpin)) != NULL) {
    add_textual_variation_from_line(line);
  }
}


x86 assembly (clang, -O0):
<add_textual_variations_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <read_line@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1151 <add_textual_variations_from_file+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <add_textual_variation_from_line@plt>
jmp    112c <add_textual_variations_from_file+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_textual_variations_from_file>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <read_line@plt>
test   %rax,%rax
je     1147 <add_textual_variations_from_file+0x27>
mov    %rax,%rdi
call   1030 <add_textual_variation_from_line@plt>
mov    %rbx,%rdi
jmp    1130 <add_textual_variations_from_file+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @add_textual_variations_from_file(i32* %0) {
%2 = tail call i8* @read_line(i32* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @add_textual_variation_from_line(i8* %5)
%7 = tail call i8* @read_line(i32* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
int switch2(unsigned a) {
  switch (a) {
  case 1 ... 5:
    return 1;
  case 9 ... 11:
    return a + 3;
  case 12 ... 13:
    return a + 3;
  default:
    return 44;
  }
}


x86 assembly (clang, -O0):
<switch2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x5,%eax
jb     1146 <switch2+0x46>
jmp    111e <switch2+0x1e>
mov    -0xc(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x3,%eax
jb     1152 <switch2+0x52>
jmp    1132 <switch2+0x32>
mov    -0xc(%rbp),%eax
add    $0xfffffff4,%eax
sub    $0x2,%eax
jb     1160 <switch2+0x60>
jmp    116e <switch2+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <switch2+0x75>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <switch2+0x75>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <switch2+0x75>
movl   $0x2c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch2>:
add    $0xffffffff,%edi
mov    $0x2c,%eax
cmp    $0xc,%edi
ja     111a <switch2+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @switch2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %5
i32 5, label %5
i32 9, label %6
i32 10, label %6
i32 11, label %6
i32 12, label %9
i32 13, label %9
]
5: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %13
6: ; preds = %1, %1, %1
%7 = load i32, i32* %3
%8 = add i32 %7, 3
store i32 %8, i32* %2
br label %13
9: ; preds = %1, %1
%10 = load i32, i32* %3
%11 = add i32 %10, 3
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 44, i32* %2
br label %13
13: ; preds = %12, %9, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.switch2 = [13 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 44, i32 44, i32 44, i32 12, i32 13, i32 14, i32 15, i32 16]
define i32 @switch2(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 13
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [13 x i32], [13 x i32]* @switch.table.switch2, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 44, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int divicion() {
  int a, b;
  printf(" Dos numeros para divicion\n");
  scanf("%d %d", &a, &b);
  return a / b;
}


x86 assembly (clang, -O0):
<divicion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divicion>:
push   %rax
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cltd
idivl  (%rsp)
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c" Dos numeros para divicion\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @divicion() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@str = [27 x i8] c" Dos numeros para divicion\00"
define i32 @divicion() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = sdiv i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x9c() {
  Assert_real((ispunct(156) == 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_ispunct.c",
              785, ("ispunct should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x311,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x9c\00"
define void @t_ispunct_0x9c() {
%1 = call i64 @ispunct(i32 156)
%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 785, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x9c\00"
define void @t_ispunct_0x9c() {
%1 = tail call i64 @ispunct(i32 156)
%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 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
void print_ulong(unsigned long n) { printf("%lu", n); }


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

x86 assembly (clang, -O2):
<print_ulong>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define void @print_ulong(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
void g_key_file_get_integer_list() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_get_integer_list() {
ret void
}
/* Variables and functions */
scalar_t__ worker_aux(void *);
void *mt_worker(void *data) {
  while (worker_aux(data) == 0)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<mt_worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <worker_aux@plt>
cmp    $0x0,%rax
jne    1134 <mt_worker+0x24>
jmp    111c <mt_worker+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_worker>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <worker_aux@plt>
test   %rax,%rax
je     1120 <mt_worker+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mt_worker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = call i64 @worker_aux(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mt_worker(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @worker_aux(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ emit_char(char);
void video_putchar(char c) {
  if (c == '\r')
    return;
  emit_char(c);
}


x86 assembly (clang, -O0):
<video_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
jne    1130 <video_putchar+0x20>
jmp    1139 <video_putchar+0x29>
movsbl -0x1(%rbp),%edi
call   1030 <emit_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<video_putchar>:
cmp    $0xd,%dil
jne    1117 <video_putchar+0x7>
ret
movsbl %dil,%edi
jmp    1030 <emit_char@plt>

LLVM IR (-O0):
define void @video_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 13
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i8, i8* %2
%9 = call i32 @emit_char(i8 signext %8)
br label %10
10: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @video_putchar(i8 signext %0) {
%2 = icmp eq i8 %0, 13
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @emit_char(i8 signext %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ put_error(char *);
void *ts_malloc(int size) {
  void *rtn;
  rtn = malloc(size);
  if (rtn == (void *)0)
    put_error("Could not allocate memory");
  return (rtn);
}


x86 assembly (clang, -O0):
<ts_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <ts_malloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <put_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <ts_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <put_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Could not allocate memory\00"
define i8* @ts_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @put_error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"Could not allocate memory\00"
define noalias i8* @ts_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @put_error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ RAND_cleanup();
void crypto_seed_prng_cleanup(void) { RAND_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @crypto_seed_prng_cleanup() {
%1 = tail call i32 (...) @RAND_cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _10conversion(int, int);
void testSequenceStackApp() { _10conversion(1348, 8); }


x86 assembly (clang, -O0):
<testSequenceStackApp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x544,%edi
mov    $0x8,%esi
call   1030 <_10conversion@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSequenceStackApp>:
mov    $0x544,%edi
mov    $0x8,%esi
jmp    1030 <_10conversion@plt>

LLVM IR (-O0):
define void @testSequenceStackApp() {
%1 = call i32 @_10conversion(i32 1348, i32 8)
ret void
}

LLVM IR (-O2):
define void @testSequenceStackApp() {
%1 = tail call i32 @_10conversion(i32 1348, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char toupper(char);
void Prova(char *s) {
  int i = 0;
  while (!isspace(s[i])) {
    s[i] = toupper(s[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<Prova>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1159 <Prova+0x39>
jmp    1185 <Prova+0x65>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <Prova+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Prova>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1040 <isspace@plt>
test   %eax,%eax
jne    114d <Prova+0x2d>
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1130 <Prova+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Prova(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isspace(i8 signext %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8* [ %11, %5 ], [ %0, %1 ]
%8 = load i8, i8* %7
%9 = tail call signext i8 @toupper(i8 signext %8)
store i8 %9, i8* %7
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = tail call i32 @isspace(i8 signext %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %5, label %15
15: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_verbose(char *);
void print_failed_internal() {
  print_verbose(
      "Found no matching internalhost, will now try to match for external\n");
}


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

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

LLVM IR (-O0):
@.str = [68 x i8] c"Found no matching internalhost, will now try to match for external\0A\00"
define void @print_failed_internal() {
%1 = call i32 @print_verbose(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"Found no matching internalhost, will now try to match for external\0A\00"
define void @print_failed_internal() {
%1 = tail call i32 @print_verbose(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
ret void
}
void tServerContextInfo(void) {}


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

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

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

LLVM IR (-O2):
define void @tServerContextInfo() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_srli_pi16(int /*<<< orphan*/, int);
__m64 test70(__m64 a) { return _mm_srli_pi16(a, 3); }


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

x86 assembly (clang, -O2):
<test70>:
mov    $0x3,%esi
jmp    1030 <_mm_srli_pi16@plt>

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

LLVM IR (-O2):
define i32 @test70(i32 %0) {
%2 = tail call i32 @_mm_srli_pi16(i32 %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void szl_unload(void *h) { dlclose(h); }


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

x86 assembly (clang, -O2):
<szl_unload>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @szl_unload(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
void process_simple_smtp_response(struct Seaper *seap, struct NetFrame *frame,
                                  const unsigned char *px, unsigned length) {
  seap;
  frame;
  px;
  length;
}


x86 assembly (clang, -O0):
<process_simple_smtp_response>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @process_simple_smtp_response(%struct.Seaper* %0, %struct.NetFrame* %1, i8* %2, i32 %3) {
%5 = alloca %struct.Seaper*
%6 = alloca %struct.NetFrame*
%7 = alloca i8*
%8 = alloca i32
store %struct.Seaper* %0, %struct.Seaper** %5
store %struct.NetFrame* %1, %struct.NetFrame** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.Seaper*, %struct.Seaper** %5
%10 = load %struct.NetFrame*, %struct.NetFrame** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @process_simple_smtp_response(%struct.Seaper* nocapture %0, %struct.NetFrame* nocapture %1, i8* nocapture %2, i32 %3) {
ret void
}
int cmpintp(const void *p1, const void *p2) {
  return *(const long *)p1 - *(const long *)p2;
}


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

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

LLVM IR (-O0):
define i32 @cmpintp(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 i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmpintp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
void _xabort(int);
void __xabort(int const I) { return _xabort(1); }


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

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

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

LLVM IR (-O2):
define void @__xabort(i32 %0) {
tail call void @_xabort(i32 1)
ret void
}
void setval_299(unsigned *p) { *p = 2447411528U; }


x86 assembly (clang, -O0):
<setval_299>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x91e08948,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_299>:
movl   $0x91e08948,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_299(i32* nocapture writeonly %0) {
store i32 -1847555768, i32* %0
ret void
}
int empty2() {}


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

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

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

LLVM IR (-O2):
define i32 @empty2() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int error_handle(char *error, int error_code, int critical) {
  printf("Error %d: %s\n", error_code, error);
  return error_code;
}


x86 assembly (clang, -O0):
<error_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_handle>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Error %d: %s\0A\00"
define i32 @error_handle(i8* %0, i32 returned %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ nrf_802154_swi_init();
void nrf_802154_priority_drop_init(void) { nrf_802154_swi_init(); }


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

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

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

LLVM IR (-O2):
define void @nrf_802154_priority_drop_init() {
%1 = tail call i32 (...) @nrf_802154_swi_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int, char *, int, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void putc(char c) { int80(4, 1, &c, 1, 0, 0); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4,%edi
mov    $0x1,%ecx
lea    -0x1(%rbp),%rdx
xor    %r9d,%r9d
mov    %ecx,%esi
mov    %r9d,%r8d
call   1030 <int80@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @int80(i32 4, i32 1, i8* %2, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @int80(i32 4, i32 1, i8* %2, i32 1, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void pc(char c) { printf("%c", c); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @pc(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeLine(short, short, short, short, short);
void drawFastVLine(short x, short y, short h, short color) {
  writeLine(x, y, x, y + h - 1, color);
}


x86 assembly (clang, -O0):
<drawFastVLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x2(%rbp),%cx
movswl -0x4(%rbp),%eax
movswl -0x6(%rbp),%edi
add    %edi,%eax
sub    $0x1,%eax
movswl %si,%edi
movswl %dx,%esi
movswl %cx,%edx
movswl %ax,%ecx
movswl -0x8(%rbp),%r8d
call   1030 <writeLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawFastVLine>:
mov    %ecx,%r8d
lea    (%rsi,%rdx,1),%eax
add    $0xffffffff,%eax
movswl %ax,%ecx
mov    %edi,%edx
jmp    1030 <writeLine@plt>

LLVM IR (-O0):
define void @drawFastVLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = load i16, i16* %6
%11 = load i16, i16* %5
%12 = load i16, i16* %6
%13 = sext i16 %12 to i32
%14 = load i16, i16* %7
%15 = sext i16 %14 to i32
%16 = add nsw i32 %13, %15
%17 = sub nsw i32 %16, 1
%18 = trunc i32 %17 to i16
%19 = load i16, i16* %8
%20 = call i32 @writeLine(i16 signext %9, i16 signext %10, i16 signext %11, i16 signext %18, i16 signext %19)
ret void
}

LLVM IR (-O2):
define void @drawFastVLine(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = add i16 %1, -1
%6 = add i16 %5, %2
%7 = tail call i32 @writeLine(i16 signext %0, i16 signext %1, i16 signext %0, i16 signext %6, i16 signext %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int line_length(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int characters_before_cursor(WINDOW *window, int y, int x) {
  int length = line_length(window, y, 0);
  if (length < x) {
    return length;
  }
  return x;
}


x86 assembly (clang, -O0):
<characters_before_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1030 <line_length@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    114a <characters_before_cursor+0x3a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <characters_before_cursor+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<characters_before_cursor>:
push   %rbx
mov    %edx,%ebx
xor    %edx,%edx
call   1030 <line_length@plt>
cmp    %ebx,%eax
cmovge %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @characters_before_cursor(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
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @line_length(i32* %9, i32 %10, i32 0)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %8
store i32 %16, i32* %4
br label %19
17: ; preds = %3
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @characters_before_cursor(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @line_length(i32* %0, i32 %1, i32 0)
%5 = icmp slt i32 %4, %2
%6 = select i1 %5, i32 %4, i32 %2
ret i32 %6
}
/* Type definitions */
struct gonc_linked_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gonc_entry_destroy(int /*<<< orphan*/);
int /*<<< orphan*/ gonc_linked_list_remove(struct gonc_linked_list *, size_t);
void gonc_linked_list_delete(struct gonc_linked_list *linked_list,
                             size_t index) {
  gonc_entry_destroy(gonc_linked_list_remove(linked_list, index));
}


x86 assembly (clang, -O0):
<gonc_linked_list_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gonc_linked_list_remove@plt>
mov    %eax,%edi
call   1040 <gonc_entry_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gonc_linked_list_delete>:
push   %rax
call   1030 <gonc_linked_list_remove@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <gonc_entry_destroy@plt>

LLVM IR (-O0):
%struct.gonc_linked_list = type { i32 }
define void @gonc_linked_list_delete(%struct.gonc_linked_list* %0, i64 %1) {
%3 = alloca %struct.gonc_linked_list*
%4 = alloca i64
store %struct.gonc_linked_list* %0, %struct.gonc_linked_list** %3
store i64 %1, i64* %4
%5 = load %struct.gonc_linked_list*, %struct.gonc_linked_list** %3
%6 = load i64, i64* %4
%7 = call i32 @gonc_linked_list_remove(%struct.gonc_linked_list* %5, i64 %6)
%8 = call i32 @gonc_entry_destroy(i32 %7)
ret void
}

LLVM IR (-O2):
%struct.gonc_linked_list = type { i32 }
define void @gonc_linked_list_delete(%struct.gonc_linked_list* %0, i64 %1) {
%3 = tail call i32 @gonc_linked_list_remove(%struct.gonc_linked_list* %0, i64 %1)
%4 = tail call i32 @gonc_entry_destroy(i32 %3)
ret void
}
void list_enum_cb(void *data, void *param) { printf("list data:%s\n", data); }


x86 assembly (clang, -O0):
<list_enum_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_enum_cb>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"list data:%s\0A\00"
define void @list_enum_cb(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"list data:%s\0A\00"
define void @list_enum_cb(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double sign(double x) { return (x >= 0) - (x < 0); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = load double, double* %2
%7 = fcmp olt double %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @sign(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt double %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to double
ret double %7
}
void geom_CM2_sph_tpr(double xm[], double xp[], double xc[], int dir) {
  xc[0] = 0.5 * (xm[0] + xp[0]);
  xc[1] = 0.5 * (xm[1] + xp[1]);
}


x86 assembly (clang, -O0):
<geom_CM2_sph_tpr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm1
movsd  0xed5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_CM2_sph_tpr>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
movsd  0xef0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
addsd  0x8(%rsi),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @geom_CM2_sph_tpr(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fadd double %11, %14
%16 = fmul double 5.000000e-01, %15
%17 = load double*, double** %7
%18 = getelementptr inbounds double, double* %17, i64 0
store double %16, double* %18
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double*, double** %6
%23 = getelementptr inbounds double, double* %22, i64 1
%24 = load double, double* %23
%25 = fadd double %21, %24
%26 = fmul double 5.000000e-01, %25
%27 = load double*, double** %7
%28 = getelementptr inbounds double, double* %27, i64 1
store double %26, double* %28
ret void
}

LLVM IR (-O2):
define void @geom_CM2_sph_tpr(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2, i32 %3) {
%5 = load double, double* %0
%6 = load double, double* %1
%7 = fadd double %5, %6
%8 = fmul double %7, 5.000000e-01
store double %8, double* %2
%9 = getelementptr inbounds double, double* %0, i64 1
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %1, i64 1
%12 = load double, double* %11
%13 = fadd double %10, %12
%14 = fmul double %13, 5.000000e-01
%15 = getelementptr inbounds double, double* %2, i64 1
store double %14, double* %15
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int rm;
typedef int reg;
typedef int mod;

/* Variables and functions */
int /*<<< orphan*/ write_byte(int);
void emit_modrm(uint8_t mod, uint8_t reg, uint8_t rm, uint8_t rex) {
  if (rex)
    write_byte(rex);
  write_byte(((((mod)&0x3) << 6) | (((reg)&0x7) << 3) | ((rm)&0x7)));
}


x86 assembly (clang, -O0):
<emit_modrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1136 <emit_modrm+0x26>
mov    -0x10(%rbp),%edi
call   1030 <write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0x3,%edi
shl    $0x6,%edi
mov    -0x8(%rbp),%eax
and    $0x7,%eax
shl    $0x3,%eax
or     %eax,%edi
mov    -0xc(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1030 <write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_modrm>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
test   %ecx,%ecx
je     1126 <emit_modrm+0x16>
mov    %ecx,%edi
call   1030 <write_byte@plt>
shl    $0x6,%ebp
movzbl %bpl,%eax
and    $0x7,%r14d
lea    (%rax,%r14,8),%eax
and    $0x7,%ebx
or     %eax,%ebx
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write_byte@plt>

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

LLVM IR (-O2):
define void @emit_modrm(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @write_byte(i32 %3)
br label %8
8: ; preds = %6, %4
%9 = shl i32 %0, 6
%10 = and i32 %9, 192
%11 = shl i32 %1, 3
%12 = and i32 %11, 56
%13 = or i32 %12, %10
%14 = and i32 %2, 7
%15 = or i32 %13, %14
%16 = tail call i32 @write_byte(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unit_error(char *, char const *, int);
void assert_null(void *real, const char *caller, int line) {
  if (real != NULL) {
    unit_error("%s:%d should be NULL", caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <assert_null+0x31>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <unit_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_null>:
test   %rdi,%rdi
je     1121 <assert_null+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <unit_error@plt>
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s:%d should be NULL\00"
define void @assert_null(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @unit_error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s:%d should be NULL\00"
define void @assert_null(i8* readnone %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @unit_error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
void *bug1021_test_1(void *x, int y) { return (void *)(y * y + (size_t)x); }


x86 assembly (clang, -O0):
<bug1021_test_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
mov    -0x8(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug1021_test_1>:
imul   %esi,%esi
lea    (%rsi,%rdi,1),%rax
ret

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

LLVM IR (-O2):
define i8* @bug1021_test_1(i8* %0, i32 %1) {
%3 = mul nsw i32 %1, %1
%4 = zext i32 %3 to i64
%5 = ptrtoint i8* %0 to i64
%6 = add i64 %4, %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
unsigned long count_masked_bytes(unsigned long);
unsigned long find_zero(unsigned long mask) { return count_masked_bytes(mask); }


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

x86 assembly (clang, -O2):
<find_zero>:
jmp    1030 <count_masked_bytes@plt>

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

LLVM IR (-O2):
define i64 @find_zero(i64 %0) {
%2 = tail call i64 @count_masked_bytes(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage: %s #words Seed\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s #words Seed\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 i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s #words Seed\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int kb(double bytes) { return (int)(bytes / 1024.0 + 0.5); }


x86 assembly (clang, -O0):
<kb>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @kb(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.024000e+03
%5 = fadd double %4, 5.000000e-01
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @kb(double %0) {
%2 = fmul double %0, 0x3F50000000000000
%3 = fadd double %2, 5.000000e-01
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *ealloc(size_t sz) {
  void *p;
  p = malloc(sz);
  if (p == NULL) {
    fprintf(stderr, "fail to alloc: %ld\n", sz);
    exit(-2);
  }
  return p;
}


x86 assembly (clang, -O0):
<ealloc>:
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 <ealloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ealloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <ealloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"fail to alloc: %ld\0A\00"
define i8* @ealloc(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 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 -2)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"fail to alloc: %ld\0A\00"
define noalias i8* @ealloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 -2)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ use_and_mayinit(int, int *);
void call_to_use_and_mayinit_bad_FN() {
  int x;
  use_and_mayinit(x, &x);
}


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

x86 assembly (clang, -O2):
<call_to_use_and_mayinit_bad_FN>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <use_and_mayinit@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_to_use_and_mayinit_bad_FN() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @use_and_mayinit(i32 %2, i32* %1)
ret void
}

LLVM IR (-O2):
define void @call_to_use_and_mayinit_bad_FN() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @use_and_mayinit(i32 undef, i32* %1)
ret void
}