xunge/DecIR huggingface dataset:
void to_upper(char *buf) {
  char c;
  while ((c = *buf) != '\0') {
    if (c >= 'a' && c <= 'z')
      *buf -= 32;
    buf++;
  }
}


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1154 <to_upper+0x54>
movsbl -0x9(%rbp),%eax
cmp    $0x61,%eax
jl     1143 <to_upper+0x43>
movsbl -0x9(%rbp),%eax
cmp    $0x7a,%eax
jg     1143 <to_upper+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <to_upper+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
mov    (%rdi),%al
test   %al,%al
je     112a <to_upper+0x2a>
add    $0x1,%rdi
jmp    111b <to_upper+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <to_upper+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <to_upper+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <to_upper+0x10>
ret

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

LLVM IR (-O2):
define void @to_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
void create_cover_dock() {}


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

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

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

LLVM IR (-O2):
define void @create_cover_dock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char a = 0;
  while (a <= '~') {
    printf("%d %c \n", a, a);
    ++a;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
jg     1153 <main+0x43>
mov    -0x5(%rbp),%al
lea    0xec6(%rip),%rdi
movsbl %al,%esi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%bl
cmp    $0x7f,%bl
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d %c \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %2)
%4 = add nuw nsw i8 %2, 1
%5 = icmp eq i8 %4, 127
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int *realloc(int *, int);
size_t add_to_int_array(int **array, size_t len, int what) {
  int *p;
  p = realloc(*array, sizeof(int) * (len + 1));
  if (p != NULL) {
    *array = p;
    (*array)[len++] = what;
  }
  return len;
}


x86 assembly (clang, -O0):
<add_to_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1173 <add_to_int_array+0x63>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x10(%rbp)
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_to_int_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbp
mov    (%rdi),%rdi
lea    0x1(%rsi),%rbx
lea    0x0(,%rbx,4),%esi
call   1030 <realloc@plt>
test   %rax,%rax
je     1142 <add_to_int_array+0x32>
mov    %rax,0x0(%rbp)
mov    %r15d,(%rax,%r14,4)
jmp    1145 <add_to_int_array+0x35>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @add_to_int_array(i32** nocapture %0, i64 %1, i32 %2) {
%4 = load i32*, i32** %0
%5 = add i64 %1, 1
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 2
%8 = tail call i32* @realloc(i32* %4, i32 %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %12, label %10
10: ; preds = %3
store i32* %8, i32** %0
%11 = getelementptr inbounds i32, i32* %8, i64 %1
store i32 %2, i32* %11
br label %12
12: ; preds = %10, %3
%13 = phi i64 [ %5, %10 ], [ %1, %3 ]
ret i64 %13
}
int test_ezThreeFourths(int x) { return (x * 3) / 4; }


x86 assembly (clang, -O0):
<test_ezThreeFourths>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ezThreeFourths>:
lea    (%rdi,%rdi,2),%ecx
lea    (%rdi,%rdi,2),%eax
add    $0x3,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @test_ezThreeFourths(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
%5 = sdiv i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_ezThreeFourths(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = sdiv i32 %2, 4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xb7() {
  Assert_real((isxdigit(183) == 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_isxdigit.c",
              920, ("isxdigit should be 0 for 0xb7"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x398,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xb7\00"
define void @t_isxdigit_0xb7() {
%1 = call i64 @isxdigit(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xb7\00"
define void @t_isxdigit_0xb7() {
%1 = tail call i64 @isxdigit(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void testMacroUsedAsGuard(int *p) {
  if ((!(p)))
    *p = 1;
}


x86 assembly (clang, -O0):
<testMacroUsedAsGuard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111d <testMacroUsedAsGuard+0x1d>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testMacroUsedAsGuard(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i32*, i32** %2
store i32 1, i32* %6
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @testMacroUsedAsGuard(i32* readnone %0) {
%2 = icmp ne i32* %0, null
tail call void @llvm.assume(i1 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yyparse();
int main() {
  printf("\n");
  yyparse();
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <yyparse@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (...) @yyparse()
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
int do_167() { return 167; }


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

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

LLVM IR (-O0):
define i32 @do_167() {
ret i32 167
}

LLVM IR (-O2):
define i32 @do_167() {
ret i32 167
}
void ranvec(n, pbuf) int n;
double pbuf[];
{
  int i;
  double ran1();
  for (i = 0; i < n; i++)
    pbuf[i] = ran1();
}


x86 assembly (clang, -O0):
<ranvec>:
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 <ranvec+0x44>
mov    $0x0,%al
call   1030 <ran1@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <ranvec+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranvec>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <ranvec+0x36>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ran1@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <ranvec+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ranvec(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %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 = call double (...) @ran1()
%12 = load double*, double** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
store double %11, double* %15
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 @ranvec(i32 %0, double* nocapture writeonly %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 = tail call double (...) @ran1()
%9 = getelementptr inbounds double, double* %1, i64 %7
store double %8, double* %9
%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
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  char note[] = "See you at the snack bar.";
  char *ptr;
  ptr = note;
  puts(ptr);
  puts(++ptr);
  note[7] = '\0';
  puts(note);
  puts(++ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed1(%rip),%ax
mov    %ax,-0x8(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x28(%rbp)
call   1030 <puts@plt>
movb   $0x0,-0x19(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x28(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x28(%rbp)
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xeee(%rip),%xmm0
movups %xmm0,0xa(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x1(%rsp),%rdi
call   1030 <puts@plt>
movb   $0x0,0x7(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x2(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.note = [26 x i8] c"See you at the snack bar.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [26 x i8]* %2 to i8*
%5 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @puts(i8* %6)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = call i32 @puts(i8* %9)
%11 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 7
store i8 0, i8* %11
%12 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%13 = call i32 @puts(i8* %12)
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = call i32 @puts(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.note = [26 x i8] c"See you at the snack bar.\00"
define i32 @main() {
%1 = alloca [26 x i8]
%2 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 1
%5 = call i32 @puts(i8* %4)
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 7
store i8 0, i8* %6
%7 = call i32 @puts(i8* %2)
%8 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 2
%9 = call i32 @puts(i8* %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ inc_addr(void *, int);
int link(char *, char *);
int bad_link(void *addr) {
  return link((char *)addr, (char *)inc_addr(addr, 1));
}


x86 assembly (clang, -O0):
<bad_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <inc_addr@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
call   1040 <link@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_link>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <inc_addr@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <link@plt>

LLVM IR (-O0):
define i32 @bad_link(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @inc_addr(i8* %4, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @link(i8* %3, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bad_link(i8* %0) {
%2 = tail call i64 @inc_addr(i8* %0, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @link(i8* %0, i8* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ stderr;
void print_double(double m) { fprintf(stderr, "%f", m); }


x86 assembly (clang, -O0):
<print_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_double>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%f\00"
define void @print_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @stderr
%4 = load double, double* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%f\00"
define void @print_double(double %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
bool isempty(struct node *head) {
  if (head == NULL)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <isempty+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <isempty+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isempty>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @isempty(%struct.node* %0) {
%2 = alloca i32
%3 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
%4 = load %struct.node*, %struct.node** %3
%5 = icmp eq %struct.node* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @isempty(%struct.node* readnone %0) {
%2 = icmp eq %struct.node* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
int isescape(char buf[8]) { return buf[0] == 27 && buf[1] == 0; }


x86 assembly (clang, -O0):
<isescape>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x1b,%ecx
mov    %al,-0x9(%rbp)
jne    112e <isescape+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isescape>:
xor    %eax,%eax
cmpb   $0x1b,(%rdi)
jne    1110 <isescape+0x10>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isescape(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 27
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
float RoughnessToGAlpha(float roughness) {
  float alphag = roughness * .5 + .5;
  alphag *= alphag;
  return alphag;
}


x86 assembly (clang, -O0):
<RoughnessToGAlpha>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoughnessToGAlpha>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @RoughnessToGAlpha(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = call double @llvm.fmuladd.f64(double %5, double 5.000000e-01, double 5.000000e-01)
%7 = fptrunc double %6 to float
store float %7, float* %3
%8 = load float, float* %3
%9 = load float, float* %3
%10 = fmul float %9, %8
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @RoughnessToGAlpha(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 5.000000e-01, double 5.000000e-01)
%4 = fptrunc double %3 to float
%5 = fmul float %4, %4
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ retmsg;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int super_system(char *, char *, int);
int main() {
  char *cmd = "whoami";
  char *cmd1 = "initctl list | grep process | wc -l";
  char retmsg[1024] = {0};
  int ret = 0;
  ret = super_system(cmd, retmsg, sizeof(retmsg));
  printf("system nfs ret is %d retmsg is \n%s\n", ret, retmsg);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movl   $0x0,-0x424(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1050 <super_system@plt>
mov    %eax,-0x424(%rbp)
mov    -0x424(%rbp),%esi
lea    -0x420(%rbp),%rdx
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1050 <super_system@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"whoami\00"
@.str.1 = [36 x i8] c"initctl list | grep process | wc -l\00"
@.str.2 = [36 x i8] c"system nfs ret is %d retmsg is \0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [1024 x i8]
%5 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = bitcast [1024 x i8]* %4 to i8*
store i32 0, i32* %5
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = call i32 @super_system(i8* %7, i8* %8, i32 1024)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %10, i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"whoami\00"
@.str.2 = [36 x i8] c"system nfs ret is %d retmsg is \0A%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @super_system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1024)
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %3, i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
readshm(int shmid, char *segptr) { printf("segptr: %s\n", segptr); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"segptr: %s\0A\00"
define i32 @readshm(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 undef
}
void ble_rsp_sm_get_bonds(const struct ble_msg_sm_get_bonds_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_sm_get_bonds_rsp_t = type opaque
define void @ble_rsp_sm_get_bonds(%struct.ble_msg_sm_get_bonds_rsp_t* %0) {
%2 = alloca %struct.ble_msg_sm_get_bonds_rsp_t*
store %struct.ble_msg_sm_get_bonds_rsp_t* %0, %struct.ble_msg_sm_get_bonds_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_sm_get_bonds_rsp_t = type opaque
define void @ble_rsp_sm_get_bonds(%struct.ble_msg_sm_get_bonds_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dsyev_(char *, char *, int *, double *, int *, double *,
                          double *, int *, int *);
void dsyev(char jobz, char uplo, int n, double *a, int lda, double *w,
           double *work, int lwork, int *info) {
  dsyev_(&jobz, &uplo, &n, a, &lda, w, work, &lwork, info);
}


x86 assembly (clang, -O0):
<dsyev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    0x20(%rbp),%rdi
mov    0x18(%rbp),%edi
mov    0x10(%rbp),%rdi
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x20(%rbp),%rax
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x14(%rbp),%r8
lea    0x18(%rbp),%r10
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <dsyev_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsyev>:
sub    $0x18,%rsp
mov    0x20(%rsp),%r10
mov    0x30(%rsp),%r11
mov    %dil,0xf(%rsp)
mov    %sil,0xe(%rsp)
mov    %edx,0x14(%rsp)
mov    %r8d,0x10(%rsp)
sub    $0x8,%rsp
lea    0x30(%rsp),%rax
lea    0x17(%rsp),%rdi
lea    0x16(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%r8
push   %r11
push   %rax
push   %r10
call   1030 <dsyev_@plt>
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define void @dsyev(i8 signext %0, i8 signext %1, i32 %2, double* %3, i32 %4, double* %5, double* %6, i32 %7, i32* %8) {
%10 = alloca i8
%11 = alloca i8
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8 %0, i8* %10
store i8 %1, i8* %11
store i32 %2, i32* %12
store i32 %4, i32* %13
store i32 %7, i32* %14
%15 = call i32 @dsyev_(i8* %10, i8* %11, i32* %12, double* %3, i32* %13, double* %5, double* %6, i32* %14, i32* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateIntEnable(unsigned long ulIntFlags) {

  ;
  (*((volatile unsigned long *)(0x400FC014))) |= ulIntFlags;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400fc014,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fc014,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntEnable>:
or     %rdi,0x400fc014
40
xor    %eax,%eax
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074774036 to i64*)
%6 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateIntEnable(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074774036 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074774036 to i64*)
%4 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outportb(int, int);
void irq_remap(void) {
  outportb(0x20, 0x11);
  outportb(0xA0, 0x11);
  outportb(0x21, 0x20);
  outportb(0xA1, 0x28);
  outportb(0x21, 0x04);
  outportb(0xA1, 0x02);
  outportb(0x21, 0x01);
  outportb(0xA1, 0x01);
  outportb(0x21, 0x0);
  outportb(0xA1, 0x0);
}


x86 assembly (clang, -O0):
<irq_remap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_remap>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <outportb@plt>
mov    $0x21,%edi
xor    %esi,%esi
call   1030 <outportb@plt>
mov    $0xa1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outportb@plt>

LLVM IR (-O0):
define void @irq_remap() {
%1 = call i32 @outportb(i32 32, i32 17)
%2 = call i32 @outportb(i32 160, i32 17)
%3 = call i32 @outportb(i32 33, i32 32)
%4 = call i32 @outportb(i32 161, i32 40)
%5 = call i32 @outportb(i32 33, i32 4)
%6 = call i32 @outportb(i32 161, i32 2)
%7 = call i32 @outportb(i32 33, i32 1)
%8 = call i32 @outportb(i32 161, i32 1)
%9 = call i32 @outportb(i32 33, i32 0)
%10 = call i32 @outportb(i32 161, i32 0)
ret void
}

LLVM IR (-O2):
define void @irq_remap() {
%1 = tail call i32 @outportb(i32 32, i32 17)
%2 = tail call i32 @outportb(i32 160, i32 17)
%3 = tail call i32 @outportb(i32 33, i32 32)
%4 = tail call i32 @outportb(i32 161, i32 40)
%5 = tail call i32 @outportb(i32 33, i32 4)
%6 = tail call i32 @outportb(i32 161, i32 2)
%7 = tail call i32 @outportb(i32 33, i32 1)
%8 = tail call i32 @outportb(i32 161, i32 1)
%9 = tail call i32 @outportb(i32 33, i32 0)
%10 = tail call i32 @outportb(i32 161, i32 0)
ret void
}
/* Variables and functions */
int strspn(char *, char *);
int LineIsBlank(char *s) {
  register char *t;
  t = s + strspn(s, " \t\n\v\r");
  return (*t == '\0');
}


x86 assembly (clang, -O0):
<LineIsBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strspn@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LineIsBlank>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rbx,%rcx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c" \09\0A\0B\0D\00"
define i32 @LineIsBlank(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strspn(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [6 x i8] c" \09\0A\0B\0D\00"
define i32 @LineIsBlank(i8* nocapture %0) {
%2 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void dummy_hline(int x1 __attribute__((unused)), int x2 __attribute__((unused)),
                 int y __attribute__((unused)), int c __attribute__((unused))) {
}


x86 assembly (clang, -O0):
<dummy_hline>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_hline(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
ret void
}

LLVM IR (-O2):
define void @dummy_hline(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ adjust_seconds(int *, int *);
void julday_add(int days, int secs, int *julday, int *secofday) {
  int64_t sec_of_day = *secofday;
  sec_of_day += secs;
  *julday += days;
  adjust_seconds(julday, &sec_of_day);
  *secofday = (int)sec_of_day;
}


x86 assembly (clang, -O0):
<julday_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <adjust_seconds@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julday_add>:
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
add    (%rcx),%esi
mov    %esi,0xc(%rsp)
add    %edi,(%rdx)
lea    0xc(%rsp),%rsi
mov    %rdx,%rdi
call   1030 <adjust_seconds@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @julday_add(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %8
%11 = load i32, i32* %10
store i32 %11, i32* %9
%12 = load i32, i32* %6
%13 = load i32, i32* %9
%14 = add nsw i32 %13, %12
store i32 %14, i32* %9
%15 = load i32, i32* %5
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = add nsw i32 %17, %15
store i32 %18, i32* %16
%19 = load i32*, i32** %7
%20 = call i32 @adjust_seconds(i32* %19, i32* %9)
%21 = load i32, i32* %9
%22 = load i32*, i32** %8
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @julday_add(i32 %0, i32 %1, i32* %2, i32* nocapture %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %1
store i32 %8, i32* %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %0
store i32 %10, i32* %2
%11 = call i32 @adjust_seconds(i32* %2, i32* %5)
%12 = load i32, i32* %5
store i32 %12, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
void exit_logout(char *argv[]) {
  if (strcmp(argv[0], "logout") == 0)
    exit(0);
  if (strcmp(argv[0], "exit") == 0)
    exit(0);
}


x86 assembly (clang, -O0):
<exit_logout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xec6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1150 <exit_logout+0x30>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1174 <exit_logout+0x54>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_logout>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     114e <exit_logout+0x2e>
mov    (%rbx),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     114e <exit_logout+0x2e>
pop    %rbx
ret
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"logout\00"
@.str.1 = [5 x i8] c"exit\00"
define void @exit_logout(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = load i8*, i8** %0
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void debug() { printf("to do\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"to do\00"
define void @debug() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
void *kasan_reset_tag(const void *addr) { return (void *)addr; }


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

x86 assembly (clang, -O2):
<kasan_reset_tag>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @kasan_reset_tag(i8* readnone returned %0) {
ret i8* %0
}
void mdp4_dtv_vsync_ctrl(int cndx, int enable) {}


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

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

LLVM IR (-O0):
define void @mdp4_dtv_vsync_ctrl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @mdp4_dtv_vsync_ctrl(i32 %0, i32 %1) {
ret void
}
int lenStr(char *s) {
  int ret;
  for (ret = 0; *(s + ret); ret++)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<lenStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <lenStr+0x34>
jmp    1126 <lenStr+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lenStr+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenStr>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <lenStr+0x10>
ret

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

LLVM IR (-O2):
define i32 @lenStr(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_postscript_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("postscript", "%comment"),
                            "comment", "%comment");
}


x86 assembly (clang, -O0):
<test_postscript_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
lea    0xec4(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_postscript_comment_entities>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rbx
mov    %rbx,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xece(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"postscript\00"
@.str.1 = [9 x i8] c"%comment\00"
@.str.2 = [8 x i8] c"comment\00"
define void @test_postscript_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"postscript\00"
@.str.1 = [9 x i8] c"%comment\00"
@.str.2 = [8 x i8] c"comment\00"
define void @test_postscript_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void wsinit() {}


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

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

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

LLVM IR (-O2):
define void @wsinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("Working.. probably\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Working.. probably\0A\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Working.. probably\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}