xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void print_hex(unsigned char *ptr, int n_len) {
  int n_loop = 0;
  if (n_len > 0) {
    for (n_loop = 0; n_loop < n_len; n_loop++) {
      printf("%2x\t", *(ptr + n_loop));
    }
  }
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    116e <print_hex+0x5e>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <print_hex+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xeae(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <print_hex+0x27>
jmp    116e <print_hex+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print_hex+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_hex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%2x\09\00"
define void @print_hex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %24
8: ; preds = %2
store i32 0, i32* %5
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %9
23: ; preds = %9
br label %24
24: ; preds = %23, %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2x\09\00"
define void @print_hex(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xd8() {
  Assert_real((isalnum(216) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              1085, ("isalnum should be 0 for 0xd8"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd8\00"
define void @t_isalnum_0xd8() {
%1 = call i64 @isalnum(i32 216)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xd8\00"
define void @t_isalnum_0xd8() {
%1 = tail call i64 @isalnum(i32 216)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long not(long i) { return !i; }


x86 assembly (clang, -O0):
<not>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<not>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i64 @not(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @not(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i64
ret i64 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printFifths(char *, char *);
int main(int argc, char **argv) {
  char *v1 = (char *)malloc(5);
  char *v2 = (char *)malloc(5);
  printFifths(v1, v2);
  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    $0x5,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x5,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <printFifths@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    $0x5,%edi
call   1030 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printFifths@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 5)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = call i64 @malloc(i32 5)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = call i32 @printFifths(i8* %12, i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 5)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i64 @malloc(i32 5)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @printFifths(i8* %4, i8* %6)
ret i32 0
}
int is_whitespace(const char c) {
  return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     114d <is_whitespace+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
cmp    $0x20,%dil
ja     1120 <is_whitespace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    1120 <is_whitespace+0x20>
ret
xor    %eax,%eax
cmp    $0xd,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 13
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
void bogus_nmi(void) {
  serial_puts("Bogus NMI exception, spinning ... \n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<bogus_nmi>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    1120 <bogus_nmi+0x10>

x86 assembly (clang, -O2):
<bogus_nmi>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <serial_puts@plt>
nopl   (%rax)
jmp    1120 <bogus_nmi+0x10>

LLVM IR (-O0):
@.str = [36 x i8] c"Bogus NMI exception, spinning ... \0A\00"
define void @bogus_nmi() {
%1 = call i32 @serial_puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [36 x i8] c"Bogus NMI exception, spinning ... \0A\00"
define void @bogus_nmi() {
%1 = tail call i32 @serial_puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  printf("'%5d'\n", 1);
  printf("'%*d'\n", 5, 2);
  printf("'%-5d'\n", 3);
  printf("'%*d'\n", -5, 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
mov    $0xfffffffb,%esi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffb,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"'%5d'\0A\00"
@.str.1 = [7 x i8] c"'%*d'\0A\00"
@.str.2 = [8 x i8] c"'%-5d'\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 2)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 3)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 -5, i32 4)
ret i32 0
}
void upse_ps1_executive_bootstrap(void) {}


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

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

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

LLVM IR (-O2):
define void @upse_ps1_executive_bootstrap() {
ret void
}
/* Variables and functions */
unsigned int REG_SPI_BASE(unsigned int);
__attribute__((always_)) __attribute__((flatten)) unsigned int
SPI_PIN(unsigned int i) {
  return (REG_SPI_BASE(i) + 0x2c);
}


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

x86 assembly (clang, -O2):
<SPI_PIN>:
push   %rax
call   1030 <REG_SPI_BASE@plt>
add    $0x2c,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SPI_PIN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @REG_SPI_BASE(i32 %3)
%5 = add i32 %4, 44
ret i32 %5
}

LLVM IR (-O2):
define i32 @SPI_PIN(i32 %0) {
%2 = tail call i32 @REG_SPI_BASE(i32 %0)
%3 = add i32 %2, 44
ret i32 %3
}
void g_list_index() {}


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

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

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

LLVM IR (-O2):
define void @g_list_index() {
ret void
}
void AddRoundKey(unsigned *state, unsigned *key) {
  int idx;
  for (idx = 0; idx < 4; idx++)
    state[idx] ^= key[idx];
}


x86 assembly (clang, -O0):
<AddRoundKey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1144 <AddRoundKey+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <AddRoundKey+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddRoundKey>:
mov    (%rsi),%eax
xor    %eax,(%rdi)
mov    0x4(%rsi),%eax
xor    %eax,0x4(%rdi)
mov    0x8(%rsi),%eax
xor    %eax,0x8(%rdi)
mov    0xc(%rsi),%eax
xor    %eax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @AddRoundKey(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = xor i32 %9, %7
store i32 %10, i32* %8
%11 = getelementptr inbounds i32, i32* %1, i64 2
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = xor i32 %14, %12
store i32 %15, i32* %13
%16 = getelementptr inbounds i32, i32* %1, i64 3
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %0, i64 3
%19 = load i32, i32* %18
%20 = xor i32 %19, %17
store i32 %20, i32* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("It worked 10 times\n");
  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 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [20 x i8] c"It worked 10 times\0A\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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.2 = [19 x i8] c"It worked 10 times\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 ([19 x i8], [19 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void my_free(void *data, void *hint) { free(data); }


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

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

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

LLVM IR (-O2):
define void @my_free(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf(" This is a good start for C programing\n");
  printf(" We are hosting the code in the github server for our reference\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c" This is a good start for C programing\0A\00"
@.str.1 = [65 x i8] c" We are hosting the code in the github server for our reference\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c" This is a good start for C programing\00"
@str.2 = [64 x i8] c" We are hosting the code in the github server for our reference\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void copy_position(float des[3], float src[3]) {
  des[0] = src[0];
  des[1] = src[1];
  des[2] = src[2];
}


x86 assembly (clang, -O0):
<copy_position>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @copy_position(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %3
%9 = getelementptr inbounds float, float* %8, i64 0
store float %7, float* %9
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = load float*, float** %3
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %4
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = load float*, float** %3
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
ret void
}

LLVM IR (-O2):
define void @copy_position(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
store float %3, float* %0
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %0, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %1, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 2
store float %8, float* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_eor();
int /*<<< orphan*/ e_zp();
void e_eor_zp() {
  e_zp();
  e_eor();
}


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

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

LLVM IR (-O0):
define void @e_eor_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_eor()
ret void
}

LLVM IR (-O2):
define void @e_eor_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_eor()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void REV(int number) {
  do {
    printf("%d", number % 10);
    number = number / 10;
  } while (number != 0);
  printf("\n");
}


x86 assembly (clang, -O0):
<REV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <REV+0xb>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<REV>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
movslq %ebx,%r15
imul   $0x66666667,%r15,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %r15d,%esi
sub    %eax,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x9,%r15d
cmp    $0x12,%r15d
ja     1130 <REV+0x10>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @REV(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = srem i32 %3, 10
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = sdiv i32 %3, 10
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char);
int /*<<< orphan*/ stdout;
void print_hex(unsigned char *buffer, size_t s) {
  size_t i = 0;
  for (; i < s; ++i)
    fprintf(stdout, "0x%02x,", buffer[i]);
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <print_hex+0x58>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
lea    0xeb2(%rip),%rsi
movzbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_hex+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rsi,%rsi
je     115a <print_hex+0x4a>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
mov    0x2eb3(%rip),%r13
lea    0xecc(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%r13),%edi
movzbl (%r14,%rbx,1),%edx
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_hex+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"0x%02x,\00"
define void @print_hex(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* @stdout
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
br label %17
17: ; preds = %10
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"0x%02x,\00"
define void @print_hex(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = load i32, i32* @stdout
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
char *searchpath3(char const *, char *, char *);
char *searchpath(const char *name) { return searchpath3(name, "", ""); }


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

x86 assembly (clang, -O2):
<searchpath>:
lea    0xee9(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <searchpath3@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @searchpath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @searchpath3(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @searchpath(i8* %0) {
%2 = tail call i8* @searchpath3(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
indreg0imm1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*p0) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0imm1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0xed8(%rip),%xmm0
ucomisd (%rax),%xmm0
jb     113e <indreg0imm1+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <indreg0imm1+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0imm1>:
movsd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @indreg0imm1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load double, double* %14
%16 = fcmp ole double %15, 3.300000e+01
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @indreg0imm1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = load double, double* %4
%8 = fcmp ole double %7, 3.300000e+01
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int procnetdev_version(char *buf) {
  if (strstr(buf, "compressed"))
    return 2;
  if (strstr(buf, "bytes"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<procnetdev_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <procnetdev_version+0x32>
movl   $0x2,-0x4(%rbp)
jmp    116f <procnetdev_version+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1168 <procnetdev_version+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <procnetdev_version+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procnetdev_version>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    $0x2,%eax
test   %rcx,%rcx
je     112f <procnetdev_version+0x1f>
pop    %rbx
ret
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"compressed\00"
@.str.1 = [6 x i8] c"bytes\00"
define i32 @procnetdev_version(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 2, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strstr(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"compressed\00"
@.str.1 = [6 x i8] c"bytes\00"
define i32 @procnetdev_version(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 2, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ find_str_pc_offset();
int /*<<< orphan*/ test_load_write_pc_interworking();
void arm_uprobe_decode_init(void) {
  find_str_pc_offset();
  test_load_write_pc_interworking();
  ;
}


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

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

LLVM IR (-O0):
define void @arm_uprobe_decode_init() {
%1 = call i32 (...) @find_str_pc_offset()
%2 = call i32 (...) @test_load_write_pc_interworking()
ret void
}

LLVM IR (-O2):
define void @arm_uprobe_decode_init() {
%1 = tail call i32 (...) @find_str_pc_offset()
%2 = tail call i32 (...) @test_load_write_pc_interworking()
ret void
}
void coreClean(struct LSD_ScenePlugin const *plugin) {}


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

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

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

LLVM IR (-O2):
%struct.LSD_ScenePlugin = type opaque
define void @coreClean(%struct.LSD_ScenePlugin* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCMclosed_BM_occurrence_deliver(int, int);
int /*<<< orphan*/ LCMclosed_BM_occurrence_deliver_iter_delete(int, int);
void LCMclosed_BM_occurrence_deliver_(int item, int mask) {
  LCMclosed_BM_occurrence_deliver_iter_delete(item, mask);
  LCMclosed_BM_occurrence_deliver(item - 1, mask);
}


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

x86 assembly (clang, -O2):
<LCMclosed_BM_occurrence_deliver_>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <LCMclosed_BM_occurrence_deliver_iter_delete@plt>
add    $0xffffffff,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <LCMclosed_BM_occurrence_deliver@plt>

LLVM IR (-O0):
define void @LCMclosed_BM_occurrence_deliver_(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @LCMclosed_BM_occurrence_deliver_iter_delete(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = call i32 @LCMclosed_BM_occurrence_deliver(i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @LCMclosed_BM_occurrence_deliver_(i32 %0, i32 %1) {
%3 = tail call i32 @LCMclosed_BM_occurrence_deliver_iter_delete(i32 %0, i32 %1)
%4 = add nsw i32 %0, -1
%5 = tail call i32 @LCMclosed_BM_occurrence_deliver(i32 %4, i32 %1)
ret void
}
/* Variables and functions */
void *malloc(unsigned int);
void *kmalloc_array(unsigned int n, unsigned int size, unsigned int flags) {
  return malloc(n * size);
}


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

x86 assembly (clang, -O2):
<kmalloc_array>:
imul   %esi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @kmalloc_array(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, %0
%5 = tail call i8* @malloc(i32 %4)
ret i8* %5
}
void consolemanager_init() {}


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

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

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

LLVM IR (-O2):
define void @consolemanager_init() {
ret void
}
/* Variables and functions */
int test(int);
int main() { return test(3); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x3,%edi
jmp    1030 <test@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ dsm_close(int);
void mympi_close(int handle) { dsm_close(handle); }


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

x86 assembly (clang, -O2):
<mympi_close>:
jmp    1030 <dsm_close@plt>

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

LLVM IR (-O2):
define void @mympi_close(i32 %0) {
%2 = tail call i32 @dsm_close(i32 %0)
ret void
}
void avformat_new_stream() {}


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

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

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

LLVM IR (-O2):
define void @avformat_new_stream() {
ret void
}
/* Type definitions */
typedef size_t uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void stack_set(int8_t *stack, uint8_t offset, int8_t v) { stack[offset] = v; }


x86 assembly (clang, -O0):
<stack_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_set>:
mov    %edx,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @stack_set(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i32, i32* %8, i64 %9
store i32 %7, i32* %10
ret void
}

LLVM IR (-O2):
define void @stack_set(i32* nocapture writeonly %0, i64 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
store i32 %2, i32* %4
ret void
}
__attribute__((always_)) int pci_enable_sriov(struct pci_dev *dev,
                                              int nr_virtfn) {
  return -19;
}


x86 assembly (clang, -O0):
<pci_enable_sriov>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffed,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_enable_sriov(%struct.pci_dev* %0, i32 %1) {
%3 = alloca %struct.pci_dev*
%4 = alloca i32
store %struct.pci_dev* %0, %struct.pci_dev** %3
store i32 %1, i32* %4
ret i32 -19
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_enable_sriov(%struct.pci_dev* nocapture readnone %0, i32 %1) {
ret i32 -19
}
/* Variables and functions */
int /*<<< orphan*/ print_seq(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%d", &x);
  print_seq(x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <print_seq@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @print_seq(i32 %4)
ret i32 0
}
void *callee0(void *payload) { return payload; }


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

x86 assembly (clang, -O2):
<callee0>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @callee0(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, int, int);
int shim_tgkill(int tgid, int tid, int sig) {
  return (int)shim_enosys(0, tgid, tid, sig);
}


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

x86 assembly (clang, -O2):
<shim_tgkill>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_tgkill(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @shim_enosys(i32 0, i32 %7, i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @shim_tgkill(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HuiMaQiang_bind();
int /*<<< orphan*/ KangLongQiangFa_bind();
int /*<<< orphan*/ KuangNuQiangFa_bind();
int /*<<< orphan*/ LongJuanQiangFa_bind();
int /*<<< orphan*/ NuJiaoQiangFa_bind();
int /*<<< orphan*/ PoFengQiangFa_bind();
int /*<<< orphan*/ YingJiChangKong_bind();
void FQ_Ability_init() {
  HuiMaQiang_bind();
  KangLongQiangFa_bind();
  KuangNuQiangFa_bind();
  LongJuanQiangFa_bind();
  NuJiaoQiangFa_bind();
  PoFengQiangFa_bind();
  YingJiChangKong_bind();
}


x86 assembly (clang, -O0):
<FQ_Ability_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <HuiMaQiang_bind@plt>
mov    $0x0,%al
call   1040 <KangLongQiangFa_bind@plt>
mov    $0x0,%al
call   1070 <KuangNuQiangFa_bind@plt>
mov    $0x0,%al
call   1090 <LongJuanQiangFa_bind@plt>
mov    $0x0,%al
call   1080 <NuJiaoQiangFa_bind@plt>
mov    $0x0,%al
call   1030 <PoFengQiangFa_bind@plt>
mov    $0x0,%al
call   1060 <YingJiChangKong_bind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FQ_Ability_init>:
push   %rax
xor    %eax,%eax
call   1050 <HuiMaQiang_bind@plt>
xor    %eax,%eax
call   1040 <KangLongQiangFa_bind@plt>
xor    %eax,%eax
call   1070 <KuangNuQiangFa_bind@plt>
xor    %eax,%eax
call   1090 <LongJuanQiangFa_bind@plt>
xor    %eax,%eax
call   1080 <NuJiaoQiangFa_bind@plt>
xor    %eax,%eax
call   1030 <PoFengQiangFa_bind@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <YingJiChangKong_bind@plt>

LLVM IR (-O0):
define void @FQ_Ability_init() {
%1 = call i32 (...) @HuiMaQiang_bind()
%2 = call i32 (...) @KangLongQiangFa_bind()
%3 = call i32 (...) @KuangNuQiangFa_bind()
%4 = call i32 (...) @LongJuanQiangFa_bind()
%5 = call i32 (...) @NuJiaoQiangFa_bind()
%6 = call i32 (...) @PoFengQiangFa_bind()
%7 = call i32 (...) @YingJiChangKong_bind()
ret void
}

LLVM IR (-O2):
define void @FQ_Ability_init() {
%1 = tail call i32 (...) @HuiMaQiang_bind()
%2 = tail call i32 (...) @KangLongQiangFa_bind()
%3 = tail call i32 (...) @KuangNuQiangFa_bind()
%4 = tail call i32 (...) @LongJuanQiangFa_bind()
%5 = tail call i32 (...) @NuJiaoQiangFa_bind()
%6 = tail call i32 (...) @PoFengQiangFa_bind()
%7 = tail call i32 (...) @YingJiChangKong_bind()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(void *);
void plat_kthread_exit(void *ret) { pthread_exit(ret); }


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

x86 assembly (clang, -O2):
<plat_kthread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @plat_kthread_exit(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_sprintf(char *, char *, double);
int format_test(unsigned count, char *fmt, double val) {
  static char buf[(1024)];
  unsigned int i;
  for (i = 0; i < count; i++)
    test_sprintf(buf, fmt, val);
  return 0;
}


x86 assembly (clang, -O0):
<format_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    115a <format_test+0x4a>
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
lea    0x2ef9(%rip),%rdi
call   1030 <test_sprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <format_test+0x1b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_test>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
je     1146 <format_test+0x36>
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x2f18(%rip),%r14
movsd  %xmm0,0x8(%rsp)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
movsd  0x8(%rsp),%xmm0
call   1030 <test_sprintf@plt>
add    $0xffffffff,%ebp
jne    1130 <format_test+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@format_test.buf = internal global [1024 x i8] zeroinitializer
define i32 @format_test(i32 %0, i8* %1, double %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store double %2, double* %6
store i32 0, i32* %7
br label %8
8: ; preds = %16, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load double, double* %6
%15 = call i32 @test_sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @format_test.buf, i64 0, i64 0), i8* %13, double %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add i32 %17, 1
store i32 %18, i32* %7
br label %8
19: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@format_test.buf = internal global [1024 x i8] zeroinitializer
define i32 @format_test(i32 %0, i8* %1, double %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %10, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i32 @test_sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @format_test.buf, i64 0, i64 0), i8* %1, double %2)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret i32 0
}