xunge/DecIR huggingface dataset:
struct protoent *getprotobyname(const char *name) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<getprotobyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
lea    0xedb(%rip),%rsi
lea    0xee6(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    1133 <getprotobyname+0x23>

x86 assembly (clang, -O2):
<getprotobyname>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <getprotobyname+0x20>

LLVM IR (-O0):
%struct.protoent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getprotobyname = [15 x i8] c"getprotobyname\00"
define %struct.protoent* @getprotobyname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.getprotobyname, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
%struct.protoent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getprotobyname = [15 x i8] c"getprotobyname\00"
define %struct.protoent* @getprotobyname(i8* nocapture readnone %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.getprotobyname, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
void init_counters(int *a, int *b) {
  *a = 0;
  *b = 0;
}


x86 assembly (clang, -O0):
<init_counters>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_counters>:
movl   $0x0,(%rdi)
movl   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @init_counters(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
store i32 0, i32* %5
%6 = load i32*, i32** %4
store i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @init_counters(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 0, i32* %0
store i32 0, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ towlower(int /*<<< orphan*/);
__attribute__((__weak__, __always___)) wint_t
softboundcets_towlower(wint_t wc) {
  return towlower(wc);
}


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

x86 assembly (clang, -O2):
<softboundcets_towlower>:
jmp    1030 <towlower@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_towlower(i32 %0) {
%2 = tail call i32 @towlower(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? c - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = add nsw i32 %8, 97
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ aarch64_mem_size(size_t *);
void ukvm_hv_mem_size(size_t *mem_size) { aarch64_mem_size(mem_size); }


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

x86 assembly (clang, -O2):
<ukvm_hv_mem_size>:
jmp    1030 <aarch64_mem_size@plt>

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

LLVM IR (-O2):
define void @ukvm_hv_mem_size(i64* %0) {
%2 = tail call i32 @aarch64_mem_size(i64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int readfile_init(char *);
int /*<<< orphan*/ readonly(int);
int main(int argc, char **argv) {
  int fd;
  fd = readfile_init("page_html");
  readonly(fd);
  close(fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <readfile_init@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <readonly@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <readfile_init@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <readonly@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"page_html\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 @readfile_init(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @readonly(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 @close(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"page_html\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @readfile_init(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @readonly(i32 %3)
%5 = tail call i32 @close(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *josephus(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char const *argv[]) {
  int *result = josephus(40, 3);
  printf("%d %d\n", result[0], result[1]);
  free(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x28,%edi
mov    $0x3,%esi
call   1040 <josephus@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe93(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
mov    $0x3,%esi
call   1040 <josephus@plt>
mov    %rax,%rbx
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @josephus(i32 40, i32 3)
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
%15 = load i32*, i32** %6
%16 = call i32 @free(i32* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @josephus(i32 40, i32 3)
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %3, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
%8 = tail call i32 @free(i32* %3)
ret i32 0
}
int compare(const char *s1, const char *s2, int b) {
  int i;
  for (i = 0; i < b; ++i) {
    if (*s1++ != *s2++)
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<compare>:
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    116d <compare+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     115a <compare+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1174 <compare+0x74>
jmp    115f <compare+0x5f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <compare+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
test   %edx,%edx
jle    1121 <compare+0x21>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1124 <compare+0x24>
add    $0x1,%rcx
cmp    %ecx,%eax
jne    1110 <compare+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @compare(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 = %25, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %5
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %6
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %6
%20 = load i8, i8* %18
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %17, %21
br i1 %22, label %23, label %24
23: ; preds = %13
store i32 1, i32* %4
br label %29
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %9
28: ; preds = %9
store i32 0, i32* %4
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3, %12
%6 = phi i32 [ %15, %12 ], [ 0, %3 ]
%7 = phi i8* [ %13, %12 ], [ %1, %3 ]
%8 = phi i8* [ %14, %12 ], [ %0, %3 ]
%9 = load i8, i8* %8
%10 = load i8, i8* %7
%11 = icmp eq i8 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = add nuw nsw i32 %6, 1
%16 = icmp eq i32 %15, %2
br i1 %16, label %17, label %5
17: ; preds = %5, %12, %3
%18 = phi i32 [ 0, %3 ], [ 0, %12 ], [ 1, %5 ]
ret i32 %18
}
unsigned char setBit(unsigned char c, int i) {
  unsigned char mask = (unsigned char)(1 << i);
  return mask | c;
}


x86 assembly (clang, -O0):
<setBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit>:
mov    %edi,%eax
bts    %esi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @setBit(i8 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = or i8 %4, %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x24() {
  Assert_real((isascii(36)),
              "/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",
              185, ("isascii should be 1 for $"));
}


x86 assembly (clang, -O0):
<t_isascii_0x24>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xb9,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x24>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xb9,%edx
jmp    1030 <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 = [26 x i8] c"isascii should be 1 for $\00"
define void @t_isascii_0x24() {
%1 = call i32 @isascii(i32 36)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isascii should be 1 for $\00"
define void @t_isascii_0x24() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(unsigned char const *);
scalar_t__ strncmp(unsigned char const *, unsigned char *, int);
int cs_checPrefix(unsigned char *array, const unsigned char *prefix) {
  int aL, pL;
  aL = strlen(array);
  pL = strlen(prefix);
  if (aL > pL) {
    return (strncmp(prefix, array, pL) == 0);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<cs_checPrefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1178 <cs_checPrefix+0x58>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    117f <cs_checPrefix+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_checPrefix>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ebp
jle    1157 <cs_checPrefix+0x37>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @cs_checPrefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %1, i8* %0, i32 %4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
void dummy_aiDacrateChanged(int SystemType) {}


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

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

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

LLVM IR (-O2):
define void @dummy_aiDacrateChanged(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void pcap_free_datalinks(int *dlt_list) { free(dlt_list); }


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

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

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

LLVM IR (-O2):
define void @pcap_free_datalinks(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n");
  printf("   nullapp [options]:\n");
  printf("Options:\n");
  printf("   -title TITLE    specify window title\n");
  printf("   -help           show this information\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [23 x i8] c" nullapp [options]:\0A\00"
@.str.2 = [10 x i8] c"Options:\0A\00"
@.str.3 = [41 x i8] c" -title TITLE specify window title\0A\00"
@.str.4 = [42 x i8] c" -help show this information\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.5 = [22 x i8] c" nullapp [options]:\00"
@str.6 = [9 x i8] c"Options:\00"
@str.7 = [40 x i8] c" -title TITLE specify window title\00"
@str.8 = [41 x i8] c" -help show this information\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  long tv_usec;
  long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ srand48(long);
void init_rng(void) {
  struct timeval now;
  gettimeofday(&now, NULL);
  long int seedval = now.tv_usec + now.tv_sec;
  printf("Using seed %ld\n", seedval);
  srand48(seedval);
}


x86 assembly (clang, -O0):
<init_rng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <srand48@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_rng>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%rbx
add    (%rsp),%rbx
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <srand48@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [16 x i8] c"Using seed %ld\0A\00"
define void @init_rng() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i64, i64* %2
%12 = call i32 @srand48(i64 %11)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [16 x i8] c"Using seed %ld\0A\00"
define void @init_rng() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = tail call i32 @srand48(i64 %8)
ret void
}
/* Variables and functions */
int strcmp(void const *, void const *);
int fsname_cmp(const void *a, const void *b) { return strcmp(a, b); }


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

LLVM IR (-O0):
define i32 @fsname_cmp(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 @fsname_cmp(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 /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
void *r1(void *d) {
  while (1) {
    pause();
    printf("~~~~~~~~~~~~~~~\n");
  }
}


x86 assembly (clang, -O0):
<r1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pause@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <r1+0xc>

x86 assembly (clang, -O2):
<r1>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <pause@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1130 <r1+0x10>

LLVM IR (-O0):
@.str = [17 x i8] c"~~~~~~~~~~~~~~~\0A\00"
define i8* @r1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @pause()
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %3
}

LLVM IR (-O2):
@str = [16 x i8] c"~~~~~~~~~~~~~~~\00"
define noalias i8* @r1(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @pause()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %2
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int __keycmp(void *user_data, const void *a, const void *b) {
  return (memcmp(a, b, (10)));
}


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

x86 assembly (clang, -O2):
<__keycmp>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0xa,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @__keycmp(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @memcmp(i8* %1, i8* %2, i32 10)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ aeron_client_conductor_on_cmd_destination(void *, void *,
                                                             int);
void aeron_client_conductor_on_cmd_remove_destination(void *clientd,
                                                      void *item) {
  aeron_client_conductor_on_cmd_destination(clientd, item, (0x08));
}


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

x86 assembly (clang, -O2):
<aeron_client_conductor_on_cmd_remove_destination>:
mov    $0x8,%edx
jmp    1030 <aeron_client_conductor_on_cmd_destination@plt>

LLVM IR (-O0):
define void @aeron_client_conductor_on_cmd_remove_destination(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 @aeron_client_conductor_on_cmd_destination(i8* %5, i8* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @aeron_client_conductor_on_cmd_remove_destination(i8* %0, i8* %1) {
%3 = tail call i32 @aeron_client_conductor_on_cmd_destination(i8* %0, i8* %1, i32 8)
ret void
}
/* Variables and functions */
char *StringReadTos(char *, int, char *, int, char *);
char *StringSkipWhitespace(char *);
char *StringReadWord(char *in, int word_len, char *word) {
  in = StringSkipWhitespace(in);
  in = StringReadTos(in, 1, word, word_len, " \t\n\r");
  in = StringSkipWhitespace(in);
  return (in);
}


x86 assembly (clang, -O0):
<StringReadWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <StringSkipWhitespace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x1,%esi
lea    0xea9(%rip),%r8
call   1030 <StringReadTos@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <StringSkipWhitespace@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringReadWord>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1040 <StringSkipWhitespace@plt>
lea    0xecc(%rip),%r8
mov    %rax,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <StringReadTos@plt>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <StringSkipWhitespace@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @StringReadWord(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = call i8* @StringSkipWhitespace(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = load i8*, i8** %6
%11 = load i32, i32* %5
%12 = call i8* @StringReadTos(i8* %9, i32 1, i8* %10, i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i8* @StringSkipWhitespace(i8* %13)
store i8* %14, i8** %4
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A\0D\00"
define i8* @StringReadWord(i8* %0, i32 %1, i8* %2) {
%4 = tail call i8* @StringSkipWhitespace(i8* %0)
%5 = tail call i8* @StringReadTos(i8* %4, i32 1, i8* %2, i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i8* @StringSkipWhitespace(i8* %5)
ret i8* %6
}
/* Type definitions */
struct _tuple2 {
  int dummy;
};
struct Cyc_Sexp_Parser {
  int dummy;
};

/* Variables and functions */
struct _tuple2 *Cyc_Sexp_mk_ushort(unsigned short);
unsigned short Cyc_Sexp_parse_short(struct Cyc_Sexp_Parser *);
struct _tuple2 *Cyc_Sexp_parse_ushort(struct Cyc_Sexp_Parser *p) {
  unsigned short _T0;
  struct _tuple2 *_T1;
  _T0 = Cyc_Sexp_parse_short(p);
  _T1 = Cyc_Sexp_mk_ushort(_T0);
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_Sexp_parse_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Cyc_Sexp_parse_short@plt>
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%edi
call   1030 <Cyc_Sexp_mk_ushort@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Sexp_parse_ushort>:
push   %rax
call   1040 <Cyc_Sexp_parse_short@plt>
movzwl %ax,%edi
pop    %rax
jmp    1030 <Cyc_Sexp_mk_ushort@plt>

LLVM IR (-O0):
%struct._tuple2 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple2* @Cyc_Sexp_parse_ushort(%struct.Cyc_Sexp_Parser* %0) {
%2 = alloca %struct.Cyc_Sexp_Parser*
%3 = alloca i16
%4 = alloca %struct._tuple2*
store %struct.Cyc_Sexp_Parser* %0, %struct.Cyc_Sexp_Parser** %2
%5 = load %struct.Cyc_Sexp_Parser*, %struct.Cyc_Sexp_Parser** %2
%6 = call zeroext i16 @Cyc_Sexp_parse_short(%struct.Cyc_Sexp_Parser* %5)
store i16 %6, i16* %3
%7 = load i16, i16* %3
%8 = call %struct._tuple2* @Cyc_Sexp_mk_ushort(i16 zeroext %7)
store %struct._tuple2* %8, %struct._tuple2** %4
%9 = load %struct._tuple2*, %struct._tuple2** %4
ret %struct._tuple2* %9
}

LLVM IR (-O2):
%struct._tuple2 = type { i32 }
%struct.Cyc_Sexp_Parser = type { i32 }
define %struct._tuple2* @Cyc_Sexp_parse_ushort(%struct.Cyc_Sexp_Parser* %0) {
%2 = tail call zeroext i16 @Cyc_Sexp_parse_short(%struct.Cyc_Sexp_Parser* %0)
%3 = tail call %struct._tuple2* @Cyc_Sexp_mk_ushort(i16 zeroext %2)
ret %struct._tuple2* %3
}
void rop3_232_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ T;
  stk3 = *D ^ S;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_232_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_232_0_0>:
xor    %esi,%edx
mov    (%rdi),%al
xor    %sil,%al
and    %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_232_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = load i8, i8* %5
%20 = zext i8 %19 to i32
%21 = xor i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %9
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = load i8, i8* %9
%26 = zext i8 %25 to i32
%27 = and i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %8
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = load i8, i8* %8
%32 = zext i8 %31 to i32
%33 = xor i32 %30, %32
%34 = trunc i32 %33 to i8
store i8 %34, i8* %7
%35 = load i8, i8* %7
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_232_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = and i8 %6, %4
%8 = xor i8 %7, %1
store i8 %8, i8* %0
ret void
}
unsigned char xtoupper(unsigned char c) {
  if (!((c >= 'a') && (c <= 'z')))
    return c;
  return ~(1 << 5) & c;
}


x86 assembly (clang, -O0):
<xtoupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <xtoupper+0x24>
movzbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jle    112f <xtoupper+0x2f>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    113b <xtoupper+0x3b>
movzbl -0x2(%rbp),%eax
and    $0xffffffdf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtoupper>:
lea    -0x61(%rdi),%eax
mov    %edi,%ecx
and    $0xdf,%cl
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @xtoupper(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %13, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
store i8 %12, i8* %2
br label %18
13: ; preds = %7
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = and i32 -33, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %13, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define zeroext i8 @xtoupper(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = and i8 %0, -33
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
scalar_t__ cc_up_is_valid_system_return(int /*<<< orphan*/, char *);
int /*<<< orphan*/ system(char *);
int cc_ssid_init_table() {
  pid_t status;
  int i = 0;
  while (1) {
    status = system("/etc/init.d/ssidmonitor start");
    if (cc_up_is_valid_system_return(status, "/etc/init.d/ssidmonitor start") <
        0) {
      i++;
      if (i >= 3)
        break;
    }
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cc_ssid_init_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xeb8(%rip),%rsi
call   1030 <cc_up_is_valid_system_return@plt>
cmp    $0x0,%rax
jge    1174 <cc_ssid_init_table+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     116f <cc_ssid_init_table+0x4f>
jmp    1179 <cc_ssid_init_table+0x59>
jmp    1174 <cc_ssid_init_table+0x54>
jmp    1179 <cc_ssid_init_table+0x59>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_ssid_init_table>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <system@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <cc_up_is_valid_system_return@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"/etc/init.d/ssidmonitor start\00"
define i32 @cc_ssid_init_table() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %0
%4 = call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i64 @cc_up_is_valid_system_return(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 3
br i1 %12, label %13, label %14
13: ; preds = %8
br label %16
14: ; preds = %8
br label %15
15: ; preds = %14, %3
br label %16
16: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"/etc/init.d/ssidmonitor start\00"
define i32 @cc_ssid_init_table() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @cc_up_is_valid_system_return(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int check_any(const void *value, void *check_value_data) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @check_any(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
void rop3_46_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_46_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_46_0_0>:
mov    (%rdi),%al
xor    %dl,%al
or     %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_46_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
foo() {
  static int funclocal = 3;
  static int funclocal_bss;
  static const int funclocal_ro = 203;
  static const int funclocal_ro_bss;
  funclocal_bss = 103;
  bar();
}


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

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

LLVM IR (-O0):
@foo.funclocal = internal global i32 3
@foo.funclocal_bss = internal global i32 0
@foo.funclocal_ro = internal constant i32 203
@foo.funclocal_ro_bss = internal constant i32 0
define i32 @foo() {
%1 = alloca i32
store i32 103, i32* @foo.funclocal_bss
%2 = call i32 (...) @bar()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 undef
}
/* Variables and functions */
long long btest_ll(long long *, long long *);
long long intr_wrap_505(long long p1, long long p2) {
  return btest_ll(&p1, &p2);
}


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

x86 assembly (clang, -O2):
<intr_wrap_505>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <btest_ll@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @intr_wrap_505(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @btest_ll(i64* %3, i64* %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intr_wrap_505(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 @btest_ll(i64* %3, i64* %4)
ret i64 %5
}
/* Variables and functions */
double sqrt(int);
double compute_std_error(double std_dev, int count) {
  return std_dev / sqrt(count);
}


x86 assembly (clang, -O0):
<compute_std_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_std_error>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @compute_std_error(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call double @sqrt(i32 %6)
%8 = fdiv double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @compute_std_error(double %0, i32 %1) {
%3 = tail call double @sqrt(i32 %1)
%4 = fdiv double %0, %3
ret double %4
}
void f(void) {
  __asm__ __volatile__("" : : : "memory");
l:
  __asm__ __volatile__("" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @f() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
__attribute__((always_)) unsigned int cpuid_eax(unsigned int op) {
  unsigned int eax;
  __asm__("cpuid" : "=a"(eax) : "0"(op) : "bx", "cx", "dx");
  return eax;
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
push   %rbx
mov    %edi,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "cpuid", "={ax},0,~{bx},~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = tail call i32 asm "cpuid", "={ax},0,~{bx},~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
void INT_Excep_DMACA_DMAC2I(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_DMACA_DMAC2I() {
ret void
}
ISR(INT4_vect) {
  DEBUG("ISR "
        "INT4"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ISR INT4 occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [17 x i8] c"ISR INT4 occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}