xunge/DecIR huggingface dataset:
/* Type definitions */
typedef char *pid_t;

/* Variables and functions */
long errno;
pid_t sys__gettid() {
  long __res;
  __asm__ __volatile__("syscall"
                       : "=a"(__res)
                       : "0"(186)
                       : "r11", "rcx", "memory");
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-4095)) {
      errno = -(__res);
      __res = -1;
    }
    return (pid_t)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<sys__gettid>:
push   %rbp
mov    %rsp,%rbp
mov    $0xba,%eax
syscall
mov    %rax,-0x8(%rbp)
cmpq   $0xfffffffffffff001,-0x8(%rbp)
ff
jb     1137 <sys__gettid+0x37>
xor    %eax,%eax
mov    %eax,%ecx
sub    -0x8(%rbp),%rcx
mov    0x2eb4(%rip),%rax
mov    %rcx,(%rax)
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys__gettid>:
mov    $0xba,%eax
syscall
cmp    $0xfffffffffffff001,%rax
jb     1123 <sys__gettid+0x23>
neg    %rax
mov    0x2ec7(%rip),%rcx
mov    %rax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@errno = global i64 0
define i8* @sys__gettid() {
%1 = alloca i64
%2 = call i64 asm sideeffect "syscall", "={ax},0,~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 186)
store i64 %2, i64* %1
br label %3
3: ; preds = %0
%4 = load i64, i64* %1
%5 = icmp uge i64 %4, -4095
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i64, i64* %1
%8 = sub nsw i64 0, %7
store i64 %8, i64* @errno
store i64 -1, i64* %1
br label %9
9: ; preds = %6, %3
%10 = load i64, i64* %1
%11 = inttoptr i64 %10 to i8*
br label %12
12: ; preds = %9
ret i8* %11
}

LLVM IR (-O2):
@errno = global i64 0
define i8* @sys__gettid() {
%1 = tail call i64 asm sideeffect "syscall", "={ax},0,~{r11},~{rcx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 186)
%2 = icmp ugt i64 %1, -4096
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = sub nsw i64 0, %1
store i64 %4, i64* @errno
br label %5
5: ; preds = %3, %0
%6 = phi i64 [ -1, %3 ], [ %1, %0 ]
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
char *fndnws(s)
char *s;
{
  while ((*s == ' ') || (*s == '\t'))
    if ((*s++ == '\n') || !*s)
      return (char *)0;
  return s;
}


x86 assembly (clang, -O0):
<fndnws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     112d <fndnws+0x2d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113d <fndnws+0x3d>
jmp    1177 <fndnws+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1165 <fndnws+0x65>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1172 <fndnws+0x72>
movq   $0x0,-0x8(%rbp)
jmp    117f <fndnws+0x7f>
jmp    1108 <fndnws+0x8>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fndnws>:
mov    %rdi,%rax
mov    (%rdi),%cl
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x20,%cl
je     111a <fndnws+0x1a>
cmp    $0x9,%cl
jne    112d <fndnws+0x2d>
cmp    $0xa,%cl
je     112b <fndnws+0x2b>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <fndnws+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @fndnws(i8* %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %9, %1
%4 = phi i8 [ %10, %9 ], [ %2, %1 ]
%5 = phi i8* [ %7, %9 ], [ %0, %1 ]
switch i8 %4, label %12 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = icmp eq i8 %4, 10
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %6, %9
%13 = phi i8* [ null, %9 ], [ null, %6 ], [ %5, %3 ]
ret i8* %13
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int strings_test_func() {
  int i = 0;
  char *locstr, *longloc;
  locstr = "abcdef";
  longloc = malloc(500);
  strcpy(longloc, "how now brown cow spam spam spam wonderful wonderful spam");
  i += strlen(locstr);
  i += strlen(longloc);
  return i;
}


x86 assembly (clang, -O0):
<strings_test_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x1f4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea4(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_test_func>:
push   %rbx
mov    $0x1f4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
add    $0x6,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [58 x i8] c"how now brown cow spam spam spam wonderful wonderful spam\00"
define i32 @strings_test_func() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = call i8* @malloc(i32 500)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %1
%13 = load i8*, i8** %3
%14 = call i64 @strlen(i8* %13)
%15 = load i32, i32* %1
%16 = sext i32 %15 to i64
%17 = add nsw i64 %16, %14
%18 = trunc i64 %17 to i32
store i32 %18, i32* %1
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str.1 = [58 x i8] c"how now brown cow spam spam spam wonderful wonderful spam\00"
define i32 @strings_test_func() {
%1 = tail call dereferenceable_or_null(500) i8* @malloc(i32 500)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 6
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; ++i) {
    printf("%s\n", argv[i]);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
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
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteByte(unsigned char, unsigned char);
void SensorSetReg_HV7131GP(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteByte((unsigned char)uAddr, (unsigned char)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_HV7131GP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x4(%rbp),%ax
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <VIM_SIF_I2cWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_HV7131GP>:
movzbl %sil,%esi
jmp    1030 <VIM_SIF_I2cWriteByte@plt>

LLVM IR (-O0):
define void @SensorSetReg_HV7131GP(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
%7 = trunc i16 %6 to i8
%8 = call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %5, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
define void @SensorSetReg_HV7131GP(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @VIM_SIF_I2cWriteByte(i8 zeroext %0, i8 zeroext %3)
ret void
}
int strlen_1(const char *s) {
  int len = 0;
  while (*s++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen_1+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen_1+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_1>:
cmpb   $0x0,(%rdi)
je     111c <strlen_1+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen_1+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen_1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ enterScope();
int /*<<< orphan*/ yy_scan_string(char *);
int /*<<< orphan*/ yyparse();
void doParse(char *contents) {
  enterScope();
  yy_scan_string(contents);
  yyparse();
}


x86 assembly (clang, -O0):
<doParse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <enterScope@plt>
mov    -0x8(%rbp),%rdi
call   1050 <yy_scan_string@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doParse>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <enterScope@plt>
mov    %rbx,%rdi
call   1050 <yy_scan_string@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <yyparse@plt>

LLVM IR (-O0):
define void @doParse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @enterScope()
%4 = load i8*, i8** %2
%5 = call i32 @yy_scan_string(i8* %4)
%6 = call i32 (...) @yyparse()
ret void
}

LLVM IR (-O2):
define void @doParse(i8* %0) {
%2 = tail call i32 (...) @enterScope()
%3 = tail call i32 @yy_scan_string(i8* %0)
%4 = tail call i32 (...) @yyparse()
ret void
}
void PROXY_POLICY_new(void) {}


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

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

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

LLVM IR (-O2):
define void @PROXY_POLICY_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ libpthread_exit(void *);
void pthread_exit(void *thread_return) {
  (void)0;
  libpthread_exit(thread_return);
}


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

x86 assembly (clang, -O2):
<pthread_exit>:
jmp    1030 <libpthread_exit@plt>

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

LLVM IR (-O2):
define void @pthread_exit(i8* %0) {
%2 = tail call i32 @libpthread_exit(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_eggs_reg(int);
void nsblk_eggs_reg5(void) { nsblk_eggs_reg(5); }


x86 assembly (clang, -O0):
<nsblk_eggs_reg5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <nsblk_eggs_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsblk_eggs_reg5>:
mov    $0x5,%edi
jmp    1030 <nsblk_eggs_reg@plt>

LLVM IR (-O0):
define void @nsblk_eggs_reg5() {
%1 = call i32 @nsblk_eggs_reg(i32 5)
ret void
}

LLVM IR (-O2):
define void @nsblk_eggs_reg5() {
%1 = tail call i32 @nsblk_eggs_reg(i32 5)
ret void
}
/* Type definitions */
struct sign_pubkey {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sign_pubkey *);
void sign_pubkey_free(struct sign_pubkey *key) { free(key); }


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

x86 assembly (clang, -O2):
<sign_pubkey_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sign_pubkey = type { i32 }
define void @sign_pubkey_free(%struct.sign_pubkey* nocapture %0) {
%2 = tail call i32 @free(%struct.sign_pubkey* %0)
ret void
}
void INT_KR(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_KR() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int PL_CompareStrings(const void *v1, const void *v2) {
  return strcmp((const char *)v1, (const char *)v2) == 0;
}


x86 assembly (clang, -O0):
<PL_CompareStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PL_CompareStrings>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PL_CompareStrings(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @PL_CompareStrings(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int clickplc_exe_EndOfInterrupt_dec(unsigned char *stream, void *obj) {
  int encsize = 4;
  return (encsize);
}


x86 assembly (clang, -O0):
<clickplc_exe_EndOfInterrupt_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @clickplc_exe_EndOfInterrupt_dec(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ max(int, int);
int min(int, int /*<<< orphan*/);
int test_01(int a) { return min(127, max(-128, a)); }


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xffffff80,%edi
call   1040 <max@plt>
mov    %eax,%esi
mov    $0x7f,%edi
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
push   %rax
mov    %edi,%esi
mov    $0xffffff80,%edi
call   1040 <max@plt>
mov    $0x7f,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @test_01(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @max(i32 -128, i32 %3)
%5 = call i32 @min(i32 127, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_01(i32 %0) {
%2 = tail call i32 @max(i32 -128, i32 %0)
%3 = tail call i32 @min(i32 127, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int num;
  scanf("%d", &num);
  int end = num + 10;
  while (num <= end)
    printf("%d ", num++);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1170 <main+0x50>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
jmp    1148 <main+0x28>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xa(%rsi),%ebp
lea    0xec1(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rsi),%eax
mov    %eax,0x4(%rsp)
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
cmp    %ebp,%esi
jle    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 10
br label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int get_bit(const uint8_t *bitfield, int bit) {
  return (bitfield[bit / 8] & (1 << (7 - (bit % 8)))) ? 1 : 0;
}


x86 assembly (clang, -O0):
<get_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x10(%rbp),%edx
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit>:
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %ecx,%eax
sar    $0x3,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0xfffffff8,%ecx
sub    %ecx,%esi
mov    $0x7,%cl
sub    %sil,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 8
%13 = sub nsw i32 7, %12
%14 = shl i32 1, %13
%15 = and i32 %10, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_bit(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = srem i32 %1, 8
%8 = sub nsw i32 7, %7
%9 = lshr i32 %6, %8
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ term_send(char);
void term_erase_to_end_of_line() {
  term_send(27);
  term_send('[');
  term_send('K');
}


x86 assembly (clang, -O0):
<term_erase_to_end_of_line>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x4b,%edi
call   1030 <term_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_erase_to_end_of_line>:
push   %rax
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x4b,%edi
pop    %rax
jmp    1030 <term_send@plt>

LLVM IR (-O0):
define void @term_erase_to_end_of_line() {
%1 = call i32 @term_send(i8 signext 27)
%2 = call i32 @term_send(i8 signext 91)
%3 = call i32 @term_send(i8 signext 75)
ret void
}

LLVM IR (-O2):
define void @term_erase_to_end_of_line() {
%1 = tail call i32 @term_send(i8 signext 27)
%2 = tail call i32 @term_send(i8 signext 91)
%3 = tail call i32 @term_send(i8 signext 75)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ focus;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
int get_XEnterWindowEvent_focus(void *_p) {
  return (int)((XEnterWindowEvent *)_p)->focus;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XEnterWindowEvent_focus(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_focus(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void spin_last(void) {
  printf("\r                     \r");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<spin_last>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_last>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0D \0D\00"
@stdout = global i32 0
define void @spin_last() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0D \0D\00"
@stdout = global i32 0
define void @spin_last() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int unlikely(unsigned long);
int radix_tree_exception(void *arg) {
  return unlikely((unsigned long)arg & 3UL);
}


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

x86 assembly (clang, -O2):
<radix_tree_exception>:
and    $0x3,%edi
jmp    1030 <unlikely@plt>

LLVM IR (-O0):
define i32 @radix_tree_exception(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 3
%6 = call i32 @unlikely(i64 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @radix_tree_exception(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 3
%4 = tail call i32 @unlikely(i64 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("First OSS code");
  printf("Fourth OSS code");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%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
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"First OSS code\00"
@.str.1 = [16 x i8] c"Fourth OSS code\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(int, int, int, int, int, int);
void initGL() {
  glClearColor(0.0, 0.5, 0.0, 1.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-40, 40, -30, 30, 10, -10);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<initGL>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm2,%xmm2
movsd  0xeb1(%rip),%xmm1
movsd  0xeb1(%rip),%xmm3
movaps %xmm2,%xmm0
call   1050 <glClearColor@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
mov    $0xffffffd8,%edi
mov    $0x28,%esi
mov    $0xffffffe2,%edx
mov    $0x1e,%ecx
mov    $0xa,%r8d
mov    $0xfffffff6,%r9d
call   1040 <glOrtho@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initGL>:
push   %rax
movsd  0xeb7(%rip),%xmm1
movsd  0xeb7(%rip),%xmm3
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
mov    $0xffffffd8,%edi
mov    $0x28,%esi
mov    $0xffffffe2,%edx
mov    $0x1e,%ecx
mov    $0xa,%r8d
mov    $0xfffffff6,%r9d
call   1040 <glOrtho@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @initGL() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 1.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @glOrtho(i32 -40, i32 40, i32 -30, i32 30, i32 10, i32 -10)
%6 = load i32, i32* @GL_MODELVIEW
%7 = call i32 @glMatrixMode(i32 %6)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @initGL() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 1.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @glOrtho(i32 -40, i32 40, i32 -30, i32 30, i32 10, i32 -10)
%6 = load i32, i32* @GL_MODELVIEW
%7 = tail call i32 @glMatrixMode(i32 %6)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void bit_clear16(volatile uint16_t *ptr, uint8_t bit) { *ptr &= ~(1 << (bit)); }


x86 assembly (clang, -O0):
<bit_clear16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_clear16>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bit_clear16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load volatile i32, i32* %8
%10 = and i32 %9, %7
store volatile i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @bit_clear16(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* %0
%6 = and i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __fork(void) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fork>:
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 @__fork() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__fork() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void store_u16_little(void *mem, uint16_t val) { *(uint16_t *)mem = val; }


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

x86 assembly (clang, -O2):
<store_u16_little>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @store_u16_little(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
inheritance_graph() {}


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

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

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

LLVM IR (-O2):
define i32 @inheritance_graph() {
ret i32 undef
}
int emac1_etherstatspkts1024to1518octets_set(
    unsigned int dev_id, union emac1_etherstatspkts1024to1518octets_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_etherstatspkts1024to1518octets_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_etherstatspkts1024to1518octets_u = type opaque
define i32 @emac1_etherstatspkts1024to1518octets_set(i32 %0, %union.emac1_etherstatspkts1024to1518octets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatspkts1024to1518octets_u*
store i32 %0, i32* %3
store %union.emac1_etherstatspkts1024to1518octets_u* %1, %union.emac1_etherstatspkts1024to1518octets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatspkts1024to1518octets_u = type opaque
define i32 @emac1_etherstatspkts1024to1518octets_set(i32 %0, %union.emac1_etherstatspkts1024to1518octets_u* nocapture readnone %1) {
ret i32 1
}
int from_revision(unsigned int flags) { return ((flags) >> 8) & 0xff; }


x86 assembly (clang, -O0):
<from_revision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @from_revision(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @from_revision(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2(void) { printf("Hey, you pressed F2! \n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Hey, you pressed F2! \0A\00"
define void @f2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Hey, you pressed F2! \00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getifaddrs;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)getifaddrs;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@getifaddrs = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = load i32, i32* @getifaddrs
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@getifaddrs = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zfree(void *x, void *addr, unsigned nb) { free(addr); }


x86 assembly (clang, -O0):
<zfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zfree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @zfree(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @zfree(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @free(i8* %1)
ret void
}
void ASN1_OCTET_STRING_new(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadByte(int /*<<< orphan*/, int);
uint8_t wiznetGetSocketInterrupt(uint8_t socket) {
  return wiznetRegReadByte(socket, (0x0000 + 0x0002));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketInterrupt>:
mov    $0x2,%esi
jmp    1030 <wiznetRegReadByte@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketInterrupt(i32 %0) {
%2 = tail call i32 @wiznetRegReadByte(i32 %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int register_blkdev(unsigned int major, char const *name) {
  int result;
  int tmp;
  {
    {
      tmp = __VERIFIER_nondet_int();
      result = tmp;
    }
    return (result);
  }
}


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

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

LLVM IR (-O0):
define i32 @register_blkdev(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %6
%8 = load i32, i32* %6
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @register_blkdev(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void saved_command_line(void) { panic("saved_command_line"); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"saved_command_line\00"
define void @saved_command_line() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char);
int main(int argc, char *argv[]) {
  while (--argc > 0) {
    printf("%s%c", *++argv, (argc > 1) ? ' ' : '\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1172 <main+0x62>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rsi
mov    -0x8(%rbp),%edx
mov    $0xa,%eax
mov    $0x20,%ecx
cmp    $0x1,%edx
cmovg  %ecx,%eax
lea    0xe9b(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1163 <main+0x53>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
mov    $0xa,%r15d
lea    0xecb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx),%rsi
cmp    $0x3,%ebp
mov    $0x20,%edx
cmove  %r15d,%edx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %12
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 1
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 32, i32 10
%18 = trunc i32 %17 to i8
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %13, i8 signext %18)
br label %6
20: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%c\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i32 %6, 2
%11 = select i1 %10, i8 10, i8 32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9, i8 signext %11)
%13 = icmp ugt i32 %6, 2
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *session_system_string(char *where) {
  static char system_string[128];
  sprintf(system_string, "select.sh '*' appaserver_sessions \"%s\" none",
          where);
  return system_string;
}


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

x86 assembly (clang, -O2):
<session_system_string>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@session_system_string.system_string = internal global [128 x i8] zeroinitializer
@.str = [44 x i8] c"select.sh '*' appaserver_sessions \22%s\22 none\00"
define i8* @session_system_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @session_system_string.system_string, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @session_system_string.system_string, i64 0, i64 0)
}

LLVM IR (-O2):
@session_system_string.system_string = internal global [128 x i8] zeroinitializer
@.str = [44 x i8] c"select.sh '*' appaserver_sessions \22%s\22 none\00"
define i8* @session_system_string(i8* %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @session_system_string.system_string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @session_system_string.system_string, i64 0, i64 0)
}
/* Variables and functions */
int strlen(char const *);
int ends_with_slash(const char *str) {
  return str[0] != '\0' && str[strlen(str) - 1] == '/';
}


x86 assembly (clang, -O0):
<ends_with_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     115b <ends_with_slash+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_with_slash>:
push   %rbx
cmpb   $0x0,(%rdi)
je     112d <ends_with_slash+0x1d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x2f,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ends_with_slash(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 47
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %13
}