xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ system(char *);
void insert_database_remove_tmp_file(char *tmp_file_name) {
  char buffer[512];
  sprintf(buffer, "/bin/rm -f %s", tmp_file_name);
  if (system(buffer)) {
  };
}


x86 assembly (clang, -O0):
<insert_database_remove_tmp_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1161 <insert_database_remove_tmp_file+0x41>
jmp    1161 <insert_database_remove_tmp_file+0x41>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_database_remove_tmp_file>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/bin/rm -f %s\00"
define void @insert_database_remove_tmp_file(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i64 @system(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"/bin/rm -f %s\00"
define void @insert_database_remove_tmp_file(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i64 @system(i8* %3)
ret void
}
void UARTRXCTSDSRWakeUpConfigure(unsigned int baseAdd,
                                 unsigned int wakeUpFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x40)))) &= ~((0x00000010u));
  (*((volatile unsigned int *)(baseAdd + (0x40)))) |=
      (wakeUpFlag & (0x00000010u));
}


x86 assembly (clang, -O0):
<UARTRXCTSDSRWakeUpConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x10,%edx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRXCTSDSRWakeUpConfigure>:
add    $0x40,%edi
andl   $0xffffffef,(%rdi)
and    $0x10,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTRXCTSDSRWakeUpConfigure(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 = add i32 %5, 64
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -17
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 16
%13 = load i32, i32* %3
%14 = add i32 %13, 64
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTRXCTSDSRWakeUpConfigure(i32 %0, i32 %1) {
%3 = add i32 %0, 64
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -17
store volatile i32 %7, i32* %5
%8 = and i32 %1, 16
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
void XFetchBuffer() {}


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

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

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

LLVM IR (-O2):
define void @XFetchBuffer() {
ret void
}
int x15_teardown() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @x15_teardown() {
ret i32 0
}
only_2_bars_exists(char *instring) {
  int num_bars = 0;
  while (*instring++)
    if (*instring == '|')
      num_bars++;
  return (num_bars == 2);
}


x86 assembly (clang, -O0):
<only_2_bars_exists>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1145 <only_2_bars_exists+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7c,%eax
jne    1140 <only_2_bars_exists+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <only_2_bars_exists+0xf>
cmpl   $0x2,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<only_2_bars_exists>:
cmpb   $0x0,(%rdi)
je     112d <only_2_bars_exists+0x2d>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%eax
xor    %edx,%edx
cmp    $0x7c,%al
sete   %dl
add    %edx,%ecx
add    $0x1,%rdi
test   %al,%al
jne    1110 <only_2_bars_exists+0x10>
xor    %eax,%eax
cmp    $0x2,%ecx
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @only_2_bars_exists(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 124
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %6, %10
%12 = icmp eq i8 %8, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = icmp eq i32 %11, 2
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 0, %1 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void put_string(const char *str) {
  while (*str)
    putchar(*str++);
}


x86 assembly (clang, -O0):
<put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <put_string+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <put_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <put_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <put_string+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @put_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @putchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @put_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void RTTestISubDone(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ remove_virtual_pci_bus();
int /*<<< orphan*/ unregister_pci_device(struct dfv_pci_info *);
int /*<<< orphan*/ unregister_pci_driver();
void unregister_from_dfv_pci(struct dfv_pci_info *pci_info) {
  unregister_pci_device(pci_info);
  unregister_pci_driver();
  remove_virtual_pci_bus();
}


x86 assembly (clang, -O0):
<unregister_from_dfv_pci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <unregister_pci_device@plt>
mov    $0x0,%al
call   1040 <unregister_pci_driver@plt>
mov    $0x0,%al
call   1030 <remove_virtual_pci_bus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unregister_from_dfv_pci>:
push   %rax
call   1050 <unregister_pci_device@plt>
xor    %eax,%eax
call   1040 <unregister_pci_driver@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <remove_virtual_pci_bus@plt>

LLVM IR (-O0):
%struct.dfv_pci_info = type { i32 }
define void @unregister_from_dfv_pci(%struct.dfv_pci_info* %0) {
%2 = alloca %struct.dfv_pci_info*
store %struct.dfv_pci_info* %0, %struct.dfv_pci_info** %2
%3 = load %struct.dfv_pci_info*, %struct.dfv_pci_info** %2
%4 = call i32 @unregister_pci_device(%struct.dfv_pci_info* %3)
%5 = call i32 (...) @unregister_pci_driver()
%6 = call i32 (...) @remove_virtual_pci_bus()
ret void
}

LLVM IR (-O2):
%struct.dfv_pci_info = type { i32 }
define void @unregister_from_dfv_pci(%struct.dfv_pci_info* %0) {
%2 = tail call i32 @unregister_pci_device(%struct.dfv_pci_info* %0)
%3 = tail call i32 (...) @unregister_pci_driver()
%4 = tail call i32 (...) @remove_virtual_pci_bus()
ret void
}
int wrapc_signbitf(float r) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wrapc_signbitf(float %0) {
ret i32 0
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ cpsv_test_sync_app_process(void *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  unsigned int temp_var;
  if (argc != 2) {
    printf("\nWrong Arguments USAGE: <ckpt_demo><1(Writer)/0(Reader)>\n");
    return -1;
  }
  temp_var = atoi(argv[1]);
  cpsv_test_sync_app_process((void *)(long)temp_var);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <main+0x59>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%edi
call   1030 <cpsv_test_sync_app_process@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    114a <main+0x1a>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <cpsv_test_sync_app_process@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"\0AWrong Arguments USAGE: <ckpt_demo><1(Writer)/0(Reader)>\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 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %20
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = call i32 @cpsv_test_sync_app_process(i8* %18)
store i32 0, i32* %3
br label %20
20: ; preds = %11, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@str = [57 x i8] c"\0AWrong Arguments USAGE: <ckpt_demo><1(Writer)/0(Reader)>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
br label %13
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @cpsv_test_sync_app_process(i8* %11)
br label %13
13: ; preds = %6, %4
%14 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ reset_palette(int /*<<< orphan*/);
int main() {
  reset_palette(0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <reset_palette@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <reset_palette@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @reset_palette(i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
void indent_setup(char *pre_indent, char *post_indent, unsigned int level) {
  memset(pre_indent, ' ', (2 * 2));
  memset(post_indent, ' ', (2 * 2));
  pre_indent[level * 2] = '\0';
  post_indent[(2 - level) * 2] = '\0';
}


x86 assembly (clang, -O0):
<indent_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
sub    -0x14(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent_setup>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x4,%r12d
mov    $0x20,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    %r14,%rdi
mov    $0x20,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
add    %ebx,%ebx
movb   $0x0,(%r15,%rbx,1)
sub    %ebx,%r12d
movb   $0x0,(%r14,%r12,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @indent_setup(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @memset(i8* %7, i8 signext 32, i32 4)
%9 = load i8*, i8** %5
%10 = call i32 @memset(i8* %9, i8 signext 32, i32 4)
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = mul i32 %12, 2
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = sub i32 2, %17
%19 = mul i32 %18, 2
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %16, i64 %20
store i8 0, i8* %21
ret void
}

LLVM IR (-O2):
define void @indent_setup(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i8 signext 32, i32 4)
%5 = tail call i32 @memset(i8* %1, i8 signext 32, i32 4)
%6 = shl i32 %2, 1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
%9 = mul i32 %2, -2
%10 = add i32 %9, 4
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %1, i64 %11
store i8 0, i8* %12
ret void
}
/* Variables and functions */
int Rand(unsigned int *);
unsigned int RandInt(int min, int max, unsigned int *state) {
  return (Rand(state) % (max - min + 1) + min);
}


x86 assembly (clang, -O0):
<RandInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <Rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <Rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RandInt(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** %6
%8 = call i32 @Rand(i32* %7)
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = add nsw i32 %11, 1
%13 = srem i32 %8, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @RandInt(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @Rand(i32* %2)
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = srem i32 %4, %6
%8 = add nsw i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex16array(char *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 16));
}


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

x86 assembly (clang, -O2):
<pushcomplex16array>:
shl    $0x4,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex16array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushcomplex16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
unsigned long smp_lock_cache(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @smp_lock_cache() {
ret i64 0
}

LLVM IR (-O2):
define i64 @smp_lock_cache() {
ret i64 0
}
/* Variables and functions */
int plus(int, int);
int __test() { return 2 * 3 + plus(2, 3); }


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <plus@plt>
add    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <plus@plt>
add    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__test() {
%1 = call i32 @plus(i32 2, i32 3)
%2 = add nsw i32 6, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @__test() {
%1 = tail call i32 @plus(i32 2, i32 3)
%2 = add nsw i32 %1, 6
ret i32 %2
}
unsigned char getbyte(code, i)
unsigned long code;
int i;
{
  unsigned long byteL;
  unsigned char byte;
  byteL = code >> (8 * (3 - i));
  byte = (unsigned char)(0x000000ff & byteL);
  return (byte);
}


x86 assembly (clang, -O0):
<getbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
sub    -0xc(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbyte>:
mov    %rdi,%rax
shl    $0x3,%sil
mov    $0x18,%cl
sub    %sil,%cl
shr    %cl,%rax
ret

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

LLVM IR (-O2):
define zeroext i8 @getbyte(i64 %0, i32 %1) {
%3 = mul i32 %1, -8
%4 = add i32 %3, 24
%5 = zext i32 %4 to i64
%6 = lshr i64 %0, %5
%7 = trunc i64 %6 to i8
ret i8 %7
}
int difference(int x, int y) { return x > y ? x - y : y - x; }


x86 assembly (clang, -O0):
<difference>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <difference+0x24>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <difference+0x2d>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<difference>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @difference(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
br label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
br label %16
16: ; preds = %12, %8
%17 = phi i32 [ %11, %8 ], [ %15, %12 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @difference(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = sub nsw i32 %1, %0
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  long int a = 2;
  while (1) {
    printf("%ld, ", a++);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
jmp    1127 <main+0x17>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [6 x i8] c"%ld, \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 2, i64* %2
br label %3
3: ; preds = %0, %3
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
store i64 %5, i64* %2
%6 = trunc i64 %4 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"%ld, \00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 2, %0 ], [ %3, %1 ]
%3 = add nuw nsw i64 %2, 1
%4 = trunc i64 %2 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseeko64(int /*<<< orphan*/ *, long, int);
int fseek(FILE *f, long offset, int whence) {
  return fseeko64(f, offset, whence);
}


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

x86 assembly (clang, -O2):
<fseek>:
jmp    1030 <fseeko64@plt>

LLVM IR (-O0):
define i32 @fseek(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** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @fseeko64(i32* %7, i64 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fseek(i32* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @fseeko64(i32* %0, i64 %1, i32 %2)
ret i32 %4
}
int test_imm_76uint16_mem(unsigned short *val) {
  return ((*val) & (0x76 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_76uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x76,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_76uint16_mem>:
testb  $0x76,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_76uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 118
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct sched_param {
  int dummy;
};
struct TYPE_3__ {
  struct sched_param __sp;
};
typedef TYPE_1__ posix_spawnattr_t;

/* Variables and functions */
int posix_spawnattr_setschedparam(posix_spawnattr_t *attr,
                                  const struct sched_param *schedparam) {
  attr->__sp = *schedparam;
  return 0;
}


x86 assembly (clang, -O0):
<posix_spawnattr_setschedparam>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnattr_setschedparam>:
mov    (%rsi),%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { %struct.sched_param }
%struct.sched_param = type { i32 }
define i32 @posix_spawnattr_setschedparam(%struct.TYPE_3__* %0, %struct.sched_param* %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca %struct.sched_param*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store %struct.sched_param* %1, %struct.sched_param** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load %struct.sched_param*, %struct.sched_param** %4
%8 = bitcast %struct.sched_param* %6 to i8*
%9 = bitcast %struct.sched_param* %7 to i8*
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { %struct.sched_param }
%struct.sched_param = type { i32 }
define i32 @posix_spawnattr_setschedparam(%struct.TYPE_3__* nocapture writeonly %0, %struct.sched_param* nocapture %1) {
%3 = getelementptr %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
%4 = getelementptr %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0, i32 0
%5 = load i32, i32* %3
store i32 %5, i32* %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int stub1();
main() {
  static int i = 1;
  i++;
  printf(" hello \n");
  if (i < 5)
    (*main)();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2efb(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef2(%rip)
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x5,0x2edf(%rip)
jge    115c <main+0x3c>
call   1040 <main@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
addl   $0x1,0x2f10(%rip)
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    0x2efe(%rip),%eax
cmp    $0x4,%eax
jg     115c <main+0x4c>
lea    0xeca(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %eax,0x2edf(%rip)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x2ed1(%rip),%eax
cmp    $0x5,%eax
jl     1140 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@main.i = internal global i32 1
@.str = [9 x i8] c" hello \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @main.i
%3 = add nsw i32 %2, 1
store i32 %3, i32* @main.i
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @main.i
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @main()
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@main.i = internal unnamed_addr global i32 1
@str = [8 x i8] c" hello \00"
define i32 @main() {
%1 = load i32, i32* @main.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @main.i
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @main.i
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = add nsw i32 %7, 1
store i32 %8, i32* @main.i
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%10 = load i32, i32* @main.i
%11 = icmp slt i32 %10, 5
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int vstrncmp(const char *s1, const char *s2, int n) {
  if (!s1 && !s2)
    return 0;
  else if (!s1 || !s2)
    return 1;
  else
    return strncmp(s1, s2, n);
}


x86 assembly (clang, -O0):
<vstrncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <vstrncmp+0x35>
cmpq   $0x0,-0x18(%rbp)
jne    1145 <vstrncmp+0x35>
movl   $0x0,-0x4(%rbp)
jmp    117a <vstrncmp+0x6a>
cmpq   $0x0,-0x10(%rbp)
je     115b <vstrncmp+0x4b>
cmpq   $0x0,-0x18(%rbp)
jne    1167 <vstrncmp+0x57>
movl   $0x1,-0x4(%rbp)
jmp    117a <vstrncmp+0x6a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vstrncmp>:
xor    %eax,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     112e <vstrncmp+0x1e>
mov    $0x1,%eax
test   %rdi,%rdi
je     112e <vstrncmp+0x1e>
test   %rsi,%rsi
je     112e <vstrncmp+0x1e>
jmp    1030 <strncmp@plt>
ret

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

LLVM IR (-O2):
define i32 @vstrncmp(i8* %0, i8* %1, i32 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = or i1 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = and i1 %4, %5
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %2)
br label %11
11: ; preds = %7, %3, %9
%12 = phi i32 [ %10, %9 ], [ 0, %3 ], [ 1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ flick_reg(char *, int /*<<< orphan*/, int, int,
                             int /*<<< orphan*/);
void i_asx_reg(void) { flick_reg("sa", 0, 1, 1, 0); }


x86 assembly (clang, -O0):
<i_asx_reg>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %r8d,%r8d
mov    $0x1,%ecx
mov    %r8d,%esi
mov    %ecx,%edx
call   1030 <flick_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_asx_reg>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
jmp    1030 <flick_reg@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"sa\00"
define void @i_asx_reg() {
%1 = tail call i32 @flick_reg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 1, i32 0)
ret void
}
void startinsert() {}


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

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

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

LLVM IR (-O2):
define void @startinsert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int putc(int c) {
  putchar((char)c);
  return 0;
}


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

x86 assembly (clang, -O2):
<putc>:
push   %rax
movsbl %dil,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @putchar(i8 signext %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @putc(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @putchar(i8 signext %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_compiler_info(void) {
  printf("\nCompiled by "
         "gcc (GNUC) "
         "9"
         "."
         "4"
         "."
         "0"
         " on Linux"
         "\nCompilation settings include: "
         "32bit"
         " DEBUG"
         "\n__VERSION__ macro expands to: "
         "9.4.0"
         "\n\n");
}


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

x86 assembly (clang, -O2):
<print_compiler_info>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [119 x i8] c"\0ACompiled by gcc (GNUC) 9.4.0 on Linux\0ACompilation settings include: 32bit DEBUG\0A__VERSION__ macro expands to: 9.4.0\0A\0A\00"
define void @print_compiler_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [118 x i8] c"\0ACompiled by gcc (GNUC) 9.4.0 on Linux\0ACompilation settings include: 32bit DEBUG\0A__VERSION__ macro expands to: 9.4.0\0A\00"
define void @print_compiler_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([118 x i8], [118 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int open64(const char *pathname, int flags, ...) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<open64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open64>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @open64(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @open64(i8* nocapture readnone %0, i32 %1, ...) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int main() {
  asm("main_label: .globl main_label");
  foo();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)

x86 assembly (clang, -O2):
<main>:
push   %rax

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "main_label: .globl main_label", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ activity_main_get_context();
int /*<<< orphan*/ activity_manager_start_activity(int /*<<< orphan*/);
void stop_this_activity() {
  activity_manager_start_activity(activity_main_get_context());
}


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

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

LLVM IR (-O0):
define void @stop_this_activity() {
%1 = call i32 (...) @activity_main_get_context()
%2 = call i32 @activity_manager_start_activity(i32 %1)
ret void
}

LLVM IR (-O2):
define void @stop_this_activity() {
%1 = tail call i32 (...) @activity_main_get_context()
%2 = tail call i32 @activity_manager_start_activity(i32 %1)
ret void
}
TstCond(K, Valid, T) int K, Valid;
char *T;
{
  if (!Valid) {
    BadCond(K, T);
    printf(".\n");
  }
}


x86 assembly (clang, -O0):
<TstCond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1158 <TstCond+0x38>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <BadCond@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TstCond>:
test   %esi,%esi
je     1125 <TstCond+0x5>
ret
push   %rax
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <BadCond@plt>
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@str = [2 x i8] c".\00"
define i32 @TstCond(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @BadCond to i32 (i32, i8*, ...)*)(i32 %0, i8* %2)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %5, %3
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
void x_waste_a_second() {
  int i;
  time_t old_tv;
  time_t new_tv;
  old_tv = time(NULL);
  while (1) {
    for (i = 0; i < 10000; i++) {
    }
    new_tv = time(NULL);
    if (new_tv > old_tv + 1)
      break;
  }
}


x86 assembly (clang, -O0):
<x_waste_a_second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    114c <x_waste_a_second+0x3c>
jmp    113e <x_waste_a_second+0x2e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112c <x_waste_a_second+0x1c>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jle    1173 <x_waste_a_second+0x63>
jmp    1178 <x_waste_a_second+0x68>
jmp    1125 <x_waste_a_second+0x15>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_waste_a_second>:
push   %rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %rax,%rbx
add    $0x1,%rbx
nop
xor    %edi,%edi
call   1030 <time@plt>
cmp    %rbx,%rax
jle    1120 <x_waste_a_second+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @x_waste_a_second() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = call i64 @time(i32* null)
store i64 %4, i64* %2
br label %5
5: ; preds = %0, %20
store i32 0, i32* %1
br label %6
6: ; preds = %10, %5
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 10000
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %6
13: ; preds = %6
%14 = call i64 @time(i32* null)
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = load i64, i64* %2
%17 = add nsw i64 %16, 1
%18 = icmp sgt i64 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %13
br label %21
20: ; preds = %13
br label %5
21: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @x_waste_a_second() {
%1 = tail call i64 @time(i32* null)
%2 = add nsw i64 %1, 1
br label %3
3: ; preds = %3, %0
%4 = tail call i64 @time(i32* null)
%5 = icmp sgt i64 %4, %2
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
h(signed char c, int x[]) { return x[c] + *(x + c); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movsbl -0x1(%rbp),%edx
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%eax
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @h(i8 signext %0, i32* nocapture %1) {
%3 = sext i8 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 1
ret i32 %6
}
void buzzer_ON(void) { ((*(volatile unsigned int *)0x7F0080A4) |= 1 << 14); }


x86 assembly (clang, -O0):
<buzzer_ON>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f0080a4,%eax
mov    (%rax),%ecx
or     $0x4000,%ecx
mov    $0x7f0080a4,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzzer_ON>:
orl    $0x4000,0x7f0080a4
ret

LLVM IR (-O0):
define void @buzzer_ON() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = or i32 %1, 16384
store volatile i32 %2, i32* inttoptr (i64 2130739364 to i32*)
ret void
}

LLVM IR (-O2):
define void @buzzer_ON() {
%1 = load volatile i32, i32* inttoptr (i64 2130739364 to i32*)
%2 = or i32 %1, 16384
store volatile i32 %2, i32* inttoptr (i64 2130739364 to i32*)
ret void
}
int sysButton3() {}


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

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

LLVM IR (-O0):
define i32 @sysButton3() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @sysButton3() {
ret i32 undef
}
/* Type definitions */
typedef int __u64;
typedef int __u32;

/* Variables and functions */
__u32 vfio_offset_to_pci_offset(__u64 off) { return off & (__u32)0xFFFFFFFF; }


x86 assembly (clang, -O0):
<vfio_offset_to_pci_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @vfio_offset_to_pci_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -1
ret i32 %4
}

LLVM IR (-O2):
define i32 @vfio_offset_to_pci_offset(i32 returned %0) {
ret i32 %0
}
void unlock_db() {}


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

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

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

LLVM IR (-O2):
define void @unlock_db() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncmp(char *, char *, int);
void strncmp_2() {
  char *x = "123";
  char *y = "234";
  clang_analyzer_eval(strncmp(x, y, 3) < 0);
}


x86 assembly (clang, -O0):
<strncmp_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_2>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
shr    $0x3f,%rax
mov    %eax,%edi
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [4 x i8] c"234\00"
define void @strncmp_2() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncmp(i8* %3, i8* %4, i32 3)
%6 = icmp slt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [4 x i8] c"234\00"
define void @strncmp_2() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Type definitions */
struct address_space {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ balance_dirty_pages_ratelimited_nr(struct address_space *,
                                                      int);
__attribute__((always_)) void
balance_dirty_pages_ratelimited(struct address_space *mapping) {
  balance_dirty_pages_ratelimited_nr(mapping, 1);
}


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

x86 assembly (clang, -O2):
<balance_dirty_pages_ratelimited>:
mov    $0x1,%esi
jmp    1030 <balance_dirty_pages_ratelimited_nr@plt>

LLVM IR (-O0):
%struct.address_space = type { i32 }
define void @balance_dirty_pages_ratelimited(%struct.address_space* %0) {
%2 = alloca %struct.address_space*
store %struct.address_space* %0, %struct.address_space** %2
%3 = load %struct.address_space*, %struct.address_space** %2
%4 = call i32 @balance_dirty_pages_ratelimited_nr(%struct.address_space* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.address_space = type { i32 }
define void @balance_dirty_pages_ratelimited(%struct.address_space* %0) {
%2 = tail call i32 @balance_dirty_pages_ratelimited_nr(%struct.address_space* %0, i32 1)
ret void
}