xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool ComparatorValueGet(uint32_t ui32Base, uint32_t ui32Comp) {
  ;
  ;
  if ((*((volatile unsigned long *)(ui32Base + (ui32Comp * 0x20) +
                                    0x00000020))) &
      0x00000002) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<ComparatorValueGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
add    $0x20,%eax
cltq
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     1137 <ComparatorValueGet+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <ComparatorValueGet+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorValueGet>:
shl    $0x5,%esi
lea    (%rdi,%rsi,1),%eax
add    $0x20,%eax
cltq
mov    (%rax),%rax
shr    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ComparatorValueGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = mul nsw i32 %7, 32
%9 = add nsw i32 %6, %8
%10 = add nsw i32 %9, 32
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, 2
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 1, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @ComparatorValueGet(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = add i32 %0, 32
%5 = add i32 %4, %3
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = lshr i32 %9, 1
%11 = and i32 %10, 1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rcv_filenames(int);
void list(int sock) {
  rcv_filenames(sock);
  printf("All Done!\n");
}


x86 assembly (clang, -O0):
<list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rcv_filenames@plt>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list>:
push   %rax
call   1040 <rcv_filenames@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"All Done!\0A\00"
define void @list(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rcv_filenames(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"All Done!\00"
define void @list(i32 %0) {
%2 = tail call i32 @rcv_filenames(i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
int get_x(int codificado) { return codificado / 100; }


x86 assembly (clang, -O0):
<get_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_x>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get_x(i32 %0) {
%2 = sdiv i32 %0, 100
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void libcpp_test_c_echo_function(int val) { printf("val=%d\n", val); }


x86 assembly (clang, -O0):
<libcpp_test_c_echo_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcpp_test_c_echo_function>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"val=%d\0A\00"
define void @libcpp_test_c_echo_function(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar24(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 24, v);
}


x86 assembly (clang, -O0):
<setDrawbar24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x18,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar24>:
mov    %esi,%edx
mov    $0x18,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar24(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 24, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar24(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 24, i8 zeroext %1)
ret void
}
int main(void) {
  for (;;)
    continue;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
unsigned long long __bextri_u64(unsigned long long, int);
unsigned long long ___bextri_u64(unsigned long long A, int const I) {
  return __bextri_u64(A, 1);
}


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

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

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

LLVM IR (-O2):
define i64 @___bextri_u64(i64 %0, i32 %1) {
%3 = tail call i64 @__bextri_u64(i64 %0, i32 1)
ret i64 %3
}
long op(long x, long y) { return x / y; }


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

x86 assembly (clang, -O2):
<op>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <op+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @op(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sdiv i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @op(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int setregid(int, int /*<<< orphan*/);
int setegid(gid_t egid) { return setregid(-1, egid); }


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

x86 assembly (clang, -O2):
<setegid>:
mov    %edi,%esi
mov    $0xffffffff,%edi
jmp    1030 <setregid@plt>

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

LLVM IR (-O2):
define i32 @setegid(i32 %0) {
%2 = tail call i32 @setregid(i32 -1, i32 %0)
ret i32 %2
}
void av_codec_set_codec_descriptor() {}


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

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

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

LLVM IR (-O2):
define void @av_codec_set_codec_descriptor() {
ret void
}
int main() {
  for (unsigned i = 0; i < 10; i++)
    ;
  for (char i = 0; i < 10; i++)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
movb   $0x0,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jge    1152 <main+0x52>
jmp    1145 <main+0x45>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1133 <main+0x33>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int do_rtc_read_ioctl(int, struct tm *);
int open_rtc_or_exit();
int read_hardware_clock_rtc(struct tm *tm) {
  int rtc_fd, rc;
  rtc_fd = open_rtc_or_exit();
  rc = do_rtc_read_ioctl(rtc_fd, tm);
  return rc;
}


x86 assembly (clang, -O0):
<read_hardware_clock_rtc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <open_rtc_or_exit@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <do_rtc_read_ioctl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_hardware_clock_rtc>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <open_rtc_or_exit@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <do_rtc_read_ioctl@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @read_hardware_clock_rtc(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i32
%4 = alloca i32
store %struct.tm* %0, %struct.tm** %2
%5 = call i32 (...) @open_rtc_or_exit()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load %struct.tm*, %struct.tm** %2
%8 = call i32 @do_rtc_read_ioctl(i32 %6, %struct.tm* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @read_hardware_clock_rtc(%struct.tm* %0) {
%2 = tail call i32 (...) @open_rtc_or_exit()
%3 = tail call i32 @do_rtc_read_ioctl(i32 %2, %struct.tm* %0)
ret i32 %3
}
void ath9k_dfs_init_debug(struct ath_softc *sc) {}


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

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

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

LLVM IR (-O2):
%struct.ath_softc = type opaque
define void @ath9k_dfs_init_debug(%struct.ath_softc* nocapture %0) {
ret void
}
void __DELETE_java_util_AbstractList(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_util_AbstractList(i8* nocapture %0, i8* nocapture %1) {
ret void
}
char valeurTelecommandeEstPasNeutre(unsigned char valeur) {
  if ((valeur >= 128 + 10) || (valeur <= 128 - 10)) {
    return -1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<valeurTelecommandeEstPasNeutre>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x8a,%eax
jge    1126 <valeurTelecommandeEstPasNeutre+0x26>
movzbl -0x2(%rbp),%eax
cmp    $0x76,%eax
jg     112f <valeurTelecommandeEstPasNeutre+0x2f>
movb   $0xff,-0x1(%rbp)
jmp    1133 <valeurTelecommandeEstPasNeutre+0x33>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valeurTelecommandeEstPasNeutre>:
add    $0x76,%dil
cmp    $0xed,%dil
sbb    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @valeurTelecommandeEstPasNeutre(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 138
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 118
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 -1, i8* %2
br label %13
12: ; preds = %7
store i8 0, i8* %2
br label %13
13: ; preds = %12, %11
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @valeurTelecommandeEstPasNeutre(i8 zeroext %0) {
%2 = add i8 %0, 118
%3 = icmp ult i8 %2, -19
%4 = sext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int RAND_MAX;
int rand();
int random_in_range(int m, int n) {
  return m + (rand() / (RAND_MAX / (n - m + 1) + 1));
}


x86 assembly (clang, -O0):
<random_in_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_in_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %eax,%esi
add    $0x1,%esi
mov    %ecx,%eax
cltd
idiv   %esi
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @random_in_range(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 = call i32 (...) @rand()
%7 = load i32, i32* @RAND_MAX
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sdiv i32 %7, %11
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %6, %13
%15 = add nsw i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @random_in_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = sdiv i32 %4, %6
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %3, %8
%10 = add nsw i32 %9, %0
ret i32 %10
}
int g_is_leap_year(int year) {
  return (year % 4 == 0) && !((year % 100 == 0) && (year % 400 != 0));
}


x86 assembly (clang, -O0):
<g_is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1155 <g_is_leap_year+0x55>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <g_is_leap_year+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <g_is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <g_is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @g_is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int _func_xpath_operators(char *, void *, int, int);
int _func_xpath_operator_sup(char *chunk, void *data) {
  return _func_xpath_operators(chunk, data, 4, 6);
}


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

x86 assembly (clang, -O2):
<_func_xpath_operator_sup>:
mov    $0x4,%edx
mov    $0x6,%ecx
jmp    1030 <_func_xpath_operators@plt>

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

LLVM IR (-O2):
define i32 @_func_xpath_operator_sup(i8* %0, i8* %1) {
%3 = tail call i32 @_func_xpath_operators(i8* %0, i8* %1, i32 4, i32 6)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  foo(3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ coap_encode_var_safe(int /*<<< orphan*/ *, int, unsigned int);
int coap_encode_var_bytes(uint8_t *buf, unsigned int value) {
  return (int)coap_encode_var_safe(buf, sizeof(value), value);
}


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

x86 assembly (clang, -O2):
<coap_encode_var_bytes>:
mov    %esi,%edx
mov    $0x4,%esi
jmp    1030 <coap_encode_var_safe@plt>

LLVM IR (-O0):
define i32 @coap_encode_var_bytes(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 i64 @coap_encode_var_safe(i32* %5, i32 4, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @coap_encode_var_bytes(i32* %0, i32 %1) {
%3 = tail call i64 @coap_encode_var_safe(i32* %0, i32 4, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
void circleCalculate(float r) {
  float perimeter, area;
  const float PI = 3.14159;
  perimeter = 2 * PI * r;
  area = PI * (r * r);
  printf("The circle with radius %.2f has an perimeter %.2f and area %.2f\n", r,
         perimeter, area);
}


x86 assembly (clang, -O0):
<circleCalculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xed2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xeb2(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circleCalculate>:
movss  0xee8(%rip),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  0xed9(%rip),%xmm2
lea    0xed6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"The circle with radius %.2f has an perimeter %.2f and area %.2f\0A\00"
define void @circleCalculate(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %2
store float 0x400921FA00000000, float* %5
%6 = load float, float* %2
%7 = fmul float 0x401921FA00000000, %6
store float %7, float* %3
%8 = load float, float* %2
%9 = load float, float* %2
%10 = fmul float %8, %9
%11 = fmul float 0x400921FA00000000, %10
store float %11, float* %4
%12 = load float, float* %2
%13 = load float, float* %3
%14 = load float, float* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), float %12, float %13, float %14)
ret void
}

LLVM IR (-O2):
@.str = [65 x i8] c"The circle with radius %.2f has an perimeter %.2f and area %.2f\0A\00"
define void @circleCalculate(float %0) {
%2 = fmul float %0, 0x401921FA00000000
%3 = fmul float %0, %0
%4 = fmul float %3, 0x400921FA00000000
%5 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), float %0, float %2, float %4)
ret void
}
/* Variables and functions */
char *getAuthor();
char *getPub();
char *getPubYear();
char *getTitle();
char *getURL();
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *);
void webCitation() {
  printf("%s. \"%s\". %s. %s. %s.\n", getAuthor(), getTitle(), getPub(),
         getPubYear(), getURL());
}


x86 assembly (clang, -O0):
<webCitation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1060 <getAuthor@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <getTitle@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getPub@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1080 <getPubYear@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <getURL@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    %rax,%r9
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<webCitation>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1060 <getAuthor@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <getTitle@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1030 <getPub@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1080 <getPubYear@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1070 <getURL@plt>
lea    0xe62(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
mov    %rax,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s. \22%s\22. %s. %s. %s.\0A\00"
define void @webCitation() {
%1 = call i8* (...) @getAuthor()
%2 = call i8* (...) @getTitle()
%3 = call i8* (...) @getPub()
%4 = call i8* (...) @getPubYear()
%5 = call i8* (...) @getURL()
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s. \22%s\22. %s. %s. %s.\0A\00"
define void @webCitation() {
%1 = tail call i8* (...) @getAuthor()
%2 = tail call i8* (...) @getTitle()
%3 = tail call i8* (...) @getPub()
%4 = tail call i8* (...) @getPubYear()
%5 = tail call i8* (...) @getURL()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
__attribute__((weak)) extern void __aeabi_memcpy8(void *dest, void *src,
                                                  unsigned int n) {
  memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memcpy8>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memcpy8(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
void ieee80211_proc_deinit_virtual(struct net_device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define void @ieee80211_proc_deinit_virtual(%struct.net_device* nocapture %0) {
ret void
}
indreg0adr1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((*p0) <= (*((short *)(11111111 & ~(__alignof__(short) - 1)))))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
mov    $0xa98ac6,%ecx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1142 <indreg0adr1+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <indreg0adr1+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adr1>:
movzwl (%r8),%ecx
xor    %eax,%eax
cmp    0xa98ac6,%cx
setle  %al
ret

LLVM IR (-O0):
define i32 @indreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = sext i16 %17 to i32
%19 = load i16, i16* inttoptr (i64 11111110 to i16*)
%20 = sext i16 %19 to i32
%21 = icmp sle i32 %18, %20
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %24
23: ; preds = %6
store i32 0, i32* %7
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @indreg0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = load i16, i16* %4
%8 = load i16, i16* inttoptr (i64 11111110 to i16*)
%9 = icmp sle i16 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
int is_label_longer_than_allowed(u_int32_t size_between_dots) {
  return size_between_dots > 63;
}


x86 assembly (clang, -O0):
<is_label_longer_than_allowed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3f,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_label_longer_than_allowed>:
xor    %eax,%eax
cmp    $0x40,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @is_label_longer_than_allowed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 63
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_label_longer_than_allowed(i32 %0) {
%2 = icmp sgt i32 %0, 63
%3 = zext i1 %2 to i32
ret i32 %3
}
int fun566() { return 566; }


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

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

LLVM IR (-O0):
define i32 @fun566() {
ret i32 566
}

LLVM IR (-O2):
define i32 @fun566() {
ret i32 566
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *str = "   teste";
  while (*str++ == ' ')
    ;
  str--;
  printf("%s", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    114a <main+0x3a>
jmp    112a <main+0x1a>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c" teste\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 3))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SyOSHeapFree(void *pPtr) { free(pPtr); }


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

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

LLVM IR (-O2):
define void @SyOSHeapFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double dnrm2_(int *, double const *, int *);
double call_dnrm2(int n, const double *x, int incx) {
  return dnrm2_(&n, x, &incx);
}


x86 assembly (clang, -O0):
<call_dnrm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
call   1030 <dnrm2_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_dnrm2>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
call   1030 <dnrm2_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define double @call_dnrm2(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %2, i32* %5
%6 = call double @dnrm2_(i32* %4, double* %1, i32* %5)
ret double %6
}
/* Type definitions */
struct json_value_s {
  int dummy;
};

/* Variables and functions */
struct json_value_s *json_extract_value_ex(struct json_value_s const *,
                                           int /*<<< orphan*/,
                                           int /*<<< orphan*/);
struct json_value_s *json_extract_value(const struct json_value_s *value) {
  return json_extract_value_ex(value, 0, 0);
}


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

x86 assembly (clang, -O2):
<json_extract_value>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <json_extract_value_ex@plt>

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

LLVM IR (-O2):
%struct.json_value_s = type { i32 }
define %struct.json_value_s* @json_extract_value(%struct.json_value_s* %0) {
%2 = tail call %struct.json_value_s* @json_extract_value_ex(%struct.json_value_s* %0, i32 0, i32 0)
ret %struct.json_value_s* %2
}
/* Variables and functions */
int /*<<< orphan*/ restart(int);
void RST_18() { restart(0x18); }


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

x86 assembly (clang, -O2):
<RST_18>:
mov    $0x18,%edi
jmp    1030 <restart@plt>

LLVM IR (-O0):
define void @RST_18() {
%1 = call i32 @restart(i32 24)
ret void
}

LLVM IR (-O2):
define void @RST_18() {
%1 = tail call i32 @restart(i32 24)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: sulogin [-e] [-p] [-t timeout] [tty device]\n");
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: sulogin [-e] [-p] [-t timeout] [tty device]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Usage: sulogin [-e] [-p] [-t timeout] [tty device]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
void redisplay(void) { clear(); }


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

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

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

LLVM IR (-O2):
define void @redisplay() {
%1 = tail call i32 (...) @clear()
ret void
}
/* Variables and functions */
int strlen(const char *str) {
  int length = 0;
  while (*(str++) != '\0') {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ gather_data();
int /*<<< orphan*/ setup_state();
int /*<<< orphan*/ wait_for_mam();
int main() {
  setup_state();
  wait_for_mam();
  gather_data();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup_state@plt>
mov    $0x0,%al
call   1030 <wait_for_mam@plt>
mov    $0x0,%al
call   1050 <gather_data@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <setup_state@plt>
xor    %eax,%eax
call   1030 <wait_for_mam@plt>
xor    %eax,%eax
call   1050 <gather_data@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_state()
%2 = tail call i32 (...) @wait_for_mam()
%3 = tail call i32 (...) @gather_data()
ret i32 0
}
/* Variables and functions */
scalar_t__ EBADF;
int /*<<< orphan*/ F_GETFD;
scalar_t__ errno;
int fcntl(int, int /*<<< orphan*/);
int fd_is_valid(int fd) { return fcntl(fd, F_GETFD) != -1 || errno != EBADF; }


x86 assembly (clang, -O0):
<fd_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0xffffffff,%ecx
mov    %al,-0x5(%rbp)
jne    1156 <fd_is_valid+0x46>
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_is_valid>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
setne  %al
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e9a(%rip),%rdx
cmp    (%rdx),%rcx
setne  %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @fd_is_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_GETFD
%5 = call i32 @fcntl(i32 %3, i32 %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EBADF
%10 = icmp ne i64 %8, %9
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @fd_is_valid(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EBADF
%7 = icmp ne i64 %5, %6
%8 = select i1 %4, i1 true, i1 %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int bswap_16(unsigned long);
unsigned long bswap_32(unsigned long __x) {
  return (bswap_16(__x & 0xffff) << 16) | (bswap_16(__x >> 16));
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
and    $0xffff,%rdi
call   1030 <bswap_16@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
shr    $0x10,%rdi
call   1030 <bswap_16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movzwl %bx,%edi
call   1030 <bswap_16@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
shr    $0x10,%rbx
mov    %rbx,%rdi
call   1030 <bswap_16@plt>
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @bswap_32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = call i32 @bswap_16(i64 %4)
%6 = shl i32 %5, 16
%7 = load i64, i64* %2
%8 = lshr i64 %7, 16
%9 = call i32 @bswap_16(i64 %8)
%10 = or i32 %6, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @bswap_32(i64 %0) {
%2 = and i64 %0, 65535
%3 = tail call i32 @bswap_16(i64 %2)
%4 = shl i32 %3, 16
%5 = lshr i64 %0, 16
%6 = tail call i32 @bswap_16(i64 %5)
%7 = or i32 %4, %6
%8 = sext i32 %7 to i64
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_stream_restore_sudirribe() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_stream_restore_sudirribe"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_ext_stream_restore_sudirribe\0A\00"
define i32 @pa_ext_stream_restore_sudirribe() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_ext_stream_restore_sudirribe\00"
define i32 @pa_ext_stream_restore_sudirribe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int args1(void *arg) {
  void *local = 0;
  return local;
}


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

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

LLVM IR (-O0):
define i32 @args1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @args1(i8* nocapture readnone %0) {
ret i32 0
}
void kill_game() {}


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

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

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

LLVM IR (-O2):
define void @kill_game() {
ret void
}
/* Variables and functions */
scalar_t__ eMalloc(int);
scalar_t__ popNumber();
int /*<<< orphan*/ pushString(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void basHex() {
  int i;
  char *buffer = (char *)eMalloc(16);
  i = (int)popNumber();
  sprintf(buffer, "%x", i);
  pushString(buffer);
}


x86 assembly (clang, -O0):
<basHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1030 <eMalloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe92(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pushString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basHex>:
push   %rbx
mov    $0x10,%edi
call   1030 <eMalloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <popNumber@plt>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pushString@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define void @basHex() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i64 @eMalloc(i32 16)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = call i64 (...) @popNumber()
%6 = trunc i64 %5 to i32
store i32 %6, i32* %1
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %2
%11 = call i32 @pushString(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @basHex() {
%1 = tail call i64 @eMalloc(i32 16)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i64 (...) @popNumber()
%4 = trunc i64 %3 to i32
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @pushString(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int);
main() {
  int x = foo(20);
  if (x != 62)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3e,-0x8(%rbp)
je     114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <foo@plt>
cmp    $0x3e,%eax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @foo(i32 20)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 62
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 20)
%2 = icmp eq i32 %1, 62
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t lseek(int fd, off_t pos, int whence) { return 0; }


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

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

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
ret i32 0
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}