xunge/DecIR huggingface dataset:
/* Variables and functions */
char toupper(int /*<<< orphan*/);
void str_toupper(const char *from, char *to) {
  if (from == NULL || to == NULL)
    return;
  while ((*to++ = toupper(*from++)))
    ;
}


x86 assembly (clang, -O0):
<str_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1136 <str_toupper+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    113b <str_toupper+0x2b>
jmp    1175 <str_toupper+0x65>
jmp    1140 <str_toupper+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1175 <str_toupper+0x65>
jmp    1140 <str_toupper+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_toupper>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1146 <str_toupper+0x36>
mov    %rsi,%r14
test   %rsi,%rsi
je     1146 <str_toupper+0x36>
mov    %rdi,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
test   %al,%al
jne    1130 <str_toupper+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @str_toupper(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 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %7, %2
br label %22
11: ; preds = %7
br label %12
12: ; preds = %21, %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = call signext i8 @toupper(i32 %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
store i8 %17, i8* %18
%20 = icmp ne i8 %17, 0
br i1 %20, label %21, label %22
21: ; preds = %12
br label %12
22: ; preds = %10, %12
ret void
}

LLVM IR (-O2):
define void @str_toupper(i8* %0, i8* writeonly %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %0, %2 ]
%8 = phi i8* [ %13, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = tail call signext i8 @toupper(i32 %11)
%13 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %12, i8* %8
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ VtolPathFollowerStatusHandle();
void VtolPathFollowerStatusRequestUpdate() {
  UAVObjRequestUpdate(VtolPathFollowerStatusHandle());
}


x86 assembly (clang, -O0):
<VtolPathFollowerStatusRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VtolPathFollowerStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VtolPathFollowerStatusRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <VtolPathFollowerStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @VtolPathFollowerStatusRequestUpdate() {
%1 = call i32 (...) @VtolPathFollowerStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VtolPathFollowerStatusRequestUpdate() {
%1 = tail call i32 (...) @VtolPathFollowerStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ calloc(scalar_t__, int);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *str) {
  char *dup = (char *)calloc(strlen(str) + 1, sizeof(char));
  strcpy(dup, str);
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
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
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @calloc(i64 %6, i32 1)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ file_short;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(char *, int, int, int /*<<< orphan*/ *);
int read_short(unsigned short *shortp, FILE *file) {
  unsigned char file_short[2];
  if (fread((char *)file_short, sizeof(file_short), 1, file) != 1)
    return 0;
  *shortp = file_short[0] * 256 + file_short[1];
  return 1;
}


x86 assembly (clang, -O0):
<read_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     114c <read_short+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    116a <read_short+0x5a>
movzbl -0x1a(%rbp),%eax
shl    $0x8,%eax
movzbl -0x19(%rbp),%ecx
add    %ecx,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_short>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
jne    1149 <read_short+0x39>
movzwl 0xe(%rsp),%eax
rol    $0x8,%ax
mov    %ax,(%rbx)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read_short(i16* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i16*
%5 = alloca i32*
%6 = alloca [2 x i8]
store i16* %0, i16** %4
store i32* %1, i32** %5
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%8 = load i32*, i32** %5
%9 = call i32 @fread(i8* %7, i32 2, i32 1, i32* %8)
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %23
12: ; preds = %2
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = mul nsw i32 %15, 256
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = add nsw i32 %16, %19
%21 = trunc i32 %20 to i16
%22 = load i16*, i16** %4
store i16 %21, i16* %22
store i32 1, i32* %3
br label %23
23: ; preds = %12, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @read_short(i16* nocapture writeonly %0, i32* nocapture %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = call i32 @fread(i8* %4, i32 2, i32 1, i32* %1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i8, i8* %4
%9 = zext i8 %8 to i16
%10 = shl nuw i16 %9, 8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i16
%14 = or i16 %10, %13
store i16 %14, i16* %0
br label %15
15: ; preds = %2, %7
%16 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_byte(int);
int /*<<< orphan*/ output_modrm(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_prefetch(void *addr) {
  assem_debug("prefetch %x\n", (int)addr);
  output_byte(0x0F);
  output_byte(0x18);
  output_modrm(0, 5, 1);
  output_w32((int)addr);
}


x86 assembly (clang, -O0):
<emit_prefetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xf,%edi
call   1050 <output_byte@plt>
mov    $0x18,%edi
call   1050 <output_byte@plt>
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x1,%edx
call   1060 <output_modrm@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_prefetch>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1030 <assem_debug@plt>
mov    $0xf,%edi
call   1050 <output_byte@plt>
mov    $0x18,%edi
call   1050 <output_byte@plt>
xor    %edi,%edi
mov    $0x5,%esi
mov    $0x1,%edx
call   1060 <output_modrm@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"prefetch %x\0A\00"
define void @emit_prefetch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @assem_debug(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @output_byte(i32 15)
%7 = call i32 @output_byte(i32 24)
%8 = call i32 @output_modrm(i32 0, i32 5, i32 1)
%9 = load i8*, i8** %2
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @output_w32(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"prefetch %x\0A\00"
define void @emit_prefetch(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @assem_debug(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @output_byte(i32 15)
%6 = tail call i32 @output_byte(i32 24)
%7 = tail call i32 @output_modrm(i32 0, i32 5, i32 1)
%8 = tail call i32 @output_w32(i32 %3)
ret void
}
int test_imm_85int64_lowword_reg(long long val) {
  return ((val) & (0x85 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_85int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x85,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_85int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 133
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *lua_check_string(int, char *);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void str_len(void) {
  char *s = lua_check_string(1, "strlen");
  lua_pushnumber(strlen(s));
}


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

x86 assembly (clang, -O2):
<str_len>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <lua_check_string@plt>
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"strlen\00"
define void @str_len() {
%1 = alloca i8*
%2 = call i8* @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @strlen(i8* %3)
%5 = call i32 @lua_pushnumber(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"strlen\00"
define void @str_len() {
%1 = tail call i8* @lua_check_string(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @strlen(i8* %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello world.");
  puts("More Text to print in C!");
  puts("This isn't so bad right now.");
  puts("A little different than C++ though.");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world.\00"
@.str.1 = [25 x i8] c"More Text to print in C!\00"
@.str.2 = [29 x i8] c"This isn't so bad right now.\00"
@.str.3 = [36 x i8] c"A little different than C++ though.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world.\00"
@.str.1 = [25 x i8] c"More Text to print in C!\00"
@.str.2 = [29 x i8] c"This isn't so bad right now.\00"
@.str.3 = [36 x i8] c"A little different than C++ though.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
char *strlwr(char *string) {
  char *cp;
  for (cp = string; *cp; ++cp) {
    if ('A' <= *cp && *cp <= 'Z') {
      *cp += 'a' - 'A';
    }
  }
  return (string);
}


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

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

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

LLVM IR (-O2):
define i8* @strlwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
int arr_exists(void **arr, void *val, int max) {
  int i;
  for (i = 0; i < max; i++)
    if (arr[i] == val)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<arr_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1157 <arr_exists+0x57>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x18(%rbp),%rax
jne    1144 <arr_exists+0x44>
movl   $0x1,-0x4(%rbp)
jmp    115e <arr_exists+0x5e>
jmp    1149 <arr_exists+0x49>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <arr_exists+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_exists>:
test   %edx,%edx
jle    111f <arr_exists+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %rsi,(%rdi,%rcx,8)
je     1122 <arr_exists+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <arr_exists+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @arr_exists(i8** nocapture %0, i8* readnone %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, %1
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
void arch_enable_interrupts(void) { __asm__ volatile("sti"); }


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

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

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

LLVM IR (-O2):
define void @arch_enable_interrupts() {
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void switch_dev_unregister(struct switch_dev *sdev) { return; }


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

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

LLVM IR (-O0):
%struct.switch_dev = type opaque
define void @switch_dev_unregister(%struct.switch_dev* %0) {
%2 = alloca %struct.switch_dev*
store %struct.switch_dev* %0, %struct.switch_dev** %2
ret void
}

LLVM IR (-O2):
%struct.switch_dev = type opaque
define void @switch_dev_unregister(%struct.switch_dev* nocapture %0) {
ret void
}
int baddu2(unsigned int a, unsigned int b) {
  unsigned long long c = (unsigned char)(a + b);
  int d = c;
  return d + 1;
}


x86 assembly (clang, -O0):
<baddu2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
movzbl %al,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baddu2>:
add    %esi,%edi
movzbl %dil,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @baddu2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add i32 %7, %8
%10 = trunc i32 %9 to i8
%11 = zext i8 %10 to i64
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @baddu2(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = and i32 %3, 255
%5 = add nuw nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
int setNonblocking(int i_fd) {
  int old_mode = fcntl(i_fd, F_GETFL);
  if (old_mode < 0) {
    return -1;
  }
  return fcntl(i_fd, F_SETFL, old_mode | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<setNonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1147 <setNonblocking+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <setNonblocking+0x59>
mov    -0x8(%rbp),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e8b(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1145 <setNonblocking+0x35>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb1(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setNonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %18
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* @F_SETFL
%14 = load i32, i32* %4
%15 = load i32, i32* @O_NONBLOCK
%16 = or i32 %14, %15
%17 = call i32 (i32, i32, ...) @fcntl(i32 %12, i32 %13, i32 %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setNonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
double bar(void) { return 0.0f; }


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

x86 assembly (clang, -O2):
<bar>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @bar() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @bar() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *str) {
  printf("%s\n config.ini\n", str);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s\0A config.ini\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s\0A config.ini\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ _debug(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ iptables_fw_set_authservers();
void fw_set_authservers(void) {
  _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/"
         "firewall.c",
         200, LOG_INFO, "Setting the authservers list");
  iptables_fw_set_authservers();
}


x86 assembly (clang, -O0):
<fw_set_authservers>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rdi
mov    $0xc8,%esi
lea    0xf4d(%rip),%rcx
call   1040 <_debug@plt>
mov    $0x0,%al
call   1030 <iptables_fw_set_authservers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_set_authservers>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xf55(%rip),%rcx
mov    $0xc8,%esi
call   1040 <_debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <iptables_fw_set_authservers@plt>

LLVM IR (-O0):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [29 x i8] c"Setting the authservers list\00"
define void @fw_set_authservers() {
%1 = load i32, i32* @LOG_INFO
%2 = call i32 @_debug(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 200, i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @iptables_fw_set_authservers()
ret void
}

LLVM IR (-O2):
@.str = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ForgotFun/wifidog/refs/heads/master/src/firewall.c\00"
@LOG_INFO = global i32 0
@.str.1 = [29 x i8] c"Setting the authservers list\00"
define void @fw_set_authservers() {
%1 = load i32, i32* @LOG_INFO
%2 = tail call i32 @_debug(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str, i64 0, i64 0), i32 200, i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @iptables_fw_set_authservers()
ret void
}
unsigned int readValue(void *address) {
  unsigned char *data = (unsigned char *)address;
  unsigned int value =
      (((unsigned int)data[3]) | (((unsigned int)data[2]) << 8) |
       (((unsigned int)data[1]) << 16) | (((unsigned int)data[0]) << 24));
  return value;
}


x86 assembly (clang, -O0):
<readValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @readValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %9, %14
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 16
%21 = or i32 %15, %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl i32 %25, 24
%27 = or i32 %21, %26
store i32 %27, i32* %4
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @readValue(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = load i8, i8* %0
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %14, %17
ret i32 %18
}
void RDMSR() {}


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

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

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

LLVM IR (-O2):
define void @RDMSR() {
ret void
}
int abc(const float x) { return 1; }


x86 assembly (clang, -O0):
<abc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abc(float %0) {
ret i32 1
}
/* Type definitions */
struct table_entry {
  int dummy;
};
struct table_col {
  int dummy;
};

/* Variables and functions */
int l_unit_raw(struct table_col *, struct table_entry *);
int l_unit_kib(struct table_col *col, struct table_entry *e) {
  return l_unit_raw(col, e);
}


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

x86 assembly (clang, -O2):
<l_unit_kib>:
jmp    1030 <l_unit_raw@plt>

LLVM IR (-O0):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
define i32 @l_unit_kib(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = alloca %struct.table_col*
%4 = alloca %struct.table_entry*
store %struct.table_col* %0, %struct.table_col** %3
store %struct.table_entry* %1, %struct.table_entry** %4
%5 = load %struct.table_col*, %struct.table_col** %3
%6 = load %struct.table_entry*, %struct.table_entry** %4
%7 = call i32 @l_unit_raw(%struct.table_col* %5, %struct.table_entry* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.table_col = type { i32 }
%struct.table_entry = type { i32 }
define i32 @l_unit_kib(%struct.table_col* %0, %struct.table_entry* %1) {
%3 = tail call i32 @l_unit_raw(%struct.table_col* %0, %struct.table_entry* %1)
ret i32 %3
}
void SPIIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<SPIIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIIntEnable>:
or     %rsi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @SPIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @SPIIntEnable(i64 %0, i64 %1) {
%3 = add i64 %0, 4
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = or i64 %5, %1
store volatile i64 %6, i64* %4
ret void
}
int quadruple(int *x) {
  int y = *x;
  return y * 4;
}


x86 assembly (clang, -O0):
<quadruple>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @quadruple(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 4
ret i32 %7
}

LLVM IR (-O2):
define i32 @quadruple(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 2
ret i32 %3
}
void fds_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @fds_shutdown() {
ret void
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
char *EatSpace(char *in) {
  while (*in && strchr(" \t\n\r", *in))
    in++;
  return in;
}


x86 assembly (clang, -O0):
<EatSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     114e <EatSpace+0x3e>
mov    -0x8(%rbp),%rax
lea    0xec4(%rip),%rdi
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115e <EatSpace+0x4e>
jmp    116f <EatSpace+0x5f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <EatSpace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EatSpace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     114c <EatSpace+0x3c>
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     114c <EatSpace+0x3c>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <EatSpace+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @EatSpace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %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 %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @EatSpace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
__attribute__((__weak__, __always___)) clock_t softboundcets_clock(void) {
  return clock();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundcets_clock() {
%1 = call i32 (...) @clock()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundcets_clock() {
%1 = tail call i32 (...) @clock()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i;
  printf("a%n\n", &i);
  printf("%d\n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"a%n\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int DoMatch(char *, char *, int);
int wildmat(char *text, char *p, int length) {
  if (p[0] == '*' && (length == 1))
    return 1;
  return DoMatch(text, p, length) == 1;
}


x86 assembly (clang, -O0):
<wildmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1149 <wildmat+0x39>
cmpl   $0x1,-0x1c(%rbp)
jne    1149 <wildmat+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1167 <wildmat+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <DoMatch@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wildmat>:
push   %rax
cmp    $0x1,%edx
jne    1122 <wildmat+0x12>
mov    $0x1,%eax
cmpb   $0x2a,(%rsi)
jne    1122 <wildmat+0x12>
pop    %rcx
ret
call   1030 <DoMatch@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wildmat(i8* %0, i8* %1, i32 %2) {
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 42
%6 = icmp eq i32 %2, 1
%7 = and i1 %6, %5
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = tail call i32 @DoMatch(i8* %0, i8* %1, i32 %2)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %3, %8
%13 = phi i32 [ %11, %8 ], [ 1, %3 ]
ret i32 %13
}
/* Variables and functions */
char *InstanceNumberAsStr();
scalar_t__ strtol(char const *, char **, int);
int InstanceNumberAsInt(void) {
  const char *instance_str = InstanceNumberAsStr();
  char *end = NULL;
  int result = (int)strtol(instance_str, &end, 10);
  return *end || result < 1 ? 1 : result;
}


x86 assembly (clang, -O0):
<InstanceNumberAsInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <InstanceNumberAsStr@plt>
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116a <InstanceNumberAsInt+0x4a>
cmpl   $0x1,-0x14(%rbp)
jge    1177 <InstanceNumberAsInt+0x57>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117d <InstanceNumberAsInt+0x5d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InstanceNumberAsInt>:
push   %rax
xor    %eax,%eax
call   1040 <InstanceNumberAsStr@plt>
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    %rax,%rdi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
test   %eax,%eax
mov    $0x1,%edx
cmovle %edx,%eax
cmpb   $0x0,(%rcx)
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @InstanceNumberAsInt() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = call i8* (...) @InstanceNumberAsStr()
store i8* %4, i8** %1
store i8* null, i8** %2
%5 = load i8*, i8** %1
%6 = call i64 @strtol(i8* %5, i8** %2, i32 10)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12, %0
br label %18
16: ; preds = %12
%17 = load i32, i32* %3
br label %18
18: ; preds = %16, %15
%19 = phi i32 [ 1, %15 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @InstanceNumberAsInt() {
%1 = alloca i8*
%2 = tail call i8* (...) @InstanceNumberAsStr()
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = call i64 @strtol(i8* %2, i8** %1, i32 10)
%5 = trunc i64 %4 to i32
%6 = load i8*, i8** %1
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp slt i32 %5, 1
%10 = select i1 %8, i1 true, i1 %9
%11 = select i1 %10, i32 1, i32 %5
ret i32 %11
}
unsigned short littlebinary2us(char *binary) {
  unsigned short result = 0;
  int len = sizeof(result);
  unsigned short exp = 1;
  int i;
  for (i = 0; i < len; ++i) {
    result += binary[i] * exp;
    exp <<= 8;
  }
  return result;
}


x86 assembly (clang, -O0):
<littlebinary2us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movl   $0x2,-0x10(%rbp)
movw   $0x1,-0x12(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1164 <littlebinary2us+0x64>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movzwl -0x12(%rbp),%eax
imul   %eax,%ecx
movzwl -0xa(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0x12(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0x12(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1122 <littlebinary2us+0x22>
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<littlebinary2us>:
movsbl (%rdi),%ecx
movzbl 0x1(%rdi),%eax
shl    $0x8,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @littlebinary2us(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = add i16 %7, %3
ret i16 %8
}
void Servo_isr_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @Servo_isr_Interrupt() {
ret void
}
int attach_thin_subvol(struct mosaic *m, struct volume *v, char *dev, int len,
                       int flags) {
  return -1;
}


x86 assembly (clang, -O0):
<attach_thin_subvol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @attach_thin_subvol(%struct.mosaic* %0, %struct.volume* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca %struct.mosaic*
%7 = alloca %struct.volume*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store %struct.mosaic* %0, %struct.mosaic** %6
store %struct.volume* %1, %struct.volume** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @attach_thin_subvol(%struct.mosaic* nocapture readnone %0, %struct.volume* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i32 %4) {
ret i32 -1
}