xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void do_script(char *start, int lineno) {
  if (*start == '\0') {
    printf("Error: invalid line %d\n", lineno);
    exit(1);
  }
  printf("\n\t%s\n", start);
}


x86 assembly (clang, -O0):
<do_script>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115a <do_script+0x3a>
mov    -0xc(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_script>:
push   %rax
cmpb   $0x0,(%rdi)
je     113b <do_script+0x1b>
mov    %rdi,%rax
lea    0xee8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Error: invalid line %d\0A\00"
@.str.1 = [6 x i8] c"\0A\09%s\0A\00"
define void @do_script(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Error: invalid line %d\0A\00"
@.str.1 = [6 x i8] c"\0A\09%s\0A\00"
define void @do_script(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int remove(char const *);
int hoof_hook_remove(const char *pathname) { return remove(pathname); }


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

x86 assembly (clang, -O2):
<hoof_hook_remove>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @hoof_hook_remove(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
int f3(x, y)
int x;
char y;
{ return x; }


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

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

LLVM IR (-O0):
define i32 @f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = trunc i32 %1 to i8
store i32 %0, i32* %3
store i8 %5, i8* %4
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @f3(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int degF = 28;
  float degC;
  printf("%i degrees F in C is %f\n", degF, (degF - 32) / 1.8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1c,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1c,%esi
mov    $0xfffffffe,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%i degrees F in C is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 28, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"%i degrees F in C is %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 28, i32 -2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ **xcalloc(int, int);
uint8_t **pbm_init(void) {
  uint8_t **retv = xcalloc(0x10000, sizeof(void *));
  return retv;
}


x86 assembly (clang, -O0):
<pbm_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10000,%edi
mov    $0x8,%esi
call   1030 <xcalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbm_init>:
mov    $0x10000,%edi
mov    $0x8,%esi
jmp    1030 <xcalloc@plt>

LLVM IR (-O0):
define i32** @pbm_init() {
%1 = alloca i32**
%2 = call i32** @xcalloc(i32 65536, i32 8)
store i32** %2, i32*** %1
%3 = load i32**, i32*** %1
ret i32** %3
}

LLVM IR (-O2):
define i32** @pbm_init() {
%1 = tail call i32** @xcalloc(i32 65536, i32 8)
ret i32** %1
}
/* Type definitions */
typedef int /*<<< orphan*/ XML_Parser;

/* Variables and functions */
int /*<<< orphan*/ XML_SetCharacterDataHandler(int /*<<< orphan*/,
                                               int /*<<< orphan*/);
int /*<<< orphan*/ XML_SetElementHandler(int /*<<< orphan*/, int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ XML_StopParser(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void abort_parsing(XML_Parser p) {
  perror("abort XML parsing");
  XML_SetElementHandler(p, 0, 0);
  XML_SetCharacterDataHandler(p, 0);
  XML_StopParser(p, 0);
}


x86 assembly (clang, -O0):
<abort_parsing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1060 <perror@plt>
mov    -0x4(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <XML_SetElementHandler@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <XML_SetCharacterDataHandler@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <XML_StopParser@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abort_parsing>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
call   1060 <perror@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <XML_SetElementHandler@plt>
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <XML_SetCharacterDataHandler@plt>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <XML_StopParser@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"abort XML parsing\00"
define void @abort_parsing(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @XML_SetElementHandler(i32 %4, i32 0, i32 0)
%6 = load i32, i32* %2
%7 = call i32 @XML_SetCharacterDataHandler(i32 %6, i32 0)
%8 = load i32, i32* %2
%9 = call i32 @XML_StopParser(i32 %8, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"abort XML parsing\00"
define void @abort_parsing(i32 %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @XML_SetElementHandler(i32 %0, i32 0, i32 0)
%4 = tail call i32 @XML_SetCharacterDataHandler(i32 %0, i32 0)
%5 = tail call i32 @XML_StopParser(i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void use_chord_font() { printf("CHORD_FONT setfont\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"CHORD_FONT setfont\0A\00"
define void @use_chord_font() {
%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"CHORD_FONT setfont\00"
define void @use_chord_font() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int code_convert(char *, char *, char *, size_t, char *, size_t);
int g2u(char *inbuf, size_t inlen, char *outbuf, size_t outlen) {
  return code_convert("gb2312", "utf-8", inbuf, inlen, outbuf, outlen);
}


x86 assembly (clang, -O0):
<g2u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xec1(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1030 <code_convert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2u>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xedd(%rip),%rdi
lea    0xedd(%rip),%rsi
jmp    1030 <code_convert@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"gb2312\00"
@.str.1 = [6 x i8] c"utf-8\00"
define i32 @g2u(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @code_convert(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %9, i64 %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"gb2312\00"
@.str.1 = [6 x i8] c"utf-8\00"
define i32 @g2u(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @code_convert(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i64 %1, i8* %2, i64 %3)
ret i32 %5
}
void der(int x, int y, int mat[3][3]) {
  mat[x][y] = mat[x][y + 1];
  mat[x][y + 1] = 0;
}


x86 assembly (clang, -O0):
<der>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<der>:
movslq %edi,%rax
lea    (%rax,%rax,2),%rax
lea    (%rdx,%rax,4),%rax
movslq %esi,%rcx
mov    0x4(%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
movl   $0x0,0x4(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @der(i32 %0, i32 %1, [3 x i32]* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca [3 x i32]*
store i32 %0, i32* %4
store i32 %1, i32* %5
store [3 x i32]* %2, [3 x i32]** %6
%7 = load [3 x i32]*, [3 x i32]** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 %9
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = load [3 x i32]*, [3 x i32]** %6
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %16, i64 %18
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %19, i64 0, i64 %21
store i32 %15, i32* %22
%23 = load [3 x i32]*, [3 x i32]** %6
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %23, i64 %25
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %26, i64 0, i64 %29
store i32 0, i32* %30
ret void
}

LLVM IR (-O2):
define void @der(i32 %0, i32 %1, [3 x i32]* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = add nsw i32 %1, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 %4, i64 %6
%8 = load i32, i32* %7
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 %4, i64 %9
store i32 %8, i32* %10
store i32 0, i32* %7
ret void
}
int cmp(const void *pa, const void *pb) {
  char a = *(const char *)pa;
  char b = *(const char *)pb;
  return a < b ? -1 : a == b ? 0 : -1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
jge    113b <cmp+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1152 <cmp+0x52>
movsbl -0x11(%rbp),%edx
movsbl -0x12(%rbp),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
store i8 %10, i8* %6
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %25
17: ; preds = %2
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %19, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 0, i32 -1
br label %25
25: ; preds = %17, %16
%26 = phi i32 [ -1, %16 ], [ %24, %17 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
int is_dotty(const int symbology) {
  switch (symbology) {
  case 58:
  case 71:
  case 97:
  case 102:
  case 92:
  case 104:
  case 112:
  case 128:
  case 141:
  case 142:
  case 116:
  case 115:
  case 143:
  case 145:
    return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_dotty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffc6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x57,%eax
ja     113c <is_dotty+0x3c>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1143 <is_dotty+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dotty>:
add    $0xffffffc6,%edi
cmp    $0x57,%edi
ja     111e <is_dotty+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_dotty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 58, label %5
i32 71, label %5
i32 97, label %5
i32 102, label %5
i32 92, label %5
i32 104, label %5
i32 112, label %5
i32 128, label %5
i32 141, label %5
i32 142, label %5
i32 116, label %5
i32 115, label %5
i32 143, label %5
i32 145, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_dotty(i32 %0) {
switch i32 %0, label %2 [
i32 58, label %3
i32 71, label %3
i32 97, label %3
i32 102, label %3
i32 92, label %3
i32 104, label %3
i32 112, label %3
i32 128, label %3
i32 141, label %3
i32 142, label %3
i32 116, label %3
i32 115, label %3
i32 143, label %3
i32 145, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cpu_irq_enable();
void sched_unlock(void) { cpu_irq_enable(); }


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

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

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

LLVM IR (-O2):
define void @sched_unlock() {
%1 = tail call i32 (...) @cpu_irq_enable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configureBlePriv12Patch();
int /*<<< orphan*/ enterBlePriv12CpePatch();
int /*<<< orphan*/ enterBlePriv12SysPatch();
void applyBlePriv12Patch(void) {
  enterBlePriv12SysPatch();
  enterBlePriv12CpePatch();
  configureBlePriv12Patch();
}


x86 assembly (clang, -O0):
<applyBlePriv12Patch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <enterBlePriv12SysPatch@plt>
mov    $0x0,%al
call   1030 <enterBlePriv12CpePatch@plt>
mov    $0x0,%al
call   1040 <configureBlePriv12Patch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyBlePriv12Patch>:
push   %rax
xor    %eax,%eax
call   1050 <enterBlePriv12SysPatch@plt>
xor    %eax,%eax
call   1030 <enterBlePriv12CpePatch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <configureBlePriv12Patch@plt>

LLVM IR (-O0):
define void @applyBlePriv12Patch() {
%1 = call i32 (...) @enterBlePriv12SysPatch()
%2 = call i32 (...) @enterBlePriv12CpePatch()
%3 = call i32 (...) @configureBlePriv12Patch()
ret void
}

LLVM IR (-O2):
define void @applyBlePriv12Patch() {
%1 = tail call i32 (...) @enterBlePriv12SysPatch()
%2 = tail call i32 (...) @enterBlePriv12CpePatch()
%3 = tail call i32 (...) @configureBlePriv12Patch()
ret void
}
int attributed_comparison(const void *__attribute__((littleendian)) a,
                          const void *__attribute__((littleendian)) b) {
  unsigned int *ia = (unsigned int *)a;
  unsigned int *ib = (unsigned int *)b;
  if (*ia < *ib)
    return -1;
  if (*ib < *ia)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<attributed_comparison>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jae    113a <attributed_comparison+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <attributed_comparison+0x5f>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jae    1158 <attributed_comparison+0x58>
movl   $0x1,-0x4(%rbp)
jmp    115f <attributed_comparison+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<attributed_comparison>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %eax,%ecx
setb   %dl
mov    $0xffffffff,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @attributed_comparison(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ult i32 %5, %6
%8 = icmp ult i32 %6, %5
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
int pthread_setaffinity_np(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int pthread_set_core_affinity(unsigned core) {
  pthread_t thread = pthread_self();
  cpu_set_t csmask;
  CPU_ZERO(&csmask);
  CPU_SET(core, &csmask);
  return pthread_setaffinity_np(thread, sizeof(cpu_set_t), &csmask);
}


x86 assembly (clang, -O0):
<pthread_set_core_affinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1060 <CPU_SET@plt>
mov    -0x8(%rbp),%edi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
call   1030 <pthread_setaffinity_np@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_set_core_affinity>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r14d
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%ebp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <CPU_ZERO@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1060 <CPU_SET@plt>
mov    %ebp,%edi
mov    $0x4,%esi
mov    %rbx,%rdx
call   1030 <pthread_setaffinity_np@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pthread_set_core_affinity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @pthread_self()
store i32 %5, i32* %3
%6 = call i32 @CPU_ZERO(i32* %4)
%7 = load i32, i32* %2
%8 = call i32 @CPU_SET(i32 %7, i32* %4)
%9 = load i32, i32* %3
%10 = call i32 @pthread_setaffinity_np(i32 %9, i32 4, i32* %4)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pthread_set_core_affinity(i32 %0) {
%2 = alloca i32
%3 = tail call i32 (...) @pthread_self()
%4 = bitcast i32* %2 to i8*
%5 = call i32 @CPU_ZERO(i32* %2)
%6 = call i32 @CPU_SET(i32 %0, i32* %2)
%7 = call i32 @pthread_setaffinity_np(i32 %3, i32 4, i32* %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int sum(int, int);
void main() {
  int a;
  int b;
  int result = sum(a, b);
  if (result != a + b) {
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
je     114e <main+0x2e>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <sum@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @sum(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
%11 = icmp ne i32 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (...) @__VERIFIER_error()
br label %14
14: ; preds = %12, %0
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @sum(i32 undef, i32 undef)
ret void
}
int f_ge_mr2(float *a1, float a2) { return !(((*a1) >= (a2))); }


x86 assembly (clang, -O0):
<f_ge_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0xc(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ge_mr2>:
movss  (%rdi),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @f_ge_mr2(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp oge float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_ge_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ult float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_14int8_reg(signed char val) {
  return ((val) & (0x14 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_14int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x14,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_14int8_reg>:
test   $0x14,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14int8_reg(i8 signext %0) {
%2 = and i8 %0, 20
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ diagnostics(int, char *);
int /*<<< orphan*/ endCurrentField();
int /*<<< orphan*/ putRtfStrEscaped(char *);
int /*<<< orphan*/ startField(int);
void WriteEquationAsComment(char *pre, char *eq, char *post) {
  diagnostics(3, "WriteEquationAsComment");
  startField(6);
  putRtfStrEscaped(pre);
  putRtfStrEscaped(eq);
  putRtfStrEscaped(post);
  endCurrentField();
}


x86 assembly (clang, -O0):
<WriteEquationAsComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x3,%edi
lea    0xea0(%rip),%rsi
call   1030 <diagnostics@plt>
mov    $0x6,%edi
call   1060 <startField@plt>
mov    -0x8(%rbp),%rdi
call   1050 <putRtfStrEscaped@plt>
mov    -0x10(%rbp),%rdi
call   1050 <putRtfStrEscaped@plt>
mov    -0x18(%rbp),%rdi
call   1050 <putRtfStrEscaped@plt>
mov    $0x0,%al
call   1040 <endCurrentField@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteEquationAsComment>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xeab(%rip),%rsi
mov    $0x3,%edi
call   1030 <diagnostics@plt>
mov    $0x6,%edi
call   1060 <startField@plt>
mov    %rbx,%rdi
call   1050 <putRtfStrEscaped@plt>
mov    %r15,%rdi
call   1050 <putRtfStrEscaped@plt>
mov    %r14,%rdi
call   1050 <putRtfStrEscaped@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <endCurrentField@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"WriteEquationAsComment\00"
define void @WriteEquationAsComment(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @diagnostics(i32 3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @startField(i32 6)
%9 = load i8*, i8** %4
%10 = call i32 @putRtfStrEscaped(i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @putRtfStrEscaped(i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @putRtfStrEscaped(i8* %13)
%15 = call i32 (...) @endCurrentField()
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"WriteEquationAsComment\00"
define void @WriteEquationAsComment(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @diagnostics(i32 3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @startField(i32 6)
%6 = tail call i32 @putRtfStrEscaped(i8* %0)
%7 = tail call i32 @putRtfStrEscaped(i8* %1)
%8 = tail call i32 @putRtfStrEscaped(i8* %2)
%9 = tail call i32 (...) @endCurrentField()
ret void
}
int raise(int x) {
  (void)x;
  do {
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <raise+0xc>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
ret i32 0
}
void outw(int port, unsigned short value) {
  __asm__("outw %w0, %w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    -0x4(%rbp),%edx
out    %ax,(%dx)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @outw(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w}, ${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %1, i32 %0)
ret void
}
/* Variables and functions */
unsigned long __udivsi3(unsigned long, unsigned long);
unsigned long __umodsi3(unsigned long a, unsigned long b) {
  return a - __udivsi3(a, b) * b;
}


x86 assembly (clang, -O0):
<__umodsi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__udivsi3@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__umodsi3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <__udivsi3@plt>
imul   %r14,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @__umodsi3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 @__udivsi3(i64 %6, i64 %7)
%9 = load i64, i64* %4
%10 = mul i64 %8, %9
%11 = sub i64 %5, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @__umodsi3(i64 %0, i64 %1) {
%3 = tail call i64 @__udivsi3(i64 %0, i64 %1)
%4 = mul i64 %3, %1
%5 = sub i64 %0, %4
ret i64 %5
}
/* Type definitions */
struct pt_tile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pt_tile *);
int /*<<< orphan*/ pt_tile_abort(struct pt_tile *);
void pt_tile_destroy(struct pt_tile *tile) {
  pt_tile_abort(tile);
  free(tile);
}


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

x86 assembly (clang, -O2):
<pt_tile_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pt_tile_abort@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.pt_tile = type { i32 }
define void @pt_tile_destroy(%struct.pt_tile* %0) {
%2 = alloca %struct.pt_tile*
store %struct.pt_tile* %0, %struct.pt_tile** %2
%3 = load %struct.pt_tile*, %struct.pt_tile** %2
%4 = call i32 @pt_tile_abort(%struct.pt_tile* %3)
%5 = load %struct.pt_tile*, %struct.pt_tile** %2
%6 = call i32 @free(%struct.pt_tile* %5)
ret void
}

LLVM IR (-O2):
%struct.pt_tile = type { i32 }
define void @pt_tile_destroy(%struct.pt_tile* %0) {
%2 = tail call i32 @pt_tile_abort(%struct.pt_tile* %0)
%3 = tail call i32 @free(%struct.pt_tile* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
scalar_t__ sbrk(int /*<<< orphan*/);
void *__default_morecore(ptrdiff_t increment) {
  void *result = (void *)sbrk(increment);
  if (result == (void *)-1)
    return 0;
  return result;
}


x86 assembly (clang, -O0):
<__default_morecore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <sbrk@plt>
mov    %rax,-0x18(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x18(%rbp)
jne    1145 <__default_morecore+0x35>
movq   $0x0,-0x8(%rbp)
jmp    114d <__default_morecore+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__default_morecore>:
push   %rax
call   1030 <sbrk@plt>
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @__default_morecore(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @sbrk(i32 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, inttoptr (i64 -1 to i8*)
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %13
11: ; preds = %1
%12 = load i8*, i8** %4
store i8* %12, i8** %2
br label %13
13: ; preds = %11, %10
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @__default_morecore(i32 %0) {
%2 = tail call i64 @sbrk(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i8* %3, inttoptr (i64 -1 to i8*)
%5 = select i1 %4, i8* null, i8* %3
ret i8* %5
}
int STEAM_Mount(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @STEAM_Mount() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ checked_free(char *);
char *getPath2(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getSetupDir();
char *getSetupFilename() {
  static char *filename = NULL;
  checked_free(filename);
  filename = getPath2(getSetupDir(), "setup.conf");
  return filename;
}


x86 assembly (clang, -O0):
<getSetupFilename>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f05(%rip),%rdi
call   1050 <checked_free@plt>
mov    $0x0,%al
call   1040 <getSetupDir@plt>
mov    %eax,%edi
lea    0xeb0(%rip),%rsi
call   1030 <getPath2@plt>
mov    %rax,0x2ee4(%rip)
mov    0x2edd(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSetupFilename>:
push   %rax
mov    0x2f08(%rip),%rdi
call   1050 <checked_free@plt>
xor    %eax,%eax
call   1040 <getSetupDir@plt>
lea    0xeb5(%rip),%rsi
mov    %eax,%edi
call   1030 <getPath2@plt>
mov    %rax,0x2ee7(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@getSetupFilename.filename = internal global i8* null
@.str = [11 x i8] c"setup.conf\00"
define i8* @getSetupFilename() {
%1 = load i8*, i8** @getSetupFilename.filename
%2 = call i32 @checked_free(i8* %1)
%3 = call i32 (...) @getSetupDir()
%4 = call i8* @getPath2(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @getSetupFilename.filename
%5 = load i8*, i8** @getSetupFilename.filename
ret i8* %5
}

LLVM IR (-O2):
@getSetupFilename.filename = internal unnamed_addr global i8* null
@.str = [11 x i8] c"setup.conf\00"
define i8* @getSetupFilename() {
%1 = load i8*, i8** @getSetupFilename.filename
%2 = tail call i32 @checked_free(i8* %1)
%3 = tail call i32 (...) @getSetupDir()
%4 = tail call i8* @getPath2(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** @getSetupFilename.filename
ret i8* %4
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ getUInt32FromConsole(char const *);
int16_t getInt16FromConsole(const char *consoleStr) {
  int16_t ret = 0;
  if (consoleStr != NULL) {
    ret = (int16_t)getUInt32FromConsole(consoleStr);
  }
  return ret;
}


x86 assembly (clang, -O0):
<getInt16FromConsole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <getInt16FromConsole+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <getUInt32FromConsole@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInt16FromConsole>:
test   %rdi,%rdi
je     111a <getInt16FromConsole+0xa>
jmp    1030 <getUInt32FromConsole@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @getInt16FromConsole(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @getUInt32FromConsole(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void document_close_html_stream(FILE *output_stream) {
  fprintf(output_stream, "</html>\n");
}


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

x86 assembly (clang, -O2):
<document_close_html_stream>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"</html>\0A\00"
define void @document_close_html_stream(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"</html>\0A\00"
define void @document_close_html_stream(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void chener16() { printf("chener16 likes pizza with lots of meat on it\n"); }


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"chener16 likes pizza with lots of meat on it\0A\00"
define void @chener16() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"chener16 likes pizza with lots of meat on it\00"
define void @chener16() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sprintf(char *, char *, char const *);
int sessionSet(char *pBuf, const char *session_id) {
  return sprintf(pBuf,
                 "Set-Cookie: "
                 "eserv_session"
                 "=%s\n",
                 session_id);
}


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

x86 assembly (clang, -O2):
<sessionSet>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Set-Cookie: eserv_session=%s\0A\00"
define i32 @sessionSet(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [30 x i8] c"Set-Cookie: eserv_session=%s\0A\00"
define i32 @sessionSet(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %3
}
int clamp(int lower, int val, int higher) {
  return val < lower ? lower : higher < val ? higher : val;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113b <clamp+0x3b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %esi,%edx
cmovge %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp slt i32 %2, %1
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int read(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int i2c_read(int file_handle, uint8_t *destination, uint8_t amount) {
  return read(file_handle, destination, amount);
}


x86 assembly (clang, -O0):
<i2c_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @i2c_read(i32 %0, i32* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void myprint(char *msg, int len) { printf("%s:%d\n", msg, len); }


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

x86 assembly (clang, -O2):
<myprint>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
define void @myprint(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
int buzzlex_isid(char c) { return isalnum(c) || (c == '_'); }


x86 assembly (clang, -O0):
<buzzlex_isid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <buzzlex_isid+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzzlex_isid>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @buzzlex_isid(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @buzzlex_isid(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
size_t trim_nuls(const unsigned char *buf, size_t nbytes) {
  while (nbytes > 1 && buf[nbytes - 1] == '\0')
    nbytes--;
  return nbytes;
}


x86 assembly (clang, -O0):
<trim_nuls>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x1,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jbe    1135 <trim_nuls+0x35>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1145 <trim_nuls+0x45>
jmp    1156 <trim_nuls+0x56>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <trim_nuls+0xc>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_nuls>:
xor    %eax,%eax
test   %rsi,%rsi
setne  %al
nopl   0x0(%rax,%rax,1)
cmp    $0x2,%rsi
jb     112b <trim_nuls+0x2b>
lea    -0x1(%rsi),%rcx
cmpb   $0x0,-0x1(%rdi,%rsi,1)
mov    %rcx,%rsi
je     1110 <trim_nuls+0x10>
add    $0x1,%rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @trim_nuls(i8* nocapture %0, i64 %1) {
%3 = icmp ne i64 %1, 0
%4 = zext i1 %3 to i64
br label %5
5: ; preds = %8, %2
%6 = phi i64 [ %1, %2 ], [ %9, %8 ]
%7 = icmp ugt i64 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = add i64 %6, -1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %8
%14 = phi i64 [ %4, %5 ], [ %6, %8 ]
ret i64 %14
}