xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char name[20], s[50];
  printf("Type something:\n");
  scanf("%s", name);
  snprintf(s, 50, "say Hello World %s", name);
  system(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x20(%rbp),%rcx
mov    $0x32,%esi
lea    0xe92(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xe94(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
mov    %r14,%rcx
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Type something:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"say Hello World %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [50 x i8]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @snprintf(i8* %7, i32 50, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"say Hello World %s\00"
@str = [16 x i8] c"Type something:\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @snprintf(i8* %4, i32 50, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = call i32 @system(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initial_values_weight_us();
int /*<<< orphan*/ printf(char *);
void weight_to_us() {
  printf("\nTo US system. (Weight)\n");
  initial_values_weight_us();
}


x86 assembly (clang, -O0):
<weight_to_us>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <initial_values_weight_us@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<weight_to_us>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initial_values_weight_us@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0ATo US system. (Weight)\0A\00"
define void @weight_to_us() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @initial_values_weight_us()
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"\0ATo US system. (Weight)\00"
define void @weight_to_us() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @initial_values_weight_us()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_error(char *);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *gcmalloc(size_t size) {
  void *result = malloc(size);
  if (!result) {
    log_error("Failed allocating block size");
  }
  memset(result, 0, size);
  return result;
}


x86 assembly (clang, -O0):
<gcmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <gcmalloc+0x30>
lea    0xea5(%rip),%rdi
call   1030 <log_error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1150 <gcmalloc+0x20>
lea    0xeb5(%rip),%rdi
call   1030 <log_error@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Failed allocating block size\00"
define i8* @gcmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @log_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i64, i64* %2
%13 = call i32 @memset(i8* %11, i32 0, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [29 x i8] c"Failed allocating block size\00"
define i8* @gcmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @log_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
char *ipt_add_offset(char *ptr, ptrdiff_t offset) { return ptr + offset; }


x86 assembly (clang, -O0):
<ipt_add_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipt_add_offset>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @ipt_add_offset(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @ipt_add_offset(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
void FIQ_Routine(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<FIQ_Routine>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <FIQ_Routine+0x9>
jmp    1109 <FIQ_Routine+0x9>

x86 assembly (clang, -O2):
<FIQ_Routine>:
jmp    1100 <FIQ_Routine>

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

LLVM IR (-O2):
define void @FIQ_Routine() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_boo_nested_block_comment() {
  test_parser_verify_parse(
      test_parser_sourcefile("boo",
                             " /* comment\n /* nested */\nstill a comment */"),
      "boo", "", "/* comment\n/* nested */\nstill a comment */", 0);
}


x86 assembly (clang, -O0):
<test_boo_nested_block_comment>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xf14(%rip),%rdx
lea    0xee3(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_boo_nested_block_comment>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xf1d(%rip),%rdx
lea    0xeec(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"boo\00"
@.str.1 = [45 x i8] c" /* comment\0A /* nested */\0Astill a comment */\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [43 x i8] c"/* comment\0A/* nested */\0Astill a comment */\00"
define void @test_boo_nested_block_comment() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"boo\00"
@.str.1 = [45 x i8] c" /* comment\0A /* nested */\0Astill a comment */\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [43 x i8] c"/* comment\0A/* nested */\0Astill a comment */\00"
define void @test_boo_nested_block_comment() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
unsigned long mdc(unsigned long a, unsigned long b) {
  unsigned long mod;
  mod = a % b;
  while (mod != 0) {
    a = b;
    b = mod;
    mod = a % b;
  }
  return b;
}


x86 assembly (clang, -O0):
<mdc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <mdc+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    111c <mdc+0x1c>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdc>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111b <mdc+0x1b>
xor    %edx,%edx
div    %rsi
test   %rdx,%rdx
jne    1140 <mdc+0x40>
jmp    1124 <mdc+0x24>
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    1140 <mdc+0x40>
mov    %rsi,%rax
ret
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rax
xor    %edx,%edx
div    %rcx
mov    %rcx,%rsi
test   %rdx,%rdx
je     1157 <mdc+0x57>
mov    %rdx,%rcx
mov    %rsi,%rax
or     %rdx,%rax
shr    $0x20,%rax
jne    1130 <mdc+0x30>
mov    %esi,%eax
xor    %edx,%edx
div    %ecx
jmp    1138 <mdc+0x38>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @mdc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
store i64 %8, i64* %5
br label %9
9: ; preds = %12, %2
%10 = load i64, i64* %5
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i64, i64* %4
store i64 %13, i64* %3
%14 = load i64, i64* %5
store i64 %14, i64* %4
%15 = load i64, i64* %3
%16 = load i64, i64* %4
%17 = urem i64 %15, %16
store i64 %17, i64* %5
br label %9
18: ; preds = %9
%19 = load i64, i64* %4
ret i64 %19
}

LLVM IR (-O2):
define i64 @mdc(i64 %0, i64 %1) {
%3 = urem i64 %0, %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ %3, %2 ]
%7 = phi i64 [ %6, %5 ], [ %1, %2 ]
%8 = urem i64 %7, %6
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i64 [ %1, %2 ], [ %6, %5 ]
ret i64 %11
}
int SoundDev_WriteStereoSamples(short *buffer, int cnt) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @SoundDev_WriteStereoSamples(i16* nocapture readnone %0, i32 %1) {
ret i32 0
}
void wifi_evt_sme_connect_failed(
    const struct wifi_msg_sme_connect_failed_evt_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_sme_connect_failed_evt_t = type opaque
define void @wifi_evt_sme_connect_failed(%struct.wifi_msg_sme_connect_failed_evt_t* nocapture %0) {
ret void
}
void RTAvloGCPtrGetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloGCPtrGetBestFit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ touch_softlockup_watchdog();
void touch_nmi_watchdog(void) { touch_softlockup_watchdog(); }


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

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

LLVM IR (-O0):
define void @touch_nmi_watchdog() {
%1 = call i32 (...) @touch_softlockup_watchdog()
ret void
}

LLVM IR (-O2):
define void @touch_nmi_watchdog() {
%1 = tail call i32 (...) @touch_softlockup_watchdog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ndb_unix_sleep(int);
void ndb_osdep_sleep(int millis) { ndb_unix_sleep(millis); }


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

x86 assembly (clang, -O2):
<ndb_osdep_sleep>:
jmp    1030 <ndb_unix_sleep@plt>

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

LLVM IR (-O2):
define void @ndb_osdep_sleep(i32 %0) {
%2 = tail call i32 @ndb_unix_sleep(i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
scalar_t__ genMenu();
int /*<<< orphan*/ init();
int /*<<< orphan*/ loadImage();
int /*<<< orphan*/ selectImage();
int main(void) {
  init();
  uint8_t dl = genMenu();
  if (dl == 0)
    selectImage();
  loadImage();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <genMenu@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <main+0x33>
mov    $0x0,%al
call   1030 <selectImage@plt>
mov    $0x0,%al
call   1060 <loadImage@plt>
jmp    117a <main+0x3a>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <genMenu@plt>
test   %rax,%rax
jne    115b <main+0x1b>
xor    %eax,%eax
call   1030 <selectImage@plt>
xor    %eax,%eax
call   1060 <loadImage@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1170 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 (...) @init()
%4 = call i64 (...) @genMenu()
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @selectImage()
br label %9
9: ; preds = %7, %0
%10 = call i32 (...) @loadImage()
br label %11
11: ; preds = %9, %11
br label %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i64 (...) @genMenu()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @selectImage()
br label %6
6: ; preds = %4, %0
%7 = tail call i32 (...) @loadImage()
br label %8
8: ; preds = %8, %6
br label %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, size_t);
void zero_ints(int *array, int count) {
  memset(array, 0, ((size_t)count) * sizeof(int));
}


x86 assembly (clang, -O0):
<zero_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rdx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_ints>:
movslq %esi,%rdx
shl    $0x2,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @zero_ints(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 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = call i32 @memset(i32* %5, i32 0, i64 %8)
ret void
}

LLVM IR (-O2):
define void @zero_ints(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = shl nsw i64 %3, 2
%5 = tail call i32 @memset(i32* %0, i32 0, i64 %4)
ret void
}
void amsynth_lash_process_args(int *argc, char ***argv) {}


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

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

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

LLVM IR (-O2):
define void @amsynth_lash_process_args(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void bad_header(char *kind) {
  char msg[64];
  sprintf(msg, "malformed %s header", kind);
  fail(msg);
}


x86 assembly (clang, -O0):
<bad_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <fail@plt>
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"malformed %s header\00"
define void @bad_header(i8* %0) {
%2 = alloca i8*
%3 = alloca [64 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @fail(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"malformed %s header\00"
define void @bad_header(i8* %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @fail(i8* %3)
ret void
}
void intel_fbdev_output_poll_changed(struct drm_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define void @intel_fbdev_output_poll_changed(%struct.drm_device* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_extract_epi32(int /*<<< orphan*/, int);
int iunpacksearch0(__m128i *initOffset, const __m128i *_in, uint32_t key,
                   uint32_t *presult) {
  uint32_t repeatedvalue = (uint32_t)_mm_extract_epi32(*initOffset, 3);
  if (repeatedvalue >= key) {
    *presult = repeatedvalue;
    return 0;
  }
  *presult = key + 1;
  (void)_in;
  return (128);
}


x86 assembly (clang, -O0):
<iunpacksearch0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x3,%esi
call   1030 <_mm_extract_epi32@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jl     1163 <iunpacksearch0+0x53>
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1179 <iunpacksearch0+0x69>
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x80,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iunpacksearch0>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    $0x3,%esi
call   1030 <_mm_extract_epi32@plt>
movslq %eax,%rcx
lea    0x1(%rbx),%rdx
xor    %eax,%eax
cmp    %rbx,%rcx
setl   %al
cmovge %rcx,%rdx
shl    $0x7,%eax
mov    %rdx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @iunpacksearch0(i32* nocapture %0, i32* nocapture readnone %1, i64 %2, i64* nocapture writeonly %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @_mm_extract_epi32(i32 %5, i32 3)
%7 = sext i32 %6 to i64
%8 = icmp slt i64 %7, %2
%9 = add nsw i64 %2, 1
%10 = select i1 %8, i64 %9, i64 %7
%11 = select i1 %8, i32 128, i32 0
store i64 %10, i64* %3
ret i32 %11
}
int test_imm_94uint32_reg(unsigned int val) {
  return ((val) & (0x94 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_94uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x94,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_94uint32_reg(i32 %0) {
%2 = and i32 %0, 148
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void copy() { printf("*** :: 4Gewinnt :: ***\n\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"*** :: 4Gewinnt :: ***\0A\0A\00"
define void @copy() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"*** :: 4Gewinnt :: ***\0A\00"
define void @copy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
int checkChar(char n) {
  if (n < 'A' || n > 'Z')
    return 1;
  switch (n) {
  case 'F':
  case 'J':
  case 'Q':
  case 'U':
  case 'W':
  case 'X':
  case 'Y':
  case 'Z':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<checkChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1124 <checkChar+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1130 <checkChar+0x30>
movl   $0x1,-0x4(%rbp)
jmp    119f <checkChar+0x9f>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x46,%eax
je     118c <checkChar+0x8c>
jmp    1145 <checkChar+0x45>
mov    -0xc(%rbp),%eax
sub    $0x4a,%eax
je     118c <checkChar+0x8c>
jmp    1156 <checkChar+0x56>
mov    -0xc(%rbp),%eax
sub    $0x51,%eax
je     118c <checkChar+0x8c>
jmp    1167 <checkChar+0x67>
mov    -0xc(%rbp),%eax
sub    $0x55,%eax
je     118c <checkChar+0x8c>
jmp    1178 <checkChar+0x78>
mov    -0xc(%rbp),%eax
add    $0xffffffa9,%eax
sub    $0x3,%eax
ja     1198 <checkChar+0x98>
jmp    118c <checkChar+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    119f <checkChar+0x9f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkChar>:
lea    -0x5b(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xe6,%cl
jb     1126 <checkChar+0x26>
add    $0xba,%dil
cmp    $0x14,%dil
ja     1127 <checkChar+0x27>
movzbl %dil,%ecx
mov    $0x1e8811,%edx
bt     %rcx,%rdx
jae    1127 <checkChar+0x27>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @checkChar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 65
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %17
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
switch i32 %14, label %16 [
i32 70, label %15
i32 74, label %15
i32 81, label %15
i32 85, label %15
i32 87, label %15
i32 88, label %15
i32 89, label %15
i32 90, label %15
]
15: ; preds = %12, %12, %12, %12, %12, %12, %12, %12
store i32 1, i32* %2
br label %17
16: ; preds = %12
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @checkChar(i8 signext %0) {
%2 = add i8 %0, -91
%3 = icmp ult i8 %2, -26
br i1 %3, label %6, label %4
4: ; preds = %1
switch i8 %0, label %5 [
i8 70, label %6
i8 74, label %6
i8 81, label %6
i8 85, label %6
i8 87, label %6
i8 88, label %6
i8 89, label %6
i8 90, label %6
]
5: ; preds = %4
br label %6
6: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %1, %5
%7 = phi i32 [ 0, %5 ], [ 1, %1 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ]
ret i32 %7
}
void inclass_element2slashcharclass() {}


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

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

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

LLVM IR (-O2):
define void @inclass_element2slashcharclass() {
ret void
}
/* Variables and functions */
int strlen(char const *);
int _sd2txt_len(const char *key, char *val) {
  int ret = strlen(key);
  if (!*val) {
    return ret;
  }
  ret += strlen(val);
  ret++;
  return ret;
}


x86 assembly (clang, -O0):
<_sd2txt_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1144 <_sd2txt_len+0x34>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <_sd2txt_len+0x52>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sd2txt_len>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebx
cmpb   $0x0,(%r14)
je     1131 <_sd2txt_len+0x21>
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %eax,%ebx
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @_sd2txt_len(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = add i32 %3, 1
%9 = add i32 %8, %7
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ %3, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ realloc(int *, int);
int *remem_t_int(int *p, int i) {
  int *aux;
  aux = (int *)realloc(p, i * sizeof(int));
  if (aux == NULL) {
    printf("Erreur d'allocation de memoire'\n");
    exit(-1);
  }
  p = aux;
  return p;
}


x86 assembly (clang, -O0):
<remem_t_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1177 <remem_t_int+0x47>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remem_t_int>:
push   %rax
shl    $0x2,%esi
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <remem_t_int+0x10>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Erreur d'allocation de memoire'\0A\00"
define i32* @remem_t_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @realloc(i32* %6, i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %5
%13 = load i32*, i32** %5
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = load i32*, i32** %5
store i32* %19, i32** %3
%20 = load i32*, i32** %3
ret i32* %20
}

LLVM IR (-O2):
@str = [32 x i8] c"Erreur d'allocation de memoire'\00"
define i32* @remem_t_int(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @realloc(i32* %0, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
%10 = inttoptr i64 %4 to i32*
ret i32* %10
}
/* Variables and functions */
char *OpenAPI_base64decode(const void *b64_decode_this,
                           int decode_this_many_bytes, int *decoded_bytes) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @OpenAPI_base64decode(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @OpenAPI_base64decode(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
unsigned short fb_get_cursor() {
  unsigned short pos = 0;
  outb(0x3D4, 0x0F);
  pos = inb(0x3D5);
  outb(0x3D4, 0x0E);
  pos = (inb(0x3D5) << 8) | pos;
  return pos;
}


x86 assembly (clang, -O0):
<fb_get_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x0,-0x2(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
mov    %ax,-0x2(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_get_cursor>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
mov    %eax,%ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @fb_get_cursor() {
%1 = alloca i16
store i16 0, i16* %1
%2 = call i32 @outb(i32 980, i32 15)
%3 = call i32 @inb(i32 981)
%4 = trunc i32 %3 to i16
store i16 %4, i16* %1
%5 = call i32 @outb(i32 980, i32 14)
%6 = call i32 @inb(i32 981)
%7 = shl i32 %6, 8
%8 = load i16, i16* %1
%9 = zext i16 %8 to i32
%10 = or i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %1
%12 = load i16, i16* %1
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @fb_get_cursor() {
%1 = tail call i32 @outb(i32 980, i32 15)
%2 = tail call i32 @inb(i32 981)
%3 = tail call i32 @outb(i32 980, i32 14)
%4 = tail call i32 @inb(i32 981)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = trunc i32 %6 to i16
ret i16 %7
}
char *strcpy(char *dest, const char *src) {
  char *const orig_dest = dest;
  while (*src) {
    *dest = *src;
    src++;
    dest++;
  }
  *dest = 0;
  return orig_dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <strcpy+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char *, int);
int is(const char *x, char *s) {
  int i = strlen(x);
  if (strncmp(x, s, i))
    return 0;
  return i;
}


x86 assembly (clang, -O0):
<is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1162 <is+0x42>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is+0x48>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %ebp,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i64 @strncmp(i8* %9, i8* %10, i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @is(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 %3, i32 0
ret i32 %6
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rax;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int cpuid_num_perfevtsel(void) {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 10;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  return (((uint64_t)(rax) &
           ((((uint64_t)1 << (((15)) - ((8)) + 1)) - 1) << ((8)))) >>
          (8));
}


x86 assembly (clang, -O0):
<cpuid_num_perfevtsel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_num_perfevtsel>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0xa,%edi
call   1030 <cpuid@plt>
movzbl 0x9(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_num_perfevtsel() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 10, i32* %5
%6 = load i32, i32* %5
%7 = call i32 @cpuid(i32 %6, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %1
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
ret i32 %10
}

LLVM IR (-O2):
define i32 @cpuid_num_perfevtsel() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 10, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %1
%11 = lshr i32 %10, 8
%12 = and i32 %11, 255
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void use_mono_font() { printf("MONO_FONT setfont\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"MONO_FONT setfont\0A\00"
define void @use_mono_font() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"MONO_FONT setfont\00"
define void @use_mono_font() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ round(double);
int _Round(double in1) { return (int)round(in1); }


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

x86 assembly (clang, -O2):
<_Round>:
jmp    1030 <round@plt>

LLVM IR (-O0):
define i32 @_Round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @round(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_Round(double %0) {
%2 = tail call i64 @round(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
void *thread1(void *arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @thread1(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
size_t FileSizeGet(FILE *file) {
  long length;
  fseek(file, 0, SEEK_END);
  length = ftell(file);
  rewind(file);
  return (size_t)length;
}


x86 assembly (clang, -O0):
<FileSizeGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileSizeGet>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @FileSizeGet(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @FileSizeGet(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int ENOSYS;
int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy) {
  return (ENOSYS);
}


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

x86 assembly (clang, -O2):
<pthread_attr_setschedpolicy>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_attr_setschedpolicy(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}
void instruc_8() {}


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

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

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

LLVM IR (-O2):
define void @instruc_8() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AcquireLock();
int /*<<< orphan*/ ReleaseLock();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void submain() {
  AcquireLock();
  int a;
  scanf("%d", &a);
  printf("%d\n", a);
  ReleaseLock();
}


x86 assembly (clang, -O0):
<submain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <AcquireLock@plt>
lea    0xeaa(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <ReleaseLock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<submain>:
push   %rax
xor    %eax,%eax
call   1040 <AcquireLock@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <ReleaseLock@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @submain() {
%1 = alloca i32
%2 = call i32 (...) @AcquireLock()
%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 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @ReleaseLock()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @submain() {
%1 = alloca i32
%2 = tail call i32 (...) @AcquireLock()
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @ReleaseLock()
ret void
}