xunge/DecIR huggingface dataset:
broken(str, nlin) {
  switch (ylet(str, nlin)) {
  case 'n':
  case 'N':
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<broken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %eax,%eax
call   1030 <ylet@plt>
or     $0x20,%eax
sub    $0x6e,%eax
je     113c <broken+0x2c>
jmp    1148 <broken+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <broken+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<broken>:
push   %rax
xor    %eax,%eax
call   1030 <ylet@plt>
and    $0xffffffdf,%eax
xor    %ecx,%ecx
cmp    $0x4e,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @broken(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @ylet to i32 (i32, i32, ...)*)(i32 %6, i32 %7)
switch i32 %8, label %10 [
i32 110, label %9
i32 78, label %9
]
9: ; preds = %2, %2
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @broken(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ylet to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%4 = and i32 %3, -33
%5 = icmp eq i32 %4, 78
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ display_getKeyboardEntry(char *, int);
int /*<<< orphan*/ display_powerDown();
scalar_t__ strcmp(char *, char *);
void event_keyboardCheckTimerExpired(void) {
  char userEntry[100];
  display_getKeyboardEntry(userEntry, 100);
  if (strcmp(userEntry, "sleep") == 0) {
    display_powerDown();
  }
}


x86 assembly (clang, -O0):
<event_keyboardCheckTimerExpired>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1040 <display_getKeyboardEntry@plt>
lea    -0x70(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1167 <event_keyboardCheckTimerExpired+0x37>
mov    $0x0,%al
call   1030 <display_powerDown@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_keyboardCheckTimerExpired>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <display_getKeyboardEntry@plt>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1160 <event_keyboardCheckTimerExpired+0x30>
xor    %eax,%eax
call   1030 <display_powerDown@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"sleep\00"
define void @event_keyboardCheckTimerExpired() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @display_getKeyboardEntry(i8* %2, i32 100)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @display_powerDown()
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"sleep\00"
define void @event_keyboardCheckTimerExpired() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @display_getKeyboardEntry(i8* %2, i32 100)
%4 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @display_powerDown()
br label %8
8: ; preds = %6, %0
ret void
}
double ft_lerp(double first, double second, double p) {
  if (first == second)
    return (first);
  return (first + (second - first) * p);
}


x86 assembly (clang, -O0):
<ft_lerp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1138 <ft_lerp+0x38>
jp     1138 <ft_lerp+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1159 <ft_lerp+0x59>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_lerp>:
movapd %xmm0,%xmm3
cmpeqsd %xmm1,%xmm3
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
andpd  %xmm3,%xmm0
andnpd %xmm1,%xmm3
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @ft_lerp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp oeq double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %5
store double %12, double* %4
br label %20
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %6
%16 = load double, double* %5
%17 = fsub double %15, %16
%18 = load double, double* %7
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %14)
store double %19, double* %4
br label %20
20: ; preds = %13, %11
%21 = load double, double* %4
ret double %21
}

LLVM IR (-O2):
define double @ft_lerp(double %0, double %1, double %2) {
%4 = fcmp oeq double %0, %1
%5 = fsub double %1, %0
%6 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %0)
%7 = select i1 %4, double %0, double %6
ret double %7
}
/* Variables and functions */
char *synge_error_msg(int /*<<< orphan*/);
int /*<<< orphan*/ to_error_code(int, int);
char *synge_error_msg_pos(int code, int pos) {
  return synge_error_msg(to_error_code(code, pos));
}


x86 assembly (clang, -O0):
<synge_error_msg_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <to_error_code@plt>
mov    %eax,%edi
call   1030 <synge_error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<synge_error_msg_pos>:
push   %rax
call   1040 <to_error_code@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <synge_error_msg@plt>

LLVM IR (-O0):
define i8* @synge_error_msg_pos(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 = call i32 @to_error_code(i32 %5, i32 %6)
%8 = call i8* @synge_error_msg(i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @synge_error_msg_pos(i32 %0, i32 %1) {
%3 = tail call i32 @to_error_code(i32 %0, i32 %1)
%4 = tail call i8* @synge_error_msg(i32 %3)
ret i8* %4
}
/* Type definitions */
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
  int /*<<< orphan*/ sun_family;
};

/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ memset(struct sockaddr_un *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char const *);
int uds_set_addr(struct sockaddr_un *addr, const char *sock_name) {
  memset(addr, 0, sizeof(*addr));
  addr->sun_family = AF_UNIX;
  strcpy(addr->sun_path, sock_name);
  return 0;
}


x86 assembly (clang, -O0):
<uds_set_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uds_set_addr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rbx)
mov    (%rbx),%edi
mov    %r14,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32, i32 }
@AF_UNIX = global i32 0
define i32 @uds_set_addr(%struct.sockaddr_un* %0, i8* %1) {
%3 = alloca %struct.sockaddr_un*
%4 = alloca i8*
store %struct.sockaddr_un* %0, %struct.sockaddr_un** %3
store i8* %1, i8** %4
%5 = load %struct.sockaddr_un*, %struct.sockaddr_un** %3
%6 = call i32 @memset(%struct.sockaddr_un* %5, i32 0, i32 8)
%7 = load i32, i32* @AF_UNIX
%8 = load %struct.sockaddr_un*, %struct.sockaddr_un** %3
%9 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = load %struct.sockaddr_un*, %struct.sockaddr_un** %3
%11 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i8*, i8** %4
%14 = call i32 @strcpy(i32 %12, i8* %13)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32, i32 }
@AF_UNIX = global i32 0
define i32 @uds_set_addr(%struct.sockaddr_un* %0, i8* %1) {
%3 = tail call i32 @memset(%struct.sockaddr_un* %0, i32 0, i32 8)
%4 = load i32, i32* @AF_UNIX
%5 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %0, i64 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @strcpy(i32 %7, i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int CompareStrings(char *key1, char *key2) { return (strcmp(key1, key2) == 0); }


x86 assembly (clang, -O0):
<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):
<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 @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 @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
}
/* Variables and functions */
__attribute((always_)) void b(int vm[g()][g()]) {}


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

x86 assembly (clang, -O2):
<b>:
push   %rax
xor    %eax,%eax
call   1030 <g@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @b(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @g()
%4 = zext i32 %3 to i64
%5 = call i32 (...) @g()
%6 = zext i32 %5 to i64
ret void
}

LLVM IR (-O2):
define void @b(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @g()
%3 = tail call i32 (...) @g()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void showMacrosWithValues() {
  printf("BUFFER_SIZE defined with value [%d]\n", 1024);
}


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

x86 assembly (clang, -O2):
<showMacrosWithValues>:
lea    0xee9(%rip),%rdi
mov    $0x400,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"BUFFER_SIZE defined with value [%d]\0A\00"
define void @showMacrosWithValues() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 1024)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"BUFFER_SIZE defined with value [%d]\0A\00"
define void @showMacrosWithValues() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 1024)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fish001();
int /*<<< orphan*/ Fish002();
int /*<<< orphan*/ Fish003();
int /*<<< orphan*/ Fish004();
int /*<<< orphan*/ Fish005();
int /*<<< orphan*/ Fish006();
int /*<<< orphan*/ Fish007();
int /*<<< orphan*/ Fish008();
int /*<<< orphan*/ Fish009();
void Fish_3(void) {
  Fish005();
  Fish004();
  Fish007();
  Fish003();
  Fish002();
  Fish008();
  Fish009();
  Fish001();
  Fish006();
}


x86 assembly (clang, -O0):
<Fish_3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Fish005@plt>
mov    $0x0,%al
call   10a0 <Fish004@plt>
mov    $0x0,%al
call   1060 <Fish007@plt>
mov    $0x0,%al
call   1040 <Fish003@plt>
mov    $0x0,%al
call   1080 <Fish002@plt>
mov    $0x0,%al
call   10b0 <Fish008@plt>
mov    $0x0,%al
call   1070 <Fish009@plt>
mov    $0x0,%al
call   1050 <Fish001@plt>
mov    $0x0,%al
call   1090 <Fish006@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fish_3>:
push   %rax
xor    %eax,%eax
call   1030 <Fish005@plt>
xor    %eax,%eax
call   10a0 <Fish004@plt>
xor    %eax,%eax
call   1060 <Fish007@plt>
xor    %eax,%eax
call   1040 <Fish003@plt>
xor    %eax,%eax
call   1080 <Fish002@plt>
xor    %eax,%eax
call   10b0 <Fish008@plt>
xor    %eax,%eax
call   1070 <Fish009@plt>
xor    %eax,%eax
call   1050 <Fish001@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <Fish006@plt>

LLVM IR (-O0):
define void @Fish_3() {
%1 = call i32 (...) @Fish005()
%2 = call i32 (...) @Fish004()
%3 = call i32 (...) @Fish007()
%4 = call i32 (...) @Fish003()
%5 = call i32 (...) @Fish002()
%6 = call i32 (...) @Fish008()
%7 = call i32 (...) @Fish009()
%8 = call i32 (...) @Fish001()
%9 = call i32 (...) @Fish006()
ret void
}

LLVM IR (-O2):
define void @Fish_3() {
%1 = tail call i32 (...) @Fish005()
%2 = tail call i32 (...) @Fish004()
%3 = tail call i32 (...) @Fish007()
%4 = tail call i32 (...) @Fish003()
%5 = tail call i32 (...) @Fish002()
%6 = tail call i32 (...) @Fish008()
%7 = tail call i32 (...) @Fish009()
%8 = tail call i32 (...) @Fish001()
%9 = tail call i32 (...) @Fish006()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr1Operand(int, int, int, int);
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int, int);
void GenJumpIfEqual(int val, int label) {
  GenPrintInstr2Operands(0x0E, 0, 0x03, 0, 0x0D, val);
  GenPrintInstr1Operand(0x1D, 8, 0x0F, label);
}


x86 assembly (clang, -O0):
<GenJumpIfEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%r9d
mov    $0xe,%edi
xor    %ecx,%ecx
mov    $0x3,%edx
mov    $0xd,%r8d
mov    %ecx,%esi
call   1030 <GenPrintInstr2Operands@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1d,%edi
mov    $0x8,%esi
mov    $0xf,%edx
call   1040 <GenPrintInstr1Operand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenJumpIfEqual>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%r9d
mov    $0xe,%edi
xor    %esi,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
mov    $0xd,%r8d
call   1030 <GenPrintInstr2Operands@plt>
mov    $0x1d,%edi
mov    $0x8,%esi
mov    $0xf,%edx
mov    %ebx,%ecx
pop    %rbx
jmp    1040 <GenPrintInstr1Operand@plt>

LLVM IR (-O0):
define void @GenJumpIfEqual(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 = call i32 @GenPrintInstr2Operands(i32 14, i32 0, i32 3, i32 0, i32 13, i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @GenPrintInstr1Operand(i32 29, i32 8, i32 15, i32 %7)
ret void
}

LLVM IR (-O2):
define void @GenJumpIfEqual(i32 %0, i32 %1) {
%3 = tail call i32 @GenPrintInstr2Operands(i32 14, i32 0, i32 3, i32 0, i32 13, i32 %0)
%4 = tail call i32 @GenPrintInstr1Operand(i32 29, i32 8, i32 15, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ common();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello from prog2.c\n");
  common();
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"hello from prog2.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @common()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void htxcmd_display_result(char *result_string) {
  printf("\n######################## Result Starts Here "
         "################################");
  printf("\n%s\n", result_string);
  printf("######################### Result Ends Here "
         "#################################\n");
}


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

x86 assembly (clang, -O2):
<htxcmd_display_result>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf09(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [78 x i8] c"\0A######################## Result Starts Here ################################\00"
@.str.1 = [5 x i8] c"\0A%s\0A\00"
@str = [77 x i8] c"######################### Result Ends Here #################################\00"
define void @htxcmd_display_result(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ __OPEN_NEEDS_MODE(int);
int /*<<< orphan*/ __fortify_fail(char *);
int __openat(int, char const *, int);
int __openat_2(int fd, const char *file, int oflag) {
  if (__OPEN_NEEDS_MODE(oflag))
    __fortify_fail("invalid openat call: O_CREAT or O_TMPFILE without mode");
  return __openat(fd, file, oflag);
}


x86 assembly (clang, -O0):
<__openat_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <__OPEN_NEEDS_MODE@plt>
cmp    $0x0,%rax
je     1160 <__openat_2+0x30>
lea    0xea5(%rip),%rdi
call   1050 <__fortify_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <__openat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__openat_2>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <__OPEN_NEEDS_MODE@plt>
test   %rax,%rax
je     1153 <__openat_2+0x23>
lea    0xeb2(%rip),%rdi
call   1050 <__fortify_fail@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <__openat@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"invalid openat call: O_CREAT or O_TMPFILE without mode\00"
define i32 @__openat_2(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i64 @__OPEN_NEEDS_MODE(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @__fortify_fail(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @__openat(i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [55 x i8] c"invalid openat call: O_CREAT or O_TMPFILE without mode\00"
define i32 @__openat_2(i32 %0, i8* %1, i32 %2) {
%4 = tail call i64 @__OPEN_NEEDS_MODE(i32 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @__fortify_fail(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @__openat(i32 %0, i8* %1, i32 %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int);
int main(void) {
  syscall(541);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @syscall(i32 541)
ret i32 0
}
void TestDynamicLoaderSymbolPointer(void) {}


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

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

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

LLVM IR (-O2):
define void @TestDynamicLoaderSymbolPointer() {
ret void
}
/* Type definitions */
struct Parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit(struct Parser *, int);
void emitImmediate(struct Parser *p, int val, int arg) {
  emit(p, val);
  emit(p, arg);
}


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

x86 assembly (clang, -O2):
<emitImmediate>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <emit@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <emit@plt>

LLVM IR (-O0):
%struct.Parser = type { i32 }
define void @emitImmediate(%struct.Parser* %0, i32 %1, i32 %2) {
%4 = alloca %struct.Parser*
%5 = alloca i32
%6 = alloca i32
store %struct.Parser* %0, %struct.Parser** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.Parser*, %struct.Parser** %4
%8 = load i32, i32* %5
%9 = call i32 @emit(%struct.Parser* %7, i32 %8)
%10 = load %struct.Parser*, %struct.Parser** %4
%11 = load i32, i32* %6
%12 = call i32 @emit(%struct.Parser* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.Parser = type { i32 }
define void @emitImmediate(%struct.Parser* %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit(%struct.Parser* %0, i32 %1)
%5 = tail call i32 @emit(%struct.Parser* %0, i32 %2)
ret void
}
void platform_udc_ep_barrier(void) {}


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

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

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

LLVM IR (-O2):
define void @platform_udc_ep_barrier() {
ret void
}
int gcd(int M, int N) {
  if (M < 0 || N < 0) {
    return 0;
  }
  if (M % N == 0) {
    return N;
  } else if (M % N > 0) {
    return M % N;
  }
  return 1;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <gcd+0x1e>
cmpl   $0x0,-0xc(%rbp)
jge    112a <gcd+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1170 <gcd+0x70>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1145 <gcd+0x45>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <gcd+0x70>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jle    1164 <gcd+0x64>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    1170 <gcd+0x70>
jmp    1169 <gcd+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
or     %edi,%eax
js     1113 <gcd+0x13>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
test   %edx,%edx
cmove  %esi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = srem i32 %0, %1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %1, i32 %6
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
void RTTimeSystemNanoTS(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeSystemNanoTS() {
ret void
}
int main(int argc, char **argv) {
  int foo;
  if (foo > 0) {
    foo += 12;
  } else {
    foo -= 12;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    112a <main+0x2a>
mov    -0x14(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <main+0x33>
mov    -0x14(%rbp),%eax
sub    $0xc,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int mymalloc_init() { return 0; }


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

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

LLVM IR (-O0):
define i32 @mymalloc_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mymalloc_init() {
ret i32 0
}
void handler(int what) {
  printf("\n %s: \n", __func__);
  printf("We have received SIGALRM: Executing periodic work\n");
  sleep(5);
  printf(" done sleeping 2 seconds\n");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x5,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec9(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
xor    %eax,%eax
call   1050 <sleep@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.handler = [8 x i8] c"handler\00"
@.str.1 = [51 x i8] c"We have received SIGALRM: Executing periodic work\0A\00"
@.str.2 = [26 x i8] c" done sleeping 2 seconds\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.handler, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 5)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.handler = [8 x i8] c"handler\00"
@str = [50 x i8] c"We have received SIGALRM: Executing periodic work\00"
@str.3 = [25 x i8] c" done sleeping 2 seconds\00"
define void @handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.handler, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 5)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.3, i64 0, i64 0))
ret void
}
char _hex(int i) {
  i &= 0xf;
  return (i >= 0xa) ? (i - 0xa + 'a') : (i + '0');
}


x86 assembly (clang, -O0):
<_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     112b <_hex+0x2b>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <_hex+0x34>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hex>:
and    $0xf,%edi
lea    0x30(%rdi),%eax
lea    0x57(%rdi),%ecx
cmp    $0xa,%edi
movzbl %cl,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 10
%10 = add nsw i32 %9, 97
br label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 48
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %10, %7 ], [ %13, %11 ]
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @_hex(i32 %0) {
%2 = and i32 %0, 15
%3 = icmp ugt i32 %2, 9
%4 = add nuw nsw i32 %2, 87
%5 = or i32 %2, 48
%6 = select i1 %3, i32 %4, i32 %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
void msm_jtag_mm_restore_state(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_jtag_mm_restore_state() {
ret void
}
float call_lerpf(float a, float b, float t) { return ((a) + ((b) - (a)) * t); }


x86 assembly (clang, -O0):
<call_lerpf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_lerpf>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @call_lerpf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %4
%10 = fsub float %8, %9
%11 = load float, float* %6
%12 = call float @llvm.fmuladd.f32(float %10, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @call_lerpf(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %4, float %2, float %0)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ buffer_overflow();
void buffer_overflow_test(void **state) { buffer_overflow(); }


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

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

LLVM IR (-O0):
define void @buffer_overflow_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (...) @buffer_overflow()
ret void
}

LLVM IR (-O2):
define void @buffer_overflow_test(i8** nocapture readnone %0) {
%2 = tail call i32 (...) @buffer_overflow()
ret void
}
/* Variables and functions */
char tolower(char);
extern char *strlwr(char *s) {
  char *c;
  for (c = s; (*c); c++) {
    *c = tolower(*c);
  }
  return s;
}


x86 assembly (clang, -O0):
<strlwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strlwr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlwr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlwr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlwr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strlwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %14, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call signext i8 @tolower(i8 signext %11)
%13 = load i8*, i8** %3
store i8 %12, i8* %13
br label %14
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %5
17: ; preds = %5
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @strlwr(i8* returned %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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int UI_SortServerStatusCompare(const void *a, const void *b) {
  const char **la = (const char **)a;
  const char **lb = (const char **)b;
  return strcmp(la[0], lb[0]);
}


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

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

LLVM IR (-O0):
define i32 @UI_SortServerStatusCompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %6
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @strcmp(i8* %13, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @UI_SortServerStatusCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ xmalloc(scalar_t__);
char *xstrdup(const char *str) { return strcpy(xmalloc(strlen(str) + 1), str); }


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @xmalloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @xmalloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_13734() {
  Assert_real((isqrt(13734) == 117),
              "/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",
              1570, ("Integer square root of 13734 should be 117"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_13734>:
push   %rax
mov    $0x35a6,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x75,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x622,%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 = [43 x i8] c"Integer square root of 13734 should be 117\00"
define void @t_sqrt_13734() {
%1 = call i32 @isqrt(i32 13734)
%2 = icmp eq i32 %1, 117
%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 1570, i8* getelementptr inbounds ([43 x i8], [43 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 = [43 x i8] c"Integer square root of 13734 should be 117\00"
define void @t_sqrt_13734() {
%1 = tail call i32 @isqrt(i32 13734)
%2 = icmp eq i32 %1, 117
%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 1570, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void glmSub3fv_(float x[3], const float y[3]) {
  for (size_t i = 0; i < 3; ++i)
    x[i] -= y[i];
}


x86 assembly (clang, -O0):
<glmSub3fv_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1153 <glmSub3fv_+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <glmSub3fv_+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSub3fv_>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
subss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
subss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmSub3fv_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %19, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = load float*, float** %3
%15 = load i64, i64* %5
%16 = getelementptr inbounds float, float* %14, i64 %15
%17 = load float, float* %16
%18 = fsub float %17, %13
store float %18, float* %16
br label %19
19: ; preds = %9
%20 = load i64, i64* %5
%21 = add i64 %20, 1
store i64 %21, i64* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmSub3fv_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fsub float %4, %3
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fsub float %9, %7
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fsub float %14, %12
store float %15, float* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heaperr();
void *malloc(size_t);
void *allocate(size_t n) {
  void *a;
  if ((a = malloc(n)) == 0)
    heaperr();
  return a;
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <allocate+0x2a>
mov    $0x0,%al
call   1030 <heaperr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <allocate+0x15>
xor    %eax,%eax
call   1030 <heaperr@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @allocate(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @heaperr()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void a(void) {
  int a = 1337;
  printf("a: %d", a);
  printf("~a: %d", ~a);
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x539,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
xor    $0xffffffff,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rax
lea    0xee9(%rip),%rdi
mov    $0x539,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0xfffffac6,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"a: %d\00"
@.str.1 = [7 x i8] c"~a: %d\00"
define void @a() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1337)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 -1338)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *applet(const char *arg0) {
  char *s = strrchr(arg0, '/');
  if (!s)
    return arg0;
  return s + 1;
}


x86 assembly (clang, -O0):
<applet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <applet+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <applet+0x42>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applet>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @applet(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @applet(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void elf_header_get_symbols(char *binaryName) {}


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

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

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

LLVM IR (-O2):
define void @elf_header_get_symbols(i8* nocapture %0) {
ret void
}