xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clean_boot_history();
int /*<<< orphan*/ clean_file(char *, int, int /*<<< orphan*/);
void clean_history() {
  clean_file((char *)"/dev_hdd0/vsh/pushlist/patch.dat", 0x34, 0);
  clean_file((char *)"/dev_hdd0/vsh/pushlist/game.dat", 10, 0);
  clean_boot_history();
}


x86 assembly (clang, -O0):
<clean_history>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x34,%esi
xor    %edx,%edx
call   1040 <clean_file@plt>
lea    0xee3(%rip),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1040 <clean_file@plt>
mov    $0x0,%al
call   1030 <clean_boot_history@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_history>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x34,%esi
xor    %edx,%edx
call   1040 <clean_file@plt>
lea    0xee6(%rip),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1040 <clean_file@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clean_boot_history@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"/dev_hdd0/vsh/pushlist/patch.dat\00"
@.str.1 = [32 x i8] c"/dev_hdd0/vsh/pushlist/game.dat\00"
define void @clean_history() {
%1 = call i32 @clean_file(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 52, i32 0)
%2 = call i32 @clean_file(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 0)
%3 = call i32 (...) @clean_boot_history()
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"/dev_hdd0/vsh/pushlist/patch.dat\00"
@.str.1 = [32 x i8] c"/dev_hdd0/vsh/pushlist/game.dat\00"
define void @clean_history() {
%1 = tail call i32 @clean_file(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 52, i32 0)
%2 = tail call i32 @clean_file(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 0)
%3 = tail call i32 (...) @clean_boot_history()
ret void
}
/* Variables and functions */
unsigned long inet_addr(char const *);
unsigned long CSLP_StringIPToULong(const char *IP) { return inet_addr(IP); }


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

x86 assembly (clang, -O2):
<CSLP_StringIPToULong>:
jmp    1030 <inet_addr@plt>

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

LLVM IR (-O2):
define i64 @CSLP_StringIPToULong(i8* %0) {
%2 = tail call i64 @inet_addr(i8* %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ mint_random_uniform(int, int);
int mint_random_int(int min, int max) {
  return (int)(mint_random_uniform(min, max));
}


x86 assembly (clang, -O0):
<mint_random_int>:
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   1030 <mint_random_uniform@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mint_random_int>:
jmp    1030 <mint_random_uniform@plt>

LLVM IR (-O0):
define i32 @mint_random_int(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 i64 @mint_random_uniform(i32 %5, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @mint_random_int(i32 %0, i32 %1) {
%3 = tail call i64 @mint_random_uniform(i32 %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __fork() {
  __set_errno(ENOSYS);
  return -1;
}


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

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__fork() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__fork() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
unsigned int add(unsigned int, unsigned int);
unsigned int sub(unsigned int i, unsigned int j) { return add(i, -j); }


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

x86 assembly (clang, -O2):
<sub>:
neg    %esi
jmp    1030 <add@plt>

LLVM IR (-O0):
define i32 @sub(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 = sub i32 0, %6
%8 = call i32 @add(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = tail call i32 @add(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int strcmp(char *, char *);
int HashCompare(const void *firstitem, const void *seconditem) {
  return strcmp((char *)firstitem, (char *)seconditem);
}


x86 assembly (clang, -O0):
<HashCompare>:
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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashCompare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @HashCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int yylex();
int nextToken() { return yylex(); }


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

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

LLVM IR (-O0):
define i32 @nextToken() {
%1 = call i32 (...) @yylex()
ret i32 %1
}

LLVM IR (-O2):
define i32 @nextToken() {
%1 = tail call i32 (...) @yylex()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_pattern(int ile_gwiazdek, char *pattern) {
  for (int i = 0; i < ile_gwiazdek; i++) {
    printf("%s", pattern);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1152 <print_pattern+0x42>
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_pattern+0x16>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pattern>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1152 <print_pattern+0x32>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1140 <print_pattern+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_pattern(i32 %0, i8* %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %4, label %6
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void tty_mode(int how) {
  static struct termios original_mode;
  if (how == 0) {
    tcgetattr(0, &original_mode);
  } else
    tcsetattr(0, TCSANOW, &original_mode);
}


x86 assembly (clang, -O0):
<tty_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <tty_mode+0x28>
xor    %edi,%edi
lea    0x2ef6(%rip),%rsi
call   1030 <tcgetattr@plt>
jmp    115f <tty_mode+0x3f>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    0x2eda(%rip),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_mode>:
test   %edi,%edi
je     113b <tty_mode+0x1b>
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0x2f00(%rip),%rdx
xor    %edi,%edi
jmp    1040 <tcsetattr@plt>
lea    0x2ef2(%rip),%rsi
xor    %edi,%edi
jmp    1030 <tcgetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@tty_mode.original_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define void @tty_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @tcgetattr(i32 0, %struct.termios* @tty_mode.original_mode)
br label %10
7: ; preds = %1
%8 = load i32, i32* @TCSANOW
%9 = call i32 @tcsetattr(i32 0, i32 %8, %struct.termios* @tty_mode.original_mode)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@tty_mode.original_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define void @tty_mode(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @tcgetattr(i32 0, %struct.termios* @tty_mode.original_mode)
br label %8
5: ; preds = %1
%6 = load i32, i32* @TCSANOW
%7 = tail call i32 @tcsetattr(i32 0, i32 %6, %struct.termios* @tty_mode.original_mode)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isConfigLine(char const *);
bool testNotConfigLine(void) {
  char const *line = "var\n";
  if (!isConfigLine(line)) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<testNotConfigLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <isConfigLine@plt>
cmp    $0x0,%eax
jne    1141 <testNotConfigLine+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <testNotConfigLine+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testNotConfigLine>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <isConfigLine@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"var\0A\00"
define i32 @testNotConfigLine() {
%1 = alloca i32
%2 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @isConfigLine(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"var\0A\00"
define i32 @testNotConfigLine() {
%1 = tail call i32 @isConfigLine(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char tolower(int /*<<< orphan*/);
char *(lowcase)(char *s1, const char *s2) {
  char *s = s1;
  for (s = s1; (*s++ = tolower(*s2++)) != '\0';)
    ;
  return (s1);
}


x86 assembly (clang, -O0):
<lowcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1169 <lowcase+0x59>
jmp    1130 <lowcase+0x20>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowcase>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <tolower@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
test   %al,%al
jne    1120 <lowcase+0x10>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @lowcase(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %10, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = tail call signext i8 @tolower(i32 %8)
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %9, i8* %5
%11 = icmp eq i8 %9, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %0
}
int do_446() { return 446; }


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

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

LLVM IR (-O0):
define i32 @do_446() {
ret i32 446
}

LLVM IR (-O2):
define i32 @do_446() {
ret i32 446
}
/* Variables and functions */
int /*<<< orphan*/ link(char *, char *);
void dummy() { link("/", "/"); }


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

x86 assembly (clang, -O2):
<dummy>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
jmp    1030 <link@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @dummy() {
%1 = tail call i32 @link(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printi(int i) { printf("%d", i); }


x86 assembly (clang, -O0):
<printi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printi>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printi(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(int argc, char **argv) {
  char *hello = (char *)malloc(6);
  strcpy(hello, "hello");
  char *short_buffer = (char *)malloc(9);
  strncpy(short_buffer, hello, 10);
  return short_buffer[8];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x6,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1040 <strcpy@plt>
mov    $0x9,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
movsbl 0x8(%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x6,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
lea    0xeb8(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    $0x9,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1030 <strncpy@plt>
movsbl 0x8(%rbx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 6)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = call i64 @malloc(i32 9)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %7
%14 = load i8*, i8** %7
%15 = load i8*, i8** %6
%16 = call i32 @strncpy(i8* %14, i8* %15, i32 10)
%17 = load i8*, i8** %7
%18 = getelementptr inbounds i8, i8* %17, i64 8
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 6)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i64 @malloc(i32 9)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @strncpy(i8* %7, i8* %4, i32 10)
%9 = getelementptr inbounds i8, i8* %7, i64 8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ index_array();
int main() {
  index_array();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @index_array()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ clear();
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
void configure_screen() {
  cbreak();
  noecho();
  clear();
  refresh();
  curs_set(false);
  keypad(stdscr, TRUE);
  nodelay(stdscr, TRUE);
}


x86 assembly (clang, -O0):
<configure_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
mov    $0x0,%al
call   1080 <clear@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
mov    0x2e22(%rip),%rax
mov    (%rax),%esi
call   1050 <nodelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<configure_screen>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1070 <noecho@plt>
xor    %eax,%eax
call   1080 <clear@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
xor    %edi,%edi
call   1090 <curs_set@plt>
mov    0x2e4a(%rip),%r14
mov    (%r14),%edi
mov    0x2e38(%rip),%rbx
mov    (%rbx),%esi
call   1040 <keypad@plt>
mov    (%r14),%edi
mov    (%rbx),%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <nodelay@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
define void @configure_screen() {
%1 = call i32 (...) @cbreak()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @clear()
%4 = call i32 (...) @refresh()
%5 = call i32 @curs_set(i32 0)
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @TRUE
%8 = call i32 @keypad(i32 %6, i32 %7)
%9 = load i32, i32* @stdscr
%10 = load i32, i32* @TRUE
%11 = call i32 @nodelay(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
define void @configure_screen() {
%1 = tail call i32 (...) @cbreak()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @clear()
%4 = tail call i32 (...) @refresh()
%5 = tail call i32 @curs_set(i32 0)
%6 = load i32, i32* @stdscr
%7 = load i32, i32* @TRUE
%8 = tail call i32 @keypad(i32 %6, i32 %7)
%9 = load i32, i32* @stdscr
%10 = load i32, i32* @TRUE
%11 = tail call i32 @nodelay(i32 %9, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_regexp_replace() { exit(1); }


x86 assembly (clang, -O0):
<caml_regexp_replace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_regexp_replace>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_regexp_replace() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_regexp_replace() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ my_err(char *);
char *tgetstr(char *, char **);
char *term_get_cap(char *c) {
  char *str;
  char area[2048];
  if (!(str = tgetstr(c, (char **)area)))
    my_err("Could not return string entry from tgetstr");
  return str;
}


x86 assembly (clang, -O0):
<term_get_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1030 <tgetstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1159 <term_get_cap+0x39>
lea    0xeac(%rip),%rdi
call   1040 <my_err@plt>
mov    -0x10(%rbp),%rax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_get_cap>:
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rsi
call   1030 <tgetstr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1144 <term_get_cap+0x24>
lea    0xec1(%rip),%rdi
call   1040 <my_err@plt>
mov    %rbx,%rax
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Could not return string entry from tgetstr\00"
define i8* @term_get_cap(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [2048 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%7 = bitcast i8* %6 to i8**
%8 = call i8* @tgetstr(i8* %5, i8** %7)
store i8* %8, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 @my_err(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [43 x i8] c"Could not return string entry from tgetstr\00"
define i8* @term_get_cap(i8* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = bitcast [2048 x i8]* %2 to i8**
%5 = call i8* @tgetstr(i8* %0, i8** %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @my_err(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Type definitions */
struct uwsgi_buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ uwsgi_buffer_append(struct uwsgi_buffer *, char *, int);
int uwsgi_webdav_multistatus_close(struct uwsgi_buffer *ub) {
  if (uwsgi_buffer_append(ub, "</D:multistatus>\n", 17))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<uwsgi_webdav_multistatus_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x11,%edx
call   1030 <uwsgi_buffer_append@plt>
cmp    $0x0,%rax
je     1147 <uwsgi_webdav_multistatus_close+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <uwsgi_webdav_multistatus_close+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_webdav_multistatus_close>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x11,%edx
call   1030 <uwsgi_buffer_append@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.uwsgi_buffer = type { i32 }
@.str = [18 x i8] c"</D:multistatus>\0A\00"
define i32 @uwsgi_webdav_multistatus_close(%struct.uwsgi_buffer* %0) {
%2 = alloca i32
%3 = alloca %struct.uwsgi_buffer*
store %struct.uwsgi_buffer* %0, %struct.uwsgi_buffer** %3
%4 = load %struct.uwsgi_buffer*, %struct.uwsgi_buffer** %3
%5 = call i64 @uwsgi_buffer_append(%struct.uwsgi_buffer* %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.uwsgi_buffer = type { i32 }
@.str = [18 x i8] c"</D:multistatus>\0A\00"
define i32 @uwsgi_webdav_multistatus_close(%struct.uwsgi_buffer* %0) {
%2 = tail call i64 @uwsgi_buffer_append(%struct.uwsgi_buffer* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 17)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ctest_assert_true(int, char *);
int /*<<< orphan*/ hello();
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int test_hello() {
  int condition;
  condition = strcmp(hello(), "hello") == 0;
  ctest_assert_true(condition, "Kontrola návratové hodnoty..");
  return 0;
}


x86 assembly (clang, -O0):
<test_hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <hello@plt>
mov    %eax,%edi
lea    0xeb8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xea0(%rip),%rsi
call   1050 <ctest_assert_true@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hello>:
push   %rax
xor    %eax,%eax
call   1030 <hello@plt>
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xeb0(%rip),%rsi
call   1050 <ctest_assert_true@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [31 x i8] c"Kontrola n\C3\A1vratov\C3\A9 hodnoty..\00"
define i32 @test_hello() {
%1 = alloca i32
%2 = call i32 (...) @hello()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @ctest_assert_true(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [31 x i8] c"Kontrola n\C3\A1vratov\C3\A9 hodnoty..\00"
define i32 @test_hello() {
%1 = tail call i32 (...) @hello()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @ctest_assert_true(i32 %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int generic_phy_get_by_name(struct udevice *user, const char *phy_name,
                            struct phy *phy) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.udevice = type opaque
%struct.phy = type opaque
define i32 @generic_phy_get_by_name(%struct.udevice* %0, i8* %1, %struct.phy* %2) {
%4 = alloca %struct.udevice*
%5 = alloca i8*
%6 = alloca %struct.phy*
store %struct.udevice* %0, %struct.udevice** %4
store i8* %1, i8** %5
store %struct.phy* %2, %struct.phy** %6
ret i32 0
}

LLVM IR (-O2):
%struct.udevice = type opaque
%struct.phy = type opaque
define i32 @generic_phy_get_by_name(%struct.udevice* nocapture readnone %0, i8* nocapture readnone %1, %struct.phy* nocapture readnone %2) {
ret i32 0
}
void RTHeapOffsetGetHeapSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapOffsetGetHeapSize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xbc() {
  Assert_real((isascii(188) == 0),
              "/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/ctype/test_isascii.c",
              945, ("isascii should be 0 for 0xbc"));
}


x86 assembly (clang, -O0):
<t_isascii_0xbc>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbc,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3b1,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0xbc>:
push   %rax
mov    $0xbc,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3b1,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xbc\00"
define void @t_isascii_0xbc() {
%1 = call i64 @isascii(i32 188)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 945, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xbc\00"
define void @t_isascii_0xbc() {
%1 = tail call i64 @isascii(i32 188)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 945, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct in_addr {
  scalar_t__ s_addr;
};

/* Variables and functions */
scalar_t__ htonl(int);
int is_local(struct in_addr *testip) {
  if (testip->s_addr == htonl(0x7f000001))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x7f000001,%edi
call   1030 <htonl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jne    114d <is_local+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <is_local+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_local>:
push   %rbx
mov    (%rdi),%rbx
mov    $0x7f000001,%edi
call   1030 <htonl@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i64 }
define i32 @is_local(%struct.in_addr* %0) {
%2 = alloca i32
%3 = alloca %struct.in_addr*
store %struct.in_addr* %0, %struct.in_addr** %3
%4 = load %struct.in_addr*, %struct.in_addr** %3
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = call i64 @htonl(i32 2130706433)
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.in_addr = type { i64 }
define i32 @is_local(%struct.in_addr* nocapture %0) {
%2 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = tail call i64 @htonl(i32 2130706433)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ by_ptr_pp(int /*<<< orphan*/);
int /*<<< orphan*/ shr();
void shr_by_ptr_pp(uint32_t x) {
  by_ptr_pp(x);
  shr();
}


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

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

LLVM IR (-O0):
define void @shr_by_ptr_pp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_ptr_pp(i32 %3)
%5 = call i32 (...) @shr()
ret void
}

LLVM IR (-O2):
define void @shr_by_ptr_pp(i32 %0) {
%2 = tail call i32 @by_ptr_pp(i32 %0)
%3 = tail call i32 (...) @shr()
ret void
}
void _to_uppercase(char *s) {
  while ((*s) != '\0') {
    if ((*s) >= 'A' && (*s) <= 'Z')
      (*s) = (*s) + ('a' - 'A');
    s++;
  }
}


x86 assembly (clang, -O0):
<_to_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115b <_to_uppercase+0x5b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114a <_to_uppercase+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114a <_to_uppercase+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <_to_uppercase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_to_uppercase>:
mov    (%rdi),%al
test   %al,%al
je     112a <_to_uppercase+0x2a>
add    $0x1,%rdi
jmp    111b <_to_uppercase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <_to_uppercase+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <_to_uppercase+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <_to_uppercase+0x10>
ret

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

LLVM IR (-O2):
define void @_to_uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
void temp_Initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @temp_Initialize() {
ret void
}
/* Variables and functions */
size_t strnlen(char const *, size_t);
size_t safestrnlen(const char *string, size_t maxlen) {
  return (string != NULL) ? strnlen(string, maxlen) : 0;
}


x86 assembly (clang, -O0):
<safestrnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <safestrnlen+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x18(%rbp)
jmp    114c <safestrnlen+0x3c>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    114c <safestrnlen+0x3c>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @safestrnlen(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @strnlen(i8* %0, i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ 0, %2 ]
ret i64 %7
}
void foo(int x) {
  for (int x = 0; x < 4; x++)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    112b <foo+0x2b>
jmp    111d <foo+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <foo+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
short from_gps(int);
short int gp2021_missed(void) { return from_gps(0x83); }


x86 assembly (clang, -O0):
<gp2021_missed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x83,%edi
call   1030 <from_gps@plt>
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<gp2021_missed>:
mov    $0x83,%edi
jmp    1030 <from_gps@plt>

LLVM IR (-O0):
define signext i16 @gp2021_missed() {
%1 = call signext i16 @from_gps(i32 131)
ret i16 %1
}

LLVM IR (-O2):
define signext i16 @gp2021_missed() {
%1 = tail call signext i16 @from_gps(i32 131)
ret i16 %1
}
unsigned short SPI_get(unsigned short data) {
  int dummy;
  while ((*((volatile unsigned char *)0xE006800C)) & 0x4) {
    dummy = (*((volatile unsigned short *)0xE0068008));
  }
  (*((volatile unsigned short *)0xE0068008)) = data;
  while ((*((volatile unsigned char *)0xE006800C)) & 0x10)
    ;
  return ((*((volatile unsigned short *)0xE0068008)));
}


x86 assembly (clang, -O0):
<SPI_get>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xe006800c,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1134 <SPI_get+0x34>
mov    $0xe0068008,%eax
mov    (%rax),%ax
movzwl %ax,%eax
mov    %eax,-0x8(%rbp)
jmp    110b <SPI_get+0xb>
mov    -0x2(%rbp),%cx
mov    $0xe0068008,%eax
mov    %cx,(%rax)
mov    $0xe006800c,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     115b <SPI_get+0x5b>
jmp    1140 <SPI_get+0x40>
mov    $0xe0068008,%eax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_get>:
mov    $0xe0068008,%eax
testb  $0x4,0x4(%rax)
je     1119 <SPI_get+0x19>
nopl   0x0(%rax,%rax,1)
movzwl (%rax),%ecx
testb  $0x4,0x4(%rax)
jne    1110 <SPI_get+0x10>
mov    %di,(%rax)
nopl   0x0(%rax)
testb  $0x10,0x4(%rax)
jne    1120 <SPI_get+0x20>
movzwl (%rax),%eax
ret

LLVM IR (-O0):
define zeroext i16 @SPI_get(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
br label %4
4: ; preds = %9, %1
%5 = load volatile i8, i8* inttoptr (i64 3758522380 to i8*)
%6 = zext i8 %5 to i32
%7 = and i32 %6, 4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load volatile i16, i16* inttoptr (i64 3758522376 to i16*)
%11 = zext i16 %10 to i32
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i16, i16* %2
store volatile i16 %13, i16* inttoptr (i64 3758522376 to i16*)
br label %14
14: ; preds = %19, %12
%15 = load volatile i8, i8* inttoptr (i64 3758522380 to i8*)
%16 = zext i8 %15 to i32
%17 = and i32 %16, 16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
br label %14
20: ; preds = %14
%21 = load volatile i16, i16* inttoptr (i64 3758522376 to i16*)
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @SPI_get(i16 zeroext %0) {
%2 = load volatile i8, i8* inttoptr (i64 3758522380 to i8*)
%3 = and i8 %2, 4
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = load volatile i16, i16* inttoptr (i64 3758522376 to i16*)
%7 = load volatile i8, i8* inttoptr (i64 3758522380 to i8*)
%8 = and i8 %7, 4
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
store volatile i16 %0, i16* inttoptr (i64 3758522376 to i16*)
br label %11
11: ; preds = %11, %10
%12 = load volatile i8, i8* inttoptr (i64 3758522380 to i8*)
%13 = and i8 %12, 16
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %11
15: ; preds = %11
%16 = load volatile i16, i16* inttoptr (i64 3758522376 to i16*)
ret i16 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t write_FD_BE(int, int /*<<< orphan*/ const *, int);
size_t int16WriteToFD(int fd, const int16_t *data) {
  return write_FD_BE(fd, data, sizeof(int16_t));
}


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

x86 assembly (clang, -O2):
<int16WriteToFD>:
mov    $0x4,%edx
jmp    1030 <write_FD_BE@plt>

LLVM IR (-O0):
define i64 @int16WriteToFD(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 i64 @write_FD_BE(i32 %5, i32* %6, i32 4)
ret i64 %7
}

LLVM IR (-O2):
define i64 @int16WriteToFD(i32 %0, i32* %1) {
%3 = tail call i64 @write_FD_BE(i32 %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
char *ec_malloc(size_t);
char *strcat(char *, char const *);
size_t strlen(char const *);
char *addchar(const char *msg, const char *b) {
  size_t len = strlen(msg);
  char *ret = ec_malloc(len * sizeof(char));
  *ret = '\0';
  return strcat(strcat(ret, msg), b);
}


x86 assembly (clang, -O0):
<addchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <ec_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
mov    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addchar>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rdi
call   1030 <ec_malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
mov    %rax,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <strcat@plt>

LLVM IR (-O0):
define i8* @addchar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = mul i64 %9, 1
%11 = call i8* @ec_malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
store i8 0, i8* %12
%13 = load i8*, i8** %6
%14 = load i8*, i8** %3
%15 = call i8* @strcat(i8* %13, i8* %14)
%16 = load i8*, i8** %4
%17 = call i8* @strcat(i8* %15, i8* %16)
ret i8* %17
}

LLVM IR (-O2):
define i8* @addchar(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i8* @ec_malloc(i64 %3)
store i8 0, i8* %4
%5 = tail call i8* @strcat(i8* %4, i8* dereferenceable(1) %0)
%6 = tail call i8* @strcat(i8* %4, i8* dereferenceable(1) %1)
ret i8* %4
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar11(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 11, v);
}


x86 assembly (clang, -O0):
<setDrawbar11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar11>:
mov    %esi,%edx
mov    $0xb,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar11(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 11, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar11(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 11, i8 zeroext %1)
ret void
}