xunge/DecIR huggingface dataset:
/* Type definitions */
struct solo5_start_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_test();
int /*<<< orphan*/ puts(char *);
int solo5_app_main(const struct solo5_start_info *si __attribute__((unused))) {
  puts("\n**** Solo5 standalone test_globals ****\n\n");
  do_test();
  return 0;
}


x86 assembly (clang, -O0):
<solo5_app_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <do_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solo5_app_main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <do_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.solo5_start_info = type { i32 }
@.str = [43 x i8] c"\0A**** Solo5 standalone test_globals ****\0A\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* %0) {
%2 = alloca %struct.solo5_start_info*
store %struct.solo5_start_info* %0, %struct.solo5_start_info** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @do_test()
ret i32 0
}

LLVM IR (-O2):
%struct.solo5_start_info = type { i32 }
@.str = [43 x i8] c"\0A**** Solo5 standalone test_globals ****\0A\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @do_test()
ret i32 0
}
void d2i_OCSP_ONEREQ(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_OCSP_ONEREQ() {
ret void
}
void IRQ_Exception(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<IRQ_Exception>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <IRQ_Exception+0x9>
jmp    1109 <IRQ_Exception+0x9>

x86 assembly (clang, -O2):
<IRQ_Exception>:
jmp    1100 <IRQ_Exception>

LLVM IR (-O0):
define void @IRQ_Exception() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @IRQ_Exception() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ UI_Cvar_VariableString(char const *);
scalar_t__ strlen(int /*<<< orphan*/);
int /*<<< orphan*/ trap_Cvar_Set(char const *, char const *);
void UI_SetDefaultCvar(const char *cvar, const char *value) {
  if (strlen(UI_Cvar_VariableString(cvar)) == 0) {
    trap_Cvar_Set(cvar, value);
  }
}


x86 assembly (clang, -O0):
<UI_SetDefaultCvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UI_Cvar_VariableString@plt>
mov    %eax,%edi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1167 <UI_SetDefaultCvar+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <trap_Cvar_Set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_SetDefaultCvar>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <UI_Cvar_VariableString@plt>
mov    %eax,%edi
call   1030 <strlen@plt>
test   %rax,%rax
je     1153 <UI_SetDefaultCvar+0x23>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <trap_Cvar_Set@plt>

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

LLVM IR (-O2):
define void @UI_SetDefaultCvar(i8* %0, i8* %1) {
%3 = tail call i32 @UI_Cvar_VariableString(i8* %0)
%4 = tail call i64 @strlen(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @trap_Cvar_Set(i8* %0, i8* %1)
br label %8
8: ; preds = %6, %2
ret void
}
const char test1_strings_overrun(int x) {
  const char *mystr = "mary had a little lamb";
  return mystr[1000];
}


x86 assembly (clang, -O0):
<test1_strings_overrun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x3e8(%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"mary had a little lamb\00"
define signext i8 @test1_strings_overrun(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1000
%6 = load i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @test1_strings_overrun(i32 %0) {
ret i8 undef
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() { printf("EOF value is %d \n", EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"EOF value is %d \0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"EOF value is %d \0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void bookNameFound(char bookName[]) {
  printf("\nThe book with name <%s> was found in the bookstore inventory.\n",
         bookName);
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"\0AThe book with name <%s> was found in the bookstore inventory.\0A\00"
define void @bookNameFound(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"\0AThe book with name <%s> was found in the bookstore inventory.\0A\00"
define void @bookNameFound(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int brancos(char senha[5], char tenta[5]) {
  int i = 0, cont = 0;
  for (; i < 5 - 1; i++)
    if (senha[i] == tenta[i])
      cont++;
  return cont;
}


x86 assembly (clang, -O0):
<brancos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1160 <brancos+0x60>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114d <brancos+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1152 <brancos+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <brancos+0x1a>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brancos>:
movd   (%rdi),%xmm0
movd   (%rsi),%xmm1
pcmpeqb %xmm0,%xmm1
punpcklbw %xmm1,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%eax
mov    %eax,%ecx
shr    %cl
and    $0x5,%cl
sub    %cl,%al
mov    %eax,%ecx
and    $0x33,%cl
shr    $0x2,%al
and    $0x33,%al
add    %cl,%al
mov    %eax,%ecx
shr    $0x4,%cl
add    %al,%cl
and    $0xf,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @brancos(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to <4 x i8>*
%4 = load <4 x i8>, <4 x i8>* %3
%5 = bitcast i8* %1 to <4 x i8>*
%6 = load <4 x i8>, <4 x i8>* %5
%7 = icmp eq <4 x i8> %4, %6
%8 = bitcast <4 x i1> %7 to i4
%9 = call i4 @llvm.ctpop.i4(i4 %8)
%10 = zext i4 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ X86GdtInit();
int /*<<< orphan*/ X86IdtInit();
void X86DescTablesInit() {
  X86GdtInit();
  X86IdtInit();
}


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

x86 assembly (clang, -O2):
<X86DescTablesInit>:
push   %rax
xor    %eax,%eax
call   1030 <X86GdtInit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <X86IdtInit@plt>

LLVM IR (-O0):
define void @X86DescTablesInit() {
%1 = call i32 (...) @X86GdtInit()
%2 = call i32 (...) @X86IdtInit()
ret void
}

LLVM IR (-O2):
define void @X86DescTablesInit() {
%1 = tail call i32 (...) @X86GdtInit()
%2 = tail call i32 (...) @X86IdtInit()
ret void
}
int main() { return 3 - +4; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void explain1(char *arg) { fprintf(stderr, "Illegal \"%s\"\n", arg); }


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

x86 assembly (clang, -O2):
<explain1>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Illegal \22%s\22\0A\00"
define void @explain1(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void LPA_freeMem(void *pMem) { free(pMem); }


x86 assembly (clang, -O0):
<LPA_freeMem>:
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):
<LPA_freeMem>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @LPA_freeMem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
char *IEC_Config(char *);
char *GetTelnetPort() { return IEC_Config("s_telnetport"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"s_telnetport\00"
define i8* @GetTelnetPort() {
%1 = call i8* @IEC_Config(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"s_telnetport\00"
define i8* @GetTelnetPort() {
%1 = tail call i8* @IEC_Config(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int inportb(unsigned short);
int /*<<< orphan*/ outportb(unsigned short, unsigned char);
void irq_set_mask(unsigned char irq) {
  unsigned short port;
  unsigned char value;
  if (irq < 8)
    port = 0x21;
  else {
    port = 0xA1;
    irq -= 8;
  }
  value = inportb(port) | (1 << irq);
  outportb(port, value);
}


x86 assembly (clang, -O0):
<irq_set_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jge    1146 <irq_set_mask+0x26>
movw   $0x21,-0x4(%rbp)
jmp    1156 <irq_set_mask+0x36>
movw   $0xa1,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x8,%eax
mov    %al,-0x1(%rbp)
movzwl -0x4(%rbp),%edi
call   1030 <inportb@plt>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%ax
movzwl %ax,%edi
movzbl -0x5(%rbp),%esi
call   1040 <outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_set_mask>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    %edi,%eax
sub    $0x8,%al
movzbl %al,%ebp
cmovb  %edi,%ebp
setae  %bl
shl    $0x7,%ebx
or     $0x21,%ebx
mov    %ebx,%edi
call   1030 <inportb@plt>
bts    %ebp,%eax
movzbl %al,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outportb@plt>

LLVM IR (-O0):
define void @irq_set_mask(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %9
8: ; preds = %1
store i16 33, i16* %3
br label %14
9: ; preds = %1
store i16 161, i16* %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = sub nsw i32 %11, 8
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %9, %8
%15 = load i16, i16* %3
%16 = call i32 @inportb(i16 zeroext %15)
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = shl i32 1, %18
%20 = or i32 %16, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %4
%22 = load i16, i16* %3
%23 = load i8, i8* %4
%24 = call i32 @outportb(i16 zeroext %22, i8 zeroext %23)
ret void
}

LLVM IR (-O2):
define void @irq_set_mask(i8 zeroext %0) {
%2 = icmp ult i8 %0, 8
%3 = add i8 %0, -8
%4 = select i1 %2, i16 33, i16 161
%5 = select i1 %2, i8 %0, i8 %3
%6 = tail call i32 @inportb(i16 zeroext %4)
%7 = zext i8 %5 to i32
%8 = shl nuw i32 1, %7
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @outportb(i16 zeroext %4, i8 zeroext %10)
ret void
}
int PostEventSanchez(char *evname, int evpriority, char *evformat) { return 0; }


x86 assembly (clang, -O0):
<PostEventSanchez>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @PostEventSanchez(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ P();
double get_counter();
int /*<<< orphan*/ start_counter();
double time_P() {
  start_counter();
  P();
  return get_counter();
}


x86 assembly (clang, -O0):
<time_P>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <start_counter@plt>
mov    $0x0,%al
call   1030 <P@plt>
mov    $0x0,%al
call   1050 <get_counter@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_P>:
push   %rax
xor    %eax,%eax
call   1040 <start_counter@plt>
xor    %eax,%eax
call   1030 <P@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <get_counter@plt>

LLVM IR (-O0):
define double @time_P() {
%1 = call i32 (...) @start_counter()
%2 = call i32 (...) @P()
%3 = call double (...) @get_counter()
ret double %3
}

LLVM IR (-O2):
define double @time_P() {
%1 = tail call i32 (...) @start_counter()
%2 = tail call i32 (...) @P()
%3 = tail call double (...) @get_counter()
ret double %3
}
int ld_blt_cr1(long double a1) { return (__builtin_isless(100, a1)); }


x86 assembly (clang, -O0):
<ld_blt_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blt_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_blt_cr1(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 0xK4005C800000000000000, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ld_blt_cr1(x86_fp80 %0) {
%2 = fcmp ogt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ HelloWorld();
int main() {
  HelloWorld();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <HelloWorld@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <HelloWorld@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @HelloWorld()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ burn_cycles(int);
void msync_overhead(void) { burn_cycles((2000)); }


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

x86 assembly (clang, -O2):
<msync_overhead>:
mov    $0x7d0,%edi
jmp    1030 <burn_cycles@plt>

LLVM IR (-O0):
define void @msync_overhead() {
%1 = call i32 @burn_cycles(i32 2000)
ret void
}

LLVM IR (-O2):
define void @msync_overhead() {
%1 = tail call i32 @burn_cycles(i32 2000)
ret void
}
/* Variables and functions */
double __nv_dsqrt_rd(double);
double __dsqrt_rd(double __a) { return __nv_dsqrt_rd(__a); }


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

x86 assembly (clang, -O2):
<__dsqrt_rd>:
jmp    1030 <__nv_dsqrt_rd@plt>

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

LLVM IR (-O2):
define double @__dsqrt_rd(double %0) {
%2 = tail call double @__nv_dsqrt_rd(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ CU_ASSERT(int);
int /*<<< orphan*/ strcmp(char *, char *);
char *string_ndup(char *, int);
void test_string_ndup(void) {
  char data[] = "hello there";
  char *p;
  p = string_ndup(data, 5);
  CU_ASSERT(!strcmp(p, "hello"));
}


x86 assembly (clang, -O0):
<test_string_ndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x5,%esi
call   1050 <string_ndup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <CU_ASSERT@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string_ndup>:
sub    $0x18,%rsp
movabs $0x6874206f6c6c6568,%rax
20 74 68
mov    %rax,0x8(%rsp)
movl   $0x657265,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x5,%esi
call   1050 <string_ndup@plt>
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <CU_ASSERT@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_string_ndup.data = [12 x i8] c"hello there\00"
@.str = [6 x i8] c"hello\00"
define void @test_string_ndup() {
%1 = alloca [12 x i8]
%2 = alloca i8*
%3 = bitcast [12 x i8]* %1 to i8*
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i8* @string_ndup(i8* %4, i32 5)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @CU_ASSERT(i32 %10)
ret void
}

LLVM IR (-O2):
@__const.test_string_ndup.data = [12 x i8] c"hello there\00"
@.str = [6 x i8] c"hello\00"
define void @test_string_ndup() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i8* @string_ndup(i8* %2, i32 5)
%4 = call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @CU_ASSERT(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void f6() {
  int *p = malloc(12);
  if (!p)
    return;
  else
    free(p);
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <f6+0x26>
jmp    114f <f6+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rax
mov    $0xc,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1139 <f6+0x19>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @f6() {
%1 = tail call i32* @malloc(i32 12)
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @free(i32* %1)
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_matlab_ancient_syntax_comment();
int /*<<< orphan*/ test_matlab_comment_entities();
int /*<<< orphan*/ test_matlab_false_line_comment();
int /*<<< orphan*/ test_matlab_line_comment_1();
void all_matlab_tests() {
  test_matlab_line_comment_1();
  test_matlab_ancient_syntax_comment();
  test_matlab_false_line_comment();
  test_matlab_comment_entities();
}


x86 assembly (clang, -O0):
<all_matlab_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <test_matlab_line_comment_1@plt>
mov    $0x0,%al
call   1030 <test_matlab_ancient_syntax_comment@plt>
mov    $0x0,%al
call   1050 <test_matlab_false_line_comment@plt>
mov    $0x0,%al
call   1040 <test_matlab_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_matlab_tests>:
push   %rax
xor    %eax,%eax
call   1060 <test_matlab_line_comment_1@plt>
xor    %eax,%eax
call   1030 <test_matlab_ancient_syntax_comment@plt>
xor    %eax,%eax
call   1050 <test_matlab_false_line_comment@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_matlab_comment_entities@plt>

LLVM IR (-O0):
define void @all_matlab_tests() {
%1 = call i32 (...) @test_matlab_line_comment_1()
%2 = call i32 (...) @test_matlab_ancient_syntax_comment()
%3 = call i32 (...) @test_matlab_false_line_comment()
%4 = call i32 (...) @test_matlab_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_matlab_tests() {
%1 = tail call i32 (...) @test_matlab_line_comment_1()
%2 = tail call i32 (...) @test_matlab_ancient_syntax_comment()
%3 = tail call i32 (...) @test_matlab_false_line_comment()
%4 = tail call i32 (...) @test_matlab_comment_entities()
ret void
}
int test_imm_E1uint32_reg(unsigned int val) {
  return ((val) & (0xE1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E1uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xe1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E1uint32_reg(i32 %0) {
%2 = and i32 %0, 225
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  i = 1 && 0;
  printf("True && False: %d\n", i);
  i = 1 || 0;
  printf("True || False: %d \n", i);
  i = !1;
  printf("!TRUE: %d \n", i);
  i = !0;
  printf("!FALSE: %d \n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec8(%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
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"True && False: %d\0A\00"
@.str.1 = [20 x i8] c"True || False: %d \0A\00"
@.str.2 = [12 x i8] c"!TRUE: %d \0A\00"
@.str.3 = [13 x i8] c"!FALSE: %d \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 1, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %4)
store i32 0, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %6)
store i32 1, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"True && False: %d\0A\00"
@.str.1 = [20 x i8] c"True || False: %d \0A\00"
@.str.2 = [12 x i8] c"!TRUE: %d \0A\00"
@.str.3 = [13 x i8] c"!FALSE: %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void oom(void) { die("Out of memory"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define void @oom() {
%1 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define void @oom() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int fun854() { return 854; }


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

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

LLVM IR (-O0):
define i32 @fun854() {
ret i32 854
}

LLVM IR (-O2):
define i32 @fun854() {
ret i32 854
}
/* Variables and functions */
char *jsonLampInternal(int, char *, char *, int, char *, char *, int, int, int,
                       int, int, int);
char *jsonLamp_xyY(int id, char *mac, char *nm, int rm, char *ty, char *cmd,
                   int lvl, int xcr, int ycr, int joined) {
  return (jsonLampInternal(id, mac, nm, rm, ty, cmd, lvl, -1, -1, xcr, ycr,
                           joined));
}


x86 assembly (clang, -O0):
<jsonLamp_xyY>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x68,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%ebx
mov    0x18(%rbp),%r11d
mov    0x20(%rbp),%r10d
mov    0x28(%rbp),%eax
mov    %ebx,(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
movl   $0xffffffff,0x10(%rsp)
ff
mov    %r11d,0x18(%rsp)
mov    %r10d,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1030 <jsonLampInternal@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsonLamp_xyY>:
push   %rbx
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
mov    0x20(%rsp),%eax
mov    0x28(%rsp),%ebx
push   %rbx
push   %rax
push   %r11
push   $0xffffffffffffffff
push   $0xffffffffffffffff
push   %r10
call   1030 <jsonLampInternal@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @jsonLamp_xyY(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %11
store i8* %1, i8** %12
store i8* %2, i8** %13
store i32 %3, i32* %14
store i8* %4, i8** %15
store i8* %5, i8** %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%21 = load i32, i32* %11
%22 = load i8*, i8** %12
%23 = load i8*, i8** %13
%24 = load i32, i32* %14
%25 = load i8*, i8** %15
%26 = load i8*, i8** %16
%27 = load i32, i32* %17
%28 = load i32, i32* %18
%29 = load i32, i32* %19
%30 = load i32, i32* %20
%31 = call i8* @jsonLampInternal(i32 %21, i8* %22, i8* %23, i32 %24, i8* %25, i8* %26, i32 %27, i32 -1, i32 -1, i32 %28, i32 %29, i32 %30)
ret i8* %31
}

LLVM IR (-O2):
define i8* @jsonLamp_xyY(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = tail call i8* @jsonLampInternal(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6, i32 -1, i32 -1, i32 %7, i32 %8, i32 %9)
ret i8* %11
}
/* Type definitions */
struct tsm_screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_inc_age(struct tsm_screen *);
int /*<<< orphan*/ screen_scroll_down(struct tsm_screen *, unsigned int);
__attribute__((visibility("default"))) void
tsm_screen_scroll_down(struct tsm_screen *con, unsigned int num) {
  if (!con || !num)
    return;
  screen_inc_age(con);
  screen_scroll_down(con, num);
}


x86 assembly (clang, -O0):
<tsm_screen_scroll_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <tsm_screen_scroll_down+0x24>
cmpl   $0x0,-0xc(%rbp)
jne    1149 <tsm_screen_scroll_down+0x29>
jmp    115e <tsm_screen_scroll_down+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <screen_inc_age@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <screen_scroll_down@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsm_screen_scroll_down>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <tsm_screen_scroll_down+0x26>
mov    %esi,%ebp
test   %esi,%esi
je     1146 <tsm_screen_scroll_down+0x26>
mov    %rdi,%rbx
call   1030 <screen_inc_age@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <screen_scroll_down@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_scroll_down(%struct.tsm_screen* %0, i32 %1) {
%3 = alloca %struct.tsm_screen*
%4 = alloca i32
store %struct.tsm_screen* %0, %struct.tsm_screen** %3
store i32 %1, i32* %4
%5 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%6 = icmp ne %struct.tsm_screen* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %2
br label %17
11: ; preds = %7
%12 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%13 = call i32 @screen_inc_age(%struct.tsm_screen* %12)
%14 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%15 = load i32, i32* %4
%16 = call i32 @screen_scroll_down(%struct.tsm_screen* %14, i32 %15)
br label %17
17: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_scroll_down(%struct.tsm_screen* %0, i32 %1) {
%3 = icmp ne %struct.tsm_screen* %0, null
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @screen_inc_age(%struct.tsm_screen* %0)
%8 = tail call i32 @screen_scroll_down(%struct.tsm_screen* %0, i32 %1)
br label %9
9: ; preds = %2, %6
ret void
}
/* Variables and functions */
int fabs(double);
bool approx_equal(double value1, double value2) {
  return fabs(value2 - value1) < 1e-7;
}


x86 assembly (clang, -O0):
<approx_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<approx_equal>:
push   %rax
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @approx_equal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fsub double %5, %6
%8 = call i32 @fabs(double %7)
%9 = sitofp i32 %8 to double
%10 = fcmp olt double %9, 0x3E7AD7F29ABCAF48
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @approx_equal(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
char TestE() {
  char r;
  __asm__("cmp $1, %1" : "=@cce"(r) : "r"(1));
  if (r) {
    __asm__("cmp $2, %1" : "=@ccne"(r) : "r"(1));
    if (r)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
cmp    $0x1,%eax
sete   %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1142 <TestE+0x42>
mov    $0x1,%eax
cmp    $0x2,%eax
setne  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     113d <TestE+0x3d>
movb   $0x1,-0x1(%rbp)
jmp    1146 <TestE+0x46>
jmp    1142 <TestE+0x42>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestE>:
mov    $0x1,%eax
cmp    $0x1,%eax
jne    1112 <TestE+0x12>
cmp    $0x2,%eax
mov    $0x1,%al
je     1112 <TestE+0x12>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestE() {
%1 = alloca i8
%2 = alloca i8
%3 = call i8 asm "cmp $$1, $1", "={@cce},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i8 asm "cmp $$2, $1", "={@ccne},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 1, i8* %1
br label %13
11: ; preds = %6
br label %12
12: ; preds = %11, %0
store i8 0, i8* %1
br label %13
13: ; preds = %12, %10
%14 = load i8, i8* %1
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @TestE() {
%1 = tail call i8 asm "cmp $$1, $1", "={@cce},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = icmp eq i8 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i8 asm "cmp $$2, $1", "={@ccne},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i8 [ 0, %6 ], [ 1, %3 ]
ret i8 %8
}
void ls_cost_nm4_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_cost_nm4_incref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lim_shellquote(char const *, size_t *, char *, size_t);
char *xalloc(size_t);
char *xshellquote(const char *word) {
  size_t bufsz = 0;
  lim_shellquote(word, &bufsz, NULL, 0);
  char *quoted = xalloc(bufsz + 1);
  size_t pos = 0;
  lim_shellquote(word, &pos, quoted, bufsz);
  quoted[bufsz] = '\0';
  return quoted;
}


x86 assembly (clang, -O0):
<xshellquote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lim_shellquote@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <xalloc@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x20(%rbp),%rsi
call   1030 <lim_shellquote@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xshellquote>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <lim_shellquote@plt>
mov    0x8(%rsp),%rdi
add    $0x1,%rdi
call   1040 <xalloc@plt>
mov    %rax,%rbx
movq   $0x0,0x10(%rsp)
mov    0x8(%rsp),%rcx
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
call   1030 <lim_shellquote@plt>
mov    0x8(%rsp),%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xshellquote(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%6 = load i8*, i8** %2
%7 = call i32 @lim_shellquote(i8* %6, i64* %3, i8* null, i64 0)
%8 = load i64, i64* %3
%9 = add i64 %8, 1
%10 = call i8* @xalloc(i64 %9)
store i8* %10, i8** %4
store i64 0, i64* %5
%11 = load i8*, i8** %2
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = call i32 @lim_shellquote(i8* %11, i64* %5, i8* %12, i64 %13)
%15 = load i8*, i8** %4
%16 = load i64, i64* %3
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %4
ret i8* %18
}

LLVM IR (-O2):
define i8* @xshellquote(i8* %0) {
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = call i32 @lim_shellquote(i8* %0, i64* %2, i8* null, i64 0)
%6 = load i64, i64* %2
%7 = add i64 %6, 1
%8 = call i8* @xalloc(i64 %7)
%9 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%10 = load i64, i64* %2
%11 = call i32 @lim_shellquote(i8* %0, i64* %3, i8* %8, i64 %10)
%12 = load i64, i64* %2
%13 = getelementptr inbounds i8, i8* %8, i64 %12
store i8 0, i8* %13
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_157() {
  Assert_real((isqrt(157) == 12),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              790, ("Integer square root of 157 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_157>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9d,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x316,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_157>:
push   %rax
mov    $0x9d,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x316,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 157 should be 12\00"
define void @t_sqrt_157() {
%1 = call i32 @isqrt(i32 157)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 157 should be 12\00"
define void @t_sqrt_157() {
%1 = tail call i32 @isqrt(i32 157)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 790, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void glLightModelfv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLightModelfv() {
ret void
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2) {
    if (*s1 == '\0')
      return (0);
    s1++;
    s2++;
  }
  return ((*(unsigned char *)s1 - *(unsigned char *)s2));
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = zext i8 %18 to i32
%21 = zext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
const char *ccnxPortalAbout_MiniNotice(void) {
  return "Copyright (c) 2017 Cisco and/or its affiliates.\n";
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxPortalAbout_MiniNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [49 x i8] c"Copyright (c) 2017 Cisco and/or its affiliates.\0A\00"
define i8* @ccnxPortalAbout_MiniNotice() {
ret i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int setuid(uid_t uid) {
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<setuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setuid>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
define i32 @setuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EPERM
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @setuid(i32 %0) {
%2 = load i32, i32* @EPERM
store i32 %2, i32* @errno
ret i32 -1
}