xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ retab(char *, int);
int main() {
  char line[1000];
  while (retab(line, 1000) > 0)
    printf("%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <retab@plt>
cmp    $0x0,%rax
jle    1165 <main+0x45>
lea    -0x3f0(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <retab@plt>
test   %rax,%rax
jle    116d <main+0x4d>
lea    0xebd(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <retab@plt>
test   %rax,%rax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @retab(i8* %2, i32 1000)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i64 @retab(i8* %2, i32 1000)
%8 = icmp sgt i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s != '\0') {
    if (*s == c)
      return (char *)s;
    s++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <strchr+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1138 <strchr+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <strchr+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int snprintf(char *, int, char *, char *);
char *strrchr(char *, char);
int get_lockname(char *dev, char *buf) {
  char *tmp = strrchr(dev, '/');
  if (tmp)
    dev = tmp + 1;
  if (snprintf(buf, 256, "/var/lock/LCK..%s", dev) >= 256)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<get_lockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <get_lockname+0x39>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x100,%esi
lea    0xe93(%rip),%rdx
call   1030 <snprintf@plt>
cmp    $0x100,%eax
jl     1189 <get_lockname+0x69>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <get_lockname+0x70>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lockname>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
lea    0xeba(%rip),%rdx
mov    %r14,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
xor    %ecx,%ecx
cmp    $0x100,%eax
setge  %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/var/lock/LCK..%s\00"
define i32 @get_lockname(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i8* @strrchr(i8* %7, i8 signext 47)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i8*, i8** %6
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %4
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i32 @snprintf(i8* %15, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = icmp sge i32 %17, 256
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 -1, i32* %3
br label %21
20: ; preds = %14
store i32 0, i32* %3
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [18 x i8] c"/var/lock/LCK..%s\00"
define i32 @get_lockname(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%4 = icmp eq i8* %3, null
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = select i1 %4, i8* %0, i8* %5
%7 = tail call i32 @snprintf(i8* %1, i32 256, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp sgt i32 %7, 255
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("catdoc - exctract text from MS-Word files and catenate it to stdout\n"
         "Copyright (c) by Victor B. Wagner, 1996\n"
         "Usage catdoc [-ast] files ...\n"
         "\t-a - converts non-standard printable chars into readable form "
         "(default)\n"
         "\t-t - converts them into TeX control sequences\n"
         "\t-s - exits with code 1 if MSWordDoc signature not found before\n"
         "\t\tfirst printable paragraph\n\n"
         "All options affects only files, specified AFTER them\n");
  exit(2);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [405 x i8] c"catdoc - exctract text from MS-Word files and catenate it to stdout\0ACopyright (c) by Victor B. Wagner, 1996\0AUsage catdoc [-ast] files ...\0A\09-a - converts non-standard printable chars into readable form (default)\0A\09-t - converts them into TeX control sequences\0A\09-s - exits with code 1 if MSWordDoc signature not found before\0A\09\09first printable paragraph\0A\0AAll options affects only files, specified AFTER them\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([405 x i8], [405 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@str = [404 x i8] c"catdoc - exctract text from MS-Word files and catenate it to stdout\0ACopyright (c) by Victor B. Wagner, 1996\0AUsage catdoc [-ast] files ...\0A\09-a - converts non-standard printable chars into readable form (default)\0A\09-t - converts them into TeX control sequences\0A\09-s - exits with code 1 if MSWordDoc signature not found before\0A\09\09first printable paragraph\0A\0AAll options affects only files, specified AFTER them\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([404 x i8], [404 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ glfwInit();
void setupLibraries(int argc, char **argv) { glfwInit(); }


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

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

LLVM IR (-O0):
define void @setupLibraries(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @glfwInit()
ret void
}

LLVM IR (-O2):
define void @setupLibraries(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @glfwInit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void spn_diev(const char *fmt, va_list args) {
  fprintf(stderr, "fatal error in Sparkling: ");
  vfprintf(stderr, fmt, args);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<spn_diev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1060 <vfprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<spn_diev>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2e90(%rip),%r14
mov    (%r14),%edi
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1060 <vfprintf@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"fatal error in Sparkling: \00"
define void @spn_diev(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
%13 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"fatal error in Sparkling: \00"
define void @spn_diev(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @vfprintf(i32 %5, i8* %0, i32 %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void PCIE_Unload(void *lib_handle) { dlclose(lib_handle); }


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

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

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

LLVM IR (-O2):
define void @PCIE_Unload(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
int *goo() {
  static int xyz;
  return &xyz;
}


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

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

LLVM IR (-O0):
@goo.xyz = internal global i32 0
define i32* @goo() {
ret i32* @goo.xyz
}

LLVM IR (-O2):
@goo.xyz = internal global i32 0
define i32* @goo() {
ret i32* @goo.xyz
}
/* Variables and functions */
char const *return_const_char_ptr();
const char *use_return_const_char_ptr() { return return_const_char_ptr(); }


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

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

LLVM IR (-O0):
define i8* @use_return_const_char_ptr() {
%1 = call i8* (...) @return_const_char_ptr()
ret i8* %1
}

LLVM IR (-O2):
define i8* @use_return_const_char_ptr() {
%1 = tail call i8* (...) @return_const_char_ptr()
ret i8* %1
}
/* Variables and functions */
char *kore_malloc(size_t);
int /*<<< orphan*/ kore_strlcpy(char *, char const *, size_t);
int strlen(char const *);
char *kore_strndup(const char *str, const size_t len) {
  size_t alen = len;
  char *nstr;
  if (len == 0)
    alen = strlen(str) + 1;
  nstr = kore_malloc(alen);
  (void)kore_strlcpy(nstr, str, alen);
  return (nstr);
}


x86 assembly (clang, -O0):
<kore_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1165 <kore_strndup+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <kore_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <kore_strlcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rsi,%rsi
jne    114e <kore_strndup+0x1e>
mov    %r14,%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
mov    %rbx,%rdi
call   1030 <kore_malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <kore_strlcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @kore_strndup(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
br label %8
8: ; preds = %4, %2
%9 = phi i64 [ %7, %4 ], [ %1, %2 ]
%10 = tail call i8* @kore_malloc(i64 %9)
%11 = tail call i32 @kore_strlcpy(i8* %10, i8* %0, i64 %9)
ret i8* %10
}
/* Variables and functions */
float backIn(int, float, float, float);
float backOut(float fraction, float start, float delta, float speed) {
  return backIn(1 - fraction, start + delta, -delta, speed);
}


x86 assembly (clang, -O0):
<backOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  0xecc(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  -0x10(%rbp),%xmm2
call   1030 <backIn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backOut>:
movss  0xee8(%rip),%xmm4
subss  %xmm0,%xmm4
cvttss2si %xmm4,%edi
movaps %xmm1,%xmm0
addss  %xmm2,%xmm0
xorps  0xee2(%rip),%xmm2
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <backIn@plt>

LLVM IR (-O0):
define float @backOut(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = fsub float 1.000000e+00, %9
%11 = fptosi float %10 to i32
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fadd float %12, %13
%15 = load float, float* %7
%16 = fneg float %15
%17 = load float, float* %8
%18 = call float @backIn(i32 %11, float %14, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
define float @backOut(float %0, float %1, float %2, float %3) {
%5 = fsub float 1.000000e+00, %0
%6 = fptosi float %5 to i32
%7 = fadd float %1, %2
%8 = fneg float %2
%9 = tail call float @backIn(i32 %6, float %7, float %8, float %3)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fifteen(const int value) {
  switch (value) {
  case 1:
    printf("You passed in the value of one!\n");
    break;
  case 2:
    printf("You passed in the value of two!\n");
    break;
  default:
    printf("You passed in some other value!\n");
  }
}


x86 assembly (clang, -O0):
<fifteen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1140 <fifteen+0x30>
jmp    112f <fifteen+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1151 <fifteen+0x41>
jmp    1162 <fifteen+0x52>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <fifteen+0x5e>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    116e <fifteen+0x5e>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifteen>:
cmp    $0x2,%edi
lea    0xee6(%rip),%rax
lea    0xf1f(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xef1(%rip),%rdi
cmovne %rcx,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"You passed in the value of one!\0A\00"
@.str.1 = [33 x i8] c"You passed in the value of two!\0A\00"
@.str.2 = [33 x i8] c"You passed in some other value!\0A\00"
define void @fifteen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6, %4
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"You passed in the value of two!\00"
@str.3 = [32 x i8] c"You passed in the value of one!\00"
@str.4 = [32 x i8] c"You passed in some other value!\00"
define void @fifteen(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @str.3, i64 0, i64 0), i8* %3
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
int64_t chirp_client_fchmod(struct chirp_client *c, int64_t fd, int64_t mode,
                            time_t stoptime) {
  return simple_command(c, stoptime, "fchmod %lld %lld\n", fd, mode);
}


x86 assembly (clang, -O0):
<chirp_client_fchmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xec6(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_fchmod>:
mov    %edx,%r8d
mov    %esi,%eax
lea    0xee4(%rip),%rdx
mov    %ecx,%esi
mov    %eax,%ecx
jmp    1030 <simple_command@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [18 x i8] c"fchmod %lld %lld\0A\00"
define i32 @chirp_client_fchmod(%struct.chirp_client* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.chirp_client*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.chirp_client*, %struct.chirp_client** %5
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @simple_command(%struct.chirp_client* %9, i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [18 x i8] c"fchmod %lld %lld\0A\00"
define i32 @chirp_client_fchmod(%struct.chirp_client* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @simple_command(%struct.chirp_client* %0, i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int rom_present(char *);
int gd5428_available(void) {
  return rom_present(L"roms/video/cirruslogic/vlbusjapan.BIN");
}


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

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

LLVM IR (-O0):
@.str = [38 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 118, i32 108, i32 98, i32 117, i32 115, i32 106, i32 97, i32 112, i32 97, i32 110, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @gd5428_available() {
%1 = call i32 @rom_present(i8* bitcast ([38 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [38 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 118, i32 108, i32 98, i32 117, i32 115, i32 106, i32 97, i32 112, i32 97, i32 110, i32 46, i32 66, i32 73, i32 78, i32 0]
define i32 @gd5428_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([38 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int sethostname(const char *name, size_t len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<sethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sethostname>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @sethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @sethostname(i8* nocapture readnone %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
char *strlwr(char *string) {
  char *cp;
  for (cp = string; *cp; ++cp) {
    if ('A' <= *cp && *cp <= 'Z')
      *cp += 'a' - 'A';
  }
  return string;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <strlwr+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114d <strlwr+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114d <strlwr+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1152 <strlwr+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlwr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strlwr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strlwr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strlwr+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strlwr+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strlwr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %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, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%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 i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(long const, int /*<<< orphan*/ *const);
int pm_writebiglong(FILE *const ofP, long const l) {
  putc((l >> 24) & 0xff, ofP);
  putc((l >> 16) & 0xff, ofP);
  putc((l >> 8) & 0xff, ofP);
  putc((l >> 0) & 0xff, ofP);
  return 0;
}


x86 assembly (clang, -O0):
<pm_writebiglong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sar    $0x18,%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x10(%rbp),%rdi
sar    $0x10,%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x10(%rbp),%rdi
sar    $0x8,%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0x10(%rbp),%rdi
sar    $0x0,%rdi
and    $0xff,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_writebiglong>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %ebx,%edi
shr    $0x18,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @pm_writebiglong(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = ashr i64 %5, 24
%7 = and i64 %6, 255
%8 = load i32*, i32** %3
%9 = call i32 @putc(i64 %7, i32* %8)
%10 = load i64, i64* %4
%11 = ashr i64 %10, 16
%12 = and i64 %11, 255
%13 = load i32*, i32** %3
%14 = call i32 @putc(i64 %12, i32* %13)
%15 = load i64, i64* %4
%16 = ashr i64 %15, 8
%17 = and i64 %16, 255
%18 = load i32*, i32** %3
%19 = call i32 @putc(i64 %17, i32* %18)
%20 = load i64, i64* %4
%21 = ashr i64 %20, 0
%22 = and i64 %21, 255
%23 = load i32*, i32** %3
%24 = call i32 @putc(i64 %22, i32* %23)
ret i32 0
}

LLVM IR (-O2):
define i32 @pm_writebiglong(i32* nocapture %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = and i64 %3, 255
%5 = tail call i32 @putc(i64 %4, i32* %0)
%6 = lshr i64 %1, 16
%7 = and i64 %6, 255
%8 = tail call i32 @putc(i64 %7, i32* %0)
%9 = lshr i64 %1, 8
%10 = and i64 %9, 255
%11 = tail call i32 @putc(i64 %10, i32* %0)
%12 = and i64 %1, 255
%13 = tail call i32 @putc(i64 %12, i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ StopAllTasks();
int /*<<< orphan*/ hogCPU();
int /*<<< orphan*/ nxtDisplayCenteredBigTextLine(int, char *);
int /*<<< orphan*/ wait1Msec(int);
void hopperFatalErr() {
  hogCPU();
  nxtDisplayCenteredBigTextLine(1, "Hopper Err");
  wait1Msec(20 * 1000);
  StopAllTasks();
}


x86 assembly (clang, -O0):
<hopperFatalErr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <hogCPU@plt>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
mov    $0x4e20,%edi
call   1050 <wait1Msec@plt>
mov    $0x0,%al
call   1060 <StopAllTasks@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hopperFatalErr>:
push   %rax
xor    %eax,%eax
call   1040 <hogCPU@plt>
lea    0xeb1(%rip),%rsi
mov    $0x1,%edi
call   1030 <nxtDisplayCenteredBigTextLine@plt>
mov    $0x4e20,%edi
call   1050 <wait1Msec@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <StopAllTasks@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Hopper Err\00"
define void @hopperFatalErr() {
%1 = call i32 (...) @hogCPU()
%2 = call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @wait1Msec(i32 20000)
%4 = call i32 (...) @StopAllTasks()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hopper Err\00"
define void @hopperFatalErr() {
%1 = tail call i32 (...) @hogCPU()
%2 = tail call i32 @nxtDisplayCenteredBigTextLine(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @wait1Msec(i32 20000)
%4 = tail call i32 (...) @StopAllTasks()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printn(int);
int /*<<< orphan*/ serial_putc(char);
int /*<<< orphan*/ serial_puts(char *);
void show_n(char *s, int val) {
  serial_puts(s);
  serial_putc(' ');
  printn(val);
  serial_putc('\n');
}


x86 assembly (clang, -O0):
<show_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <serial_puts@plt>
mov    $0x20,%edi
call   1040 <serial_putc@plt>
mov    -0xc(%rbp),%edi
call   1030 <printn@plt>
mov    $0xa,%edi
call   1040 <serial_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_n>:
push   %rbx
mov    %esi,%ebx
call   1050 <serial_puts@plt>
mov    $0x20,%edi
call   1040 <serial_putc@plt>
mov    %ebx,%edi
call   1030 <printn@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1040 <serial_putc@plt>

LLVM IR (-O0):
define void @show_n(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 = call i32 @serial_puts(i8* %5)
%7 = call i32 @serial_putc(i8 signext 32)
%8 = load i32, i32* %4
%9 = call i32 @printn(i32 %8)
%10 = call i32 @serial_putc(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @show_n(i8* %0, i32 %1) {
%3 = tail call i32 @serial_puts(i8* %0)
%4 = tail call i32 @serial_putc(i8 signext 32)
%5 = tail call i32 @printn(i32 %1)
%6 = tail call i32 @serial_putc(i8 signext 10)
ret void
}
int fn1(signed char p1, int p2) { return p1 < 0 || p1 > 1 >> p2 ? 0 : p1 << 1; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jl     1132 <fn1+0x32>
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
sar    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jle    113c <fn1+0x3c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <fn1+0x46>
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %esi,%ecx
mov    $0x1,%edx
shr    %cl,%edx
lea    (%rdi,%rdi,1),%eax
xor    %ecx,%ecx
cmp    %edi,%edx
cmovl  %ecx,%eax
test   %dil,%dil
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fn1(i8 signext %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 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = load i32, i32* %4
%12 = ashr i32 1, %11
%13 = icmp sgt i32 %10, %12
br i1 %13, label %14, label %15
14: ; preds = %8, %2
br label %19
15: ; preds = %8
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 1
br label %19
19: ; preds = %15, %14
%20 = phi i32 [ 0, %14 ], [ %18, %15 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @fn1(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = icmp slt i8 %0, 0
%5 = lshr i32 1, %1
%6 = icmp slt i32 %5, %3
%7 = select i1 %4, i1 true, i1 %6
%8 = shl nsw i32 %3, 1
%9 = select i1 %7, i32 0, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd = open("/tmp/usfsal/dev/urandom", O_RDONLY);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <open@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"/tmp/usfsal/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"/tmp/usfsal/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int find_int(int x, int *ia, int nmemb) {
  int e;
  for (e = 0; e < nmemb; e++)
    if (ia[e] == x)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<find_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <find_int+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <find_int+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <find_int+0x5b>
jmp    1146 <find_int+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <find_int+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_int>:
test   %edx,%edx
jle    111e <find_int+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <find_int+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <find_int+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_shell_surface {
  int dummy;
};
struct wl_seat {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, struct wl_seat *,
                                    int /*<<< orphan*/, int /*<<< orphan*/);
void wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface,
                             struct wl_seat *seat, uint32_t serial,
                             uint32_t edges) {
  wl_proxy_marshal((struct wl_proxy *)wl_shell_surface, 2, seat, serial, edges);
}


x86 assembly (clang, -O0):
<wl_shell_surface_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x2,%esi
call   1030 <wl_proxy_marshal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_shell_surface_resize>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x2,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_shell_surface = type { i32 }
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_surface_resize(%struct.wl_shell_surface* %0, %struct.wl_seat* %1, i32 %2, i32 %3) {
%5 = alloca %struct.wl_shell_surface*
%6 = alloca %struct.wl_seat*
%7 = alloca i32
%8 = alloca i32
store %struct.wl_shell_surface* %0, %struct.wl_shell_surface** %5
store %struct.wl_seat* %1, %struct.wl_seat** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.wl_shell_surface*, %struct.wl_shell_surface** %5
%10 = bitcast %struct.wl_shell_surface* %9 to %struct.wl_proxy*
%11 = load %struct.wl_seat*, %struct.wl_seat** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %10, i32 2, %struct.wl_seat* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.wl_shell_surface = type { i32 }
%struct.wl_seat = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_surface_resize(%struct.wl_shell_surface* %0, %struct.wl_seat* %1, i32 %2, i32 %3) {
%5 = bitcast %struct.wl_shell_surface* %0 to %struct.wl_proxy*
%6 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %5, i32 2, %struct.wl_seat* %1, i32 %2, i32 %3)
ret void
}
int av_set_audio_type(int audio_mode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_set_audio_type(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sysprintf(char *, int);
int set_lcd_backlight(int brightness) {
  if (brightness < 0 || brightness > 100)
    return -1;
  sysprintf("echo %d > /sys/class/backlight/pwm-backlight/brightness",
            brightness);
  return 0;
}


x86 assembly (clang, -O0):
<set_lcd_backlight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112f <set_lcd_backlight+0x1f>
cmpl   $0x64,-0x8(%rbp)
jle    113b <set_lcd_backlight+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <set_lcd_backlight+0x41>
mov    -0x8(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <sysprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_lcd_backlight>:
mov    $0xffffffff,%eax
cmp    $0x64,%edi
ja     112f <set_lcd_backlight+0x1f>
push   %rax
mov    %edi,%esi
lea    0xedc(%rip),%rdi
call   1030 <sysprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [56 x i8] c"echo %d > /sys/class/backlight/pwm-backlight/brightness\00"
define i32 @set_lcd_backlight(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 100
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 -1, i32* %2
br label %13
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @sysprintf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [56 x i8] c"echo %d > /sys/class/backlight/pwm-backlight/brightness\00"
define i32 @set_lcd_backlight(i32 %0) {
%2 = icmp ugt i32 %0, 100
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sysprintf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int adjustArray(int *, int, int);
void quickSort(int s[], int l, int r) {
  if (l < r) {
    int i = adjustArray(s, l, r);
    quickSort(s, l, i - 1);
    quickSort(s, i + 1, r);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <adjustArray@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <adjustArray@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @adjustArray(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}