xunge/DecIR huggingface dataset:
long get_ncpus_sysconf(void) { return -1; }


x86 assembly (clang, -O0):
<get_ncpus_sysconf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ncpus_sysconf>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @get_ncpus_sysconf() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @get_ncpus_sysconf() {
ret i64 -1
}
void XcmsCIEXYZToCIExyY() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIEXYZToCIExyY() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count_sort(int *, int);
int /*<<< orphan*/ init_vector(int *);
int main(int argc, char **argv) {
  int vector[100];
  init_vector(vector);
  count_sort(vector, 100);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x190,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <init_vector@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1040 <count_sort@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%8 = call i32 @init_vector(i32* %7)
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%10 = call i32 @count_sort(i32* %9, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%6 = call i32 @init_vector(i32* %5)
%7 = call i32 @count_sort(i32* %5, i32 100)
ret i32 0
}
/* Variables and functions */
int res_init();
int evaddrinfo_reload_nameserver() { return res_init(); }


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

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

LLVM IR (-O0):
define i32 @evaddrinfo_reload_nameserver() {
%1 = call i32 (...) @res_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @evaddrinfo_reload_nameserver() {
%1 = tail call i32 (...) @res_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ LINE_MAX;
int /*<<< orphan*/ strlcat(char *, char const *, int /*<<< orphan*/);
void psc_sigappend(char buf[LINE_MAX], const char *str) {
  if (buf[0] != '\0')
    strlcat(buf, ",", LINE_MAX);
  strlcat(buf, str, LINE_MAX);
}


x86 assembly (clang, -O0):
<psc_sigappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <psc_sigappend+0x39>
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
lea    0xebc(%rip),%rsi
call   1030 <strlcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
call   1030 <strlcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psc_sigappend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1137 <psc_sigappend+0x27>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edx
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strlcat@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strlcat@plt>

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

LLVM IR (-O2):
@LINE_MAX = global i32 0
@.str = [2 x i8] c",\00"
define void @psc_sigappend(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @LINE_MAX
%7 = tail call i32 @strlcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %2
%9 = load i32, i32* @LINE_MAX
%10 = tail call i32 @strlcat(i8* %0, i8* %1, i32 %9)
ret void
}
struct SomeObject *create_object(char *name) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.SomeObject = type opaque
define %struct.SomeObject* @create_object(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.SomeObject* null
}

LLVM IR (-O2):
%struct.SomeObject = type opaque
define noalias %struct.SomeObject* @create_object(i8* nocapture readnone %0) {
ret %struct.SomeObject* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ia_vdelete(void *v) {
  if (v) {
    free(v);
  }
}


x86 assembly (clang, -O0):
<ia_vdelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ia_vdelete+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ia_vdelete>:
test   %rdi,%rdi
je     111a <ia_vdelete+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @ia_vdelete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ia_vdelete(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_div_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_div_pd(__m128d A, __m128d B) { return _mm_div_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_div_pd>:
jmp    1030 <_mm_div_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_div_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_div_pd(i32 %0, i32 %1)
ret i32 %3
}
void bitmap_scnprintf(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<bitmap_scnprintf>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_scnprintf>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.bitmap_scnprintf = [17 x i8] c"bitmap_scnprintf\00"
define void @bitmap_scnprintf() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.bitmap_scnprintf, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.bitmap_scnprintf = [17 x i8] c"bitmap_scnprintf\00"
define void @bitmap_scnprintf() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.bitmap_scnprintf, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void usage(char *file) {
  printf("\nUsage: [sudo] %s -m <mode number> [-t <HH:mm:ss> -i <interval in "
         "seconds>]\n\n"
         "-h\t\t\t\tshow help information.\n"
         "-t <HH:mm:ss>\t\t\tset the timer start point.(default next "
         "secs(secs%%5==0))\n"
         "-i <interval in seconds>\tset the timer interval.(default 5s)\n"
         "-m <mode number>\t\tset the mode to get time(default 0) :\n"
         "\t\t\t\t\t-m 0 means system time.\n"
         "\t\t\t\t\t-m 1 means pcie time from driver directly.\n"
         "\t\t\t\t\t-m 2 means pcie time from hypercall.\n"
         "\nExample: sudo %s -t 8:30:0 -i 5.3 -m 2\n",
         file, file);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [457 x i8] c"\0AUsage: [sudo] %s -m <mode number> [-t <HH:mm:ss> -i <interval in seconds>]\0A\0A-h\09\09\09\09show help information.\0A-t <HH:mm:ss>\09\09\09set the timer start point.(default next secs(secs%%5==0))\0A-i <interval in seconds>\09set the timer interval.(default 5s)\0A-m <mode number>\09\09set the mode to get time(default 0) :\0A\09\09\09\09\09-m 0 means system time.\0A\09\09\09\09\09-m 1 means pcie time from driver directly.\0A\09\09\09\09\09-m 2 means pcie time from hypercall.\0A\0AExample: sudo %s -t 8:30:0 -i 5.3 -m 2\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([457 x i8], [457 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [457 x i8] c"\0AUsage: [sudo] %s -m <mode number> [-t <HH:mm:ss> -i <interval in seconds>]\0A\0A-h\09\09\09\09show help information.\0A-t <HH:mm:ss>\09\09\09set the timer start point.(default next secs(secs%%5==0))\0A-i <interval in seconds>\09set the timer interval.(default 5s)\0A-m <mode number>\09\09set the mode to get time(default 0) :\0A\09\09\09\09\09-m 0 means system time.\0A\09\09\09\09\09-m 1 means pcie time from driver directly.\0A\09\09\09\09\09-m 2 means pcie time from hypercall.\0A\0AExample: sudo %s -t 8:30:0 -i 5.3 -m 2\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([457 x i8], [457 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void help(void) {
  fprintf(stdout, "tic-tac-toe -i\n"
                  "tic-tac-toe -s size\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [36 x i8] c"tic-tac-toe -i\0Atic-tac-toe -s size\0A\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [36 x i8] c"tic-tac-toe -i\0Atic-tac-toe -s size\0A\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
void write_le32(unsigned long in, unsigned char *out) {
  out[0] = in & 0xFF;
  out[1] = (in >> 8) & 0xFF;
  out[2] = (in >> 16) & 0xFF;
  out[3] = (in >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<write_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_le32>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @write_le32(i64 %0, i8* nocapture writeonly %1) {
%3 = trunc i64 %0 to i8
store i8 %3, i8* %1
%4 = lshr i64 %0, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %0, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %0, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
int getPositionInAlphabet_While(char c) {
  int offset = 0;
  while (offset < 26) {
    if ('a' + offset == c) {
      break;
    }
    offset++;
  }
  if (offset == 26) {
    return -1;
  }
  return offset;
}


x86 assembly (clang, -O0):
<getPositionInAlphabet_While>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    1140 <getPositionInAlphabet_While+0x40>
mov    -0xc(%rbp),%eax
add    $0x61,%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1132 <getPositionInAlphabet_While+0x32>
jmp    1140 <getPositionInAlphabet_While+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <getPositionInAlphabet_While+0x11>
cmpl   $0x1a,-0xc(%rbp)
jne    1156 <getPositionInAlphabet_While+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <getPositionInAlphabet_While+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPositionInAlphabet_While>:
lea    -0x61(%rdi),%eax
cmp    $0x19,%eax
mov    $0x19,%ecx
cmovb  %eax,%ecx
lea    -0x7b(%rdi),%eax
cmp    $0xe6,%al
adc    $0x0,%ecx
cmp    $0x1a,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getPositionInAlphabet_While(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
%4 = call i32 @llvm.umin.i32(i32 %3, i32 25)
%5 = add i8 %0, -123
%6 = icmp ult i8 %5, -26
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = icmp eq i32 %8, 26
%10 = select i1 %9, i32 -1, i32 %8
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ PXP_DriverIRQHandler();
__attribute__((weak)) void PXP_IRQHandler(void) { PXP_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @PXP_IRQHandler() {
%1 = call i32 (...) @PXP_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PXP_IRQHandler() {
%1 = tail call i32 (...) @PXP_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t _cpuid_supported(void) {
  int32_t v;
  v = 1;
  return v;
}


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

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

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

LLVM IR (-O2):
define i32 @_cpuid_supported() {
ret i32 1
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ fegetenv(int *);
int /*<<< orphan*/ fesetenv(int *);
int feraiseexcept(int __excepts) {
  fexcept_t __fcsr;
  fegetenv(&__fcsr);
  __excepts &= FE_ALL_EXCEPT;
  __fcsr |= __excepts | (__excepts << 10);
  fesetenv(&__fcsr);
  return 0;
}


x86 assembly (clang, -O0):
<feraiseexcept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <fegetenv@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0xa,%ecx
or     %ecx,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <fesetenv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feraiseexcept>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <fegetenv@plt>
mov    0x2ea6(%rip),%rax
and    (%rax),%ebx
mov    %ebx,%eax
shl    $0xa,%eax
or     0x4(%rsp),%ebx
or     %eax,%ebx
mov    %ebx,0x4(%rsp)
mov    %r14,%rdi
call   1030 <fesetenv@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @feraiseexcept(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @fegetenv(i32* %3)
%5 = load i32, i32* @FE_ALL_EXCEPT
%6 = load i32, i32* %2
%7 = and i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = shl i32 %9, 10
%11 = or i32 %8, %10
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = call i32 @fesetenv(i32* %3)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @feraiseexcept(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fegetenv(i32* %2)
%5 = load i32, i32* @FE_ALL_EXCEPT
%6 = and i32 %5, %0
%7 = shl i32 %6, 10
%8 = load i32, i32* %2
%9 = or i32 %8, %6
%10 = or i32 %9, %7
store i32 %10, i32* %2
%11 = call i32 @fesetenv(i32* %2)
ret i32 0
}
/* Variables and functions */
long double fmodl(long double, long double);
int /*<<< orphan*/ printf(char *, double, double, double);
int main(void) {
  long double x = 15.31;
  long double y = 3.14;
  long double result = fmodl(x, y);
  printf("%g %% %g = %g\n", (double)x, (double)y, (double)result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
fldl   0xec8(%rip)
fstpt  -0x20(%rbp)
fldl   0xec7(%rip)
fstpt  -0x30(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <fmodl@plt>
fstpt  -0x40(%rbp)
fldt   -0x20(%rbp)
fstpl  -0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
fldt   -0x30(%rbp)
fstpl  -0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
fldt   -0x40(%rbp)
fstpl  -0x48(%rbp)
movsd  -0x48(%rbp),%xmm2
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
fldl   0xed6(%rip)
fstpt  0x10(%rsp)
fldl   0xed4(%rip)
fstpt  (%rsp)
call   1040 <fmodl@plt>
fstpl  0x20(%rsp)
movsd  0x20(%rsp),%xmm2
lea    0xec3(%rip),%rdi
movsd  0xeb3(%rip),%xmm0
movsd  0xea3(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%g %% %g = %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store i32 0, i32* %1
store x86_fp80 0xK4002F4F5C28F5C28F800, x86_fp80* %2
store x86_fp80 0xK4000C8F5C28F5C28F800, x86_fp80* %3
%5 = load x86_fp80, x86_fp80* %2
%6 = load x86_fp80, x86_fp80* %3
%7 = call x86_fp80 @fmodl(x86_fp80 %5, x86_fp80 %6)
store x86_fp80 %7, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %2
%9 = fptrunc x86_fp80 %8 to double
%10 = load x86_fp80, x86_fp80* %3
%11 = fptrunc x86_fp80 %10 to double
%12 = load x86_fp80, x86_fp80* %4
%13 = fptrunc x86_fp80 %12 to double
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %9, double %11, double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%g %% %g = %g\0A\00"
define i32 @main() {
%1 = tail call x86_fp80 @fmodl(x86_fp80 0xK4002F4F5C28F5C28F800, x86_fp80 0xK4000C8F5C28F5C28F800)
%2 = fptrunc x86_fp80 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 1.531000e+01, double 3.140000e+00, double %2)
ret i32 0
}
/* Variables and functions */
int KEY_MAX;
int in_evdev_get_bind_count(void) { return (KEY_MAX + 1); }


x86 assembly (clang, -O0):
<in_evdev_get_bind_count>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_evdev_get_bind_count>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
@KEY_MAX = global i32 0
define i32 @in_evdev_get_bind_count() {
%1 = load i32, i32* @KEY_MAX
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
@KEY_MAX = global i32 0
define i32 @in_evdev_get_bind_count() {
%1 = load i32, i32* @KEY_MAX
%2 = add nsw i32 %1, 1
ret i32 %2
}
double sin(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.sin = [4 x i8] c"sin\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.sin, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.sin = [4 x i8] c"sin\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @sin(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.sin, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int test_ais_2(void) {
  fprintf(stderr, "test_ais_2() failed: Not Written\n");
  return 0;
}


x86 assembly (clang, -O0):
<test_ais_2>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ais_2>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"test_ais_2() failed: Not Written\0A\00"
define i32 @test_ais_2() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"test_ais_2() failed: Not Written\0A\00"
define i32 @test_ais_2() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int library_func1(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @library_func1() {
ret i32 2
}

LLVM IR (-O2):
define i32 @library_func1() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ func(int *);
int main() {
  static int var;
  func(&var);
  return var;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x2f14(%rip),%rdi
call   1030 <func@plt>
mov    0x2f09(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.var = internal global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @func(i32* @main.var)
%3 = load i32, i32* @main.var
ret i32 %3
}

LLVM IR (-O2):
@main.var = internal global i32 0
define i32 @main() {
%1 = tail call i32 @func(i32* @main.var)
%2 = load i32, i32* @main.var
ret i32 %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  int i = 11;
  char *buf = malloc(sizeof(char) * 6);
  char c = buf[-1];
  char *x = buf + (long)buf;
  char *y = (char *)((long)buf * i);
  write(-1, buf + 3, 5);
  return x - y + c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
mov    $0x6,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
imul   %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
add    $0x3,%rsi
mov    $0xffffffff,%edi
mov    $0x5,%edx
call   1030 <write@plt>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
movsbq -0x11(%rbp),%rcx
add    %rcx,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x6,%edi
call   1040 <malloc@plt>
imul   $0xfffffff5,%eax,%ebx
add    %eax,%ebx
add    %eax,%ebx
lea    0x3(%rax),%rsi
mov    $0xffffffff,%edi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8*
store i32 0, i32* %1
store i32 11, i32* %2
%7 = call i8* @malloc(i32 6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 -1
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %5
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %15 to i64
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = mul nsw i64 %16, %18
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %6
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = call i32 @write(i32 -1, i8* %22, i32 5)
%24 = load i8*, i8** %5
%25 = load i8*, i8** %6
%26 = ptrtoint i8* %24 to i64
%27 = ptrtoint i8* %25 to i64
%28 = sub i64 %26, %27
%29 = load i8, i8* %4
%30 = sext i8 %29 to i64
%31 = add nsw i64 %28, %30
%32 = trunc i64 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(6) i8* @malloc(i32 6)
%2 = ptrtoint i8* %1 to i64
%3 = getelementptr inbounds i8, i8* %1, i64 %2
%4 = mul i64 %2, -11
%5 = getelementptr inbounds i8, i8* %1, i64 3
%6 = tail call i32 @write(i32 -1, i8* %5, i32 5)
%7 = ptrtoint i8* %3 to i64
%8 = add i64 %4, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ slog_rotate();
void rotate_handler(int signo) { slog_rotate(); }


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

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

LLVM IR (-O0):
define void @rotate_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @slog_rotate()
ret void
}

LLVM IR (-O2):
define void @rotate_handler(i32 %0) {
%2 = tail call i32 (...) @slog_rotate()
ret void
}
/* Variables and functions */
int trap_lseek(int, unsigned long, int);
int _lseek(int file, int ptr, int dir) {
  return trap_lseek(file, (unsigned long)ptr, dir);
}


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

x86 assembly (clang, -O2):
<_lseek>:
movslq %esi,%rsi
jmp    1030 <trap_lseek@plt>

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

LLVM IR (-O2):
define i32 @_lseek(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = tail call i32 @trap_lseek(i32 %0, i64 %4, i32 %2)
ret i32 %5
}
int __attribute__((noipa)) foo(int how) {
  switch (how) {
  case 2:
    how = 205;
    break;
  case 3:
    how = 305;
    break;
  case 4:
    how = 405;
    break;
  case 5:
    how = 505;
    break;
  case 6:
    how = 605;
    break;
  }
  return how;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1167 <foo+0x67>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xcd,-0x4(%rbp)
jmp    1167 <foo+0x67>
movl   $0x131,-0x4(%rbp)
jmp    1167 <foo+0x67>
movl   $0x195,-0x4(%rbp)
jmp    1167 <foo+0x67>
movl   $0x1f9,-0x4(%rbp)
jmp    1167 <foo+0x67>
movl   $0x25d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0x2(%rdi),%ecx
imul   $0x64,%ecx,%eax
add    $0xcd,%eax
cmp    $0x5,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %9 [
i32 2, label %4
i32 3, label %5
i32 4, label %6
i32 5, label %7
i32 6, label %8
]
4: ; preds = %1
store i32 205, i32* %2
br label %9
5: ; preds = %1
store i32 305, i32* %2
br label %9
6: ; preds = %1
store i32 405, i32* %2
br label %9
7: ; preds = %1
store i32 505, i32* %2
br label %9
8: ; preds = %1
store i32 605, i32* %2
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 5
%4 = mul i32 %2, 100
%5 = add i32 %4, 205
%6 = select i1 %3, i32 %5, i32 %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ RANGE_test(int /*<<< orphan*/);
void PAGE_RangeExit() { RANGE_test(0); }


x86 assembly (clang, -O0):
<PAGE_RangeExit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <RANGE_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAGE_RangeExit>:
xor    %edi,%edi
jmp    1030 <RANGE_test@plt>

LLVM IR (-O0):
define void @PAGE_RangeExit() {
%1 = call i32 @RANGE_test(i32 0)
ret void
}

LLVM IR (-O2):
define void @PAGE_RangeExit() {
%1 = tail call i32 @RANGE_test(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void disp_file(int fd) {
  char buffer;
  while (read(fd, &buffer, 1) != 0)
    write(1, &buffer, 1);
}


x86 assembly (clang, -O0):
<disp_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
je     115b <disp_file+0x3b>
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
jmp    112b <disp_file+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disp_file>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
je     1166 <disp_file+0x46>
lea    0x7(%rsp),%rbx
xchg   %ax,%ax
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
jne    1140 <disp_file+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @disp_file(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = call i64 @read(i32 %5, i8* %3, i32 1)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @write(i32 1, i8* %3, i32 1)
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @disp_file(i32 %0) {
%2 = alloca i8
%3 = call i64 @read(i32 %0, i8* %2, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1, %5
%6 = call i32 @write(i32 1, i8* %2, i32 1)
%7 = call i64 @read(i32 %0, i8* %2, i32 1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ ctime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, int);
void genatime(time_t now, char *atime) {
  bzero(atime, 30);
  strncpy(atime, ctime(&now), 26);
  atime[strlen(atime) - 1] = '\0';
}


x86 assembly (clang, -O0):
<genatime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1e,%esi
call   1060 <bzero@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <ctime@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    $0x1a,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genatime>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
mov    %rsi,%rdi
mov    $0x1e,%esi
call   1060 <bzero@plt>
lea    0xc(%rsp),%rdi
call   1040 <ctime@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1a,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @genatime(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @bzero(i8* %5, i32 30)
%7 = load i8*, i8** %4
%8 = call i32 @ctime(i32* %3)
%9 = call i32 @strncpy(i8* %7, i32 %8, i32 26)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %10, i64 %14
store i8 0, i8* %15
ret void
}

LLVM IR (-O2):
define void @genatime(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = tail call i32 @bzero(i8* %1, i32 30)
%5 = call i32 @ctime(i32* %3)
%6 = call i32 @strncpy(i8* %1, i32 %5, i32 26)
%7 = call i32 @strlen(i8* %1)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 0, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ two_branch();
void loop() {
  two_branch();
  for (;;) {
    two_branch();
  }
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <two_branch@plt>
mov    $0x0,%al
call   1030 <two_branch@plt>
jmp    111b <loop+0xb>

x86 assembly (clang, -O2):
<loop>:
push   %rax
xor    %eax,%eax
call   1030 <two_branch@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <two_branch@plt>
jmp    1120 <loop+0x10>

LLVM IR (-O0):
define void @loop() {
%1 = call i32 (...) @two_branch()
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @two_branch()
br label %2
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 (...) @two_branch()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @two_branch()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ MCUSendCmdContinueRecordCtrl(int);
void MCUSendCmdContinueRecordCtrlStop() { MCUSendCmdContinueRecordCtrl(1); }


x86 assembly (clang, -O0):
<MCUSendCmdContinueRecordCtrlStop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <MCUSendCmdContinueRecordCtrl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCUSendCmdContinueRecordCtrlStop>:
mov    $0x1,%edi
jmp    1030 <MCUSendCmdContinueRecordCtrl@plt>

LLVM IR (-O0):
define void @MCUSendCmdContinueRecordCtrlStop() {
%1 = call i32 @MCUSendCmdContinueRecordCtrl(i32 1)
ret void
}

LLVM IR (-O2):
define void @MCUSendCmdContinueRecordCtrlStop() {
%1 = tail call i32 @MCUSendCmdContinueRecordCtrl(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ greth_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  base_test();
  greth_test(0x80000b00);
  greth_test(0x80000c00);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0x80000b00,%edi
call   1040 <greth_test@plt>
mov    $0x80000c00,%edi
call   1040 <greth_test@plt>
mov    $0x0,%al
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0x80000b00,%edi
call   1040 <greth_test@plt>
mov    $0x80000c00,%edi
call   1040 <greth_test@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @greth_test(i32 -2147480832)
%4 = call i32 @greth_test(i32 -2147480576)
%5 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @greth_test(i32 -2147480832)
%4 = tail call i32 @greth_test(i32 -2147480576)
%5 = tail call i32 (...) @report_end()
ret i32 0
}
int compare_def(const void *x, const void *y) {
  return (x != y ? (x > y ? 1 : -1) : 0);
}


x86 assembly (clang, -O0):
<compare_def>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     113a <compare_def+0x3a>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmova  %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <compare_def+0x44>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <compare_def+0x44>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_def>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %rsi,%rdi
seta   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_def(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = icmp ugt i8* %9, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 -1
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %8
%16 = phi i32 [ %13, %8 ], [ 0, %14 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare_def(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = icmp ugt i8* %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
unsigned char inb(unsigned short port) {
  unsigned char r;
  asm volatile("inb %1, %0" : "=a"(r) : "Nd"(port));
  return r;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
gid_t octave_getegid_wrapper(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @octave_getegid_wrapper() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @octave_getegid_wrapper() {
ret i32 -1
}
void test10(void) {
  int si;
  unsigned int ui;
  long sl;
  _Bool b;
  b = (si == (ui = sl));
  b = (si == (ui = sl & 15));
}


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %ecx,-0x8(%rbp)
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
and    $0xf,%rcx
mov    %ecx,-0x8(%rbp)
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
mov    %al,-0x11(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test10() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i8
%5 = load i32, i32* %1
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = icmp eq i32 %5, %7
%9 = zext i1 %8 to i8
store i8 %9, i8* %4
%10 = load i32, i32* %1
%11 = load i64, i64* %3
%12 = and i64 %11, 15
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = icmp eq i32 %10, %13
%15 = zext i1 %14 to i8
store i8 %15, i8* %4
ret void
}

LLVM IR (-O2):
define void @test10() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void u16_to_bigendian(uint8_t *dst, uint16_t u16) {
  dst[0] = (u16 >> 8) & 0xFF;
  dst[1] = u16 & 0xFF;
}


x86 assembly (clang, -O0):
<u16_to_bigendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u16_to_bigendian>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @u16_to_bigendian(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @u16_to_bigendian(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Type definitions */
struct cleanup_stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cleanup_stack *);
void cleanup_destroy(struct cleanup_stack *stack) { free(stack); }


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

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

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

LLVM IR (-O2):
%struct.cleanup_stack = type { i32 }
define void @cleanup_destroy(%struct.cleanup_stack* nocapture %0) {
%2 = tail call i32 @free(%struct.cleanup_stack* %0)
ret void
}
int *mymalloc(int *a) { return a; }


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

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

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

LLVM IR (-O2):
define i32* @mymalloc(i32* readnone returned %0) {
ret i32* %0
}
void g_option_context_set_ignore_unknown_options() {}


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

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

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

LLVM IR (-O2):
define void @g_option_context_set_ignore_unknown_options() {
ret void
}