xunge/DecIR huggingface dataset:
/* Type definitions */
struct optee_header {
  int dummy;
};

/* Variables and functions */
int EPERM;
int optee_verify_image(struct optee_header *hdr, unsigned long tzdram_start,
                       unsigned long tzdram_len, unsigned long image_len) {
  return -EPERM;
}


x86 assembly (clang, -O0):
<optee_verify_image>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ebb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<optee_verify_image>:
mov    0x2ed1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.optee_header = type { i32 }
@EPERM = global i32 0
define i32 @optee_verify_image(%struct.optee_header* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.optee_header*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store %struct.optee_header* %0, %struct.optee_header** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32, i32* @EPERM
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.optee_header = type { i32 }
@EPERM = global i32 0
define i32 @optee_verify_image(%struct.optee_header* nocapture readnone %0, i64 %1, i64 %2, i64 %3) {
%5 = load i32, i32* @EPERM
%6 = sub nsw i32 0, %5
ret i32 %6
}
void av_read_pause() {}


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

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

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

LLVM IR (-O2):
define void @av_read_pause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stw_write(char const *, char const *);
void wo5_wayrel_keyval(const char *key, const char *val) {
  stw_write(key, val);
}


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

x86 assembly (clang, -O2):
<wo5_wayrel_keyval>:
jmp    1030 <stw_write@plt>

LLVM IR (-O0):
define void @wo5_wayrel_keyval(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 @stw_write(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @wo5_wayrel_keyval(i8* %0, i8* %1) {
%3 = tail call i32 @stw_write(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fb_hTimeDecodeSerial(double, int /*<<< orphan*/,
                                        int /*<<< orphan*/, int *, int);
int fb_Second(double serial) {
  int second;
  fb_hTimeDecodeSerial(serial, 0, 0, &second, 1);
  return second;
}


x86 assembly (clang, -O0):
<fb_Second>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %esi,%esi
lea    -0xc(%rbp),%rdx
mov    $0x1,%ecx
mov    %esi,%edi
call   1030 <fb_hTimeDecodeSerial@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_Second>:
push   %rax
lea    0x4(%rsp),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%ecx
call   1030 <fb_hTimeDecodeSerial@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fb_Second(double %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fb_hTimeDecodeSerial(double %0, i32 0, i32 0, i32* %2, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ grava_data();
int /*<<< orphan*/ sorteio();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  grava_data();
  sorteio();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <grava_data@plt>
xor    %eax,%eax
call   1030 <sorteio@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @grava_data()
%5 = call i32 (...) @sorteio()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @grava_data()
%4 = tail call i32 (...) @sorteio()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_gcc_version() {
  printf("GCC Version: "
         "%s\n",
         "9.4.0");
}


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

x86 assembly (clang, -O2):
<print_gcc_version>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"GCC Version: %s\0A\00"
@.str.1 = [6 x i8] c"9.4.0\00"
define void @print_gcc_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"GCC Version: %s\0A\00"
@.str.1 = [6 x i8] c"9.4.0\00"
define void @print_gcc_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ vafunction(int, int, int, int, int, int, int, int, int, int,
                              int);
int main(void) {
  vafunction(888., 999., 1., 2., 3., 4., 5., 6., 7., 8., 9.);
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x378,%edi
mov    $0x3e7,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x4,%r9d
movl   $0x5,(%rsp)
movl   $0x6,0x8(%rsp)
movl   $0x7,0x10(%rsp)
movl   $0x8,0x18(%rsp)
movl   $0x9,0x20(%rsp)
call   1030 <vafunction@plt>
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x378,%edi
mov    $0x3e7,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x4,%r9d
push   $0x9
push   $0x8
push   $0x7
push   $0x6
push   $0x5
call   1040 <vafunction@plt>
add    $0x30,%rsp
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @vafunction(i32 888, i32 999, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @vafunction(i32 888, i32 999, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void b_test() {
  int *s = NULL;
  *s = 42;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @b_test() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
scalar_t__ returns_23();
const char *test1(void) {
  if (returns_23())
    return 0;
  return "hi there";
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <returns_23@plt>
cmp    $0x0,%rax
je     1136 <test1+0x26>
movq   $0x0,-0x8(%rbp)
jmp    1141 <test1+0x31>
lea    0xec3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <returns_23@plt>
test   %rax,%rax
lea    0xedc(%rip),%rax
cmove  %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"hi there\00"
define i8* @test1() {
%1 = alloca i8*
%2 = call i64 (...) @returns_23()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* null, i8** %1
br label %6
5: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"hi there\00"
define i8* @test1() {
%1 = tail call i64 (...) @returns_23()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void server_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<server_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @server_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gasrint() { ol("asr.l\t&2,%d0"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"asr.l\09&2,%d0\00"
define i32 @gasrint() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"asr.l\09&2,%d0\00"
define i32 @gasrint() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AONRTCEventClear(uint32_t ui32Channel) {

  ;
  if (ui32Channel & 0x1) {
    (*((volatile unsigned long *)(0x40092000 + 0x00000004))) = 0x00000001;
  }
  if (ui32Channel & 0x2) {
    (*((volatile unsigned long *)(0x40092000 + 0x00000004))) = 0x00000100;
  }
  if (ui32Channel & 0x4) {
    (*((volatile unsigned long *)(0x40092000 + 0x00000004))) = 0x00010000;
  }
}


x86 assembly (clang, -O0):
<AONRTCEventClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1122 <AONRTCEventClear+0x22>
mov    $0x40092004,%eax
movq   $0x1,(%rax)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     113d <AONRTCEventClear+0x3d>
mov    $0x40092004,%eax
movq   $0x100,(%rax)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1158 <AONRTCEventClear+0x58>
mov    $0x40092004,%eax
movq   $0x10000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCEventClear>:
test   $0x1,%dil
jne    1113 <AONRTCEventClear+0x13>
test   $0x2,%dil
jne    1125 <AONRTCEventClear+0x25>
test   $0x4,%dil
jne    1137 <AONRTCEventClear+0x37>
ret
movq   $0x1,0x40092004
test   $0x2,%dil
je     110c <AONRTCEventClear+0xc>
movq   $0x100,0x40092004
test   $0x4,%dil
je     1112 <AONRTCEventClear+0x12>
movq   $0x10000,0x40092004
ret

LLVM IR (-O0):
define void @AONRTCEventClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store volatile i64 1, i64* inttoptr (i64 1074339844 to i64*)
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = and i32 %8, 2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store volatile i64 256, i64* inttoptr (i64 1074339844 to i64*)
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
%14 = and i32 %13, 4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store volatile i64 65536, i64* inttoptr (i64 1074339844 to i64*)
br label %17
17: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
define void @AONRTCEventClear(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store volatile i64 1, i64* inttoptr (i64 1074339844 to i64*)
br label %5
5: ; preds = %4, %1
%6 = and i32 %0, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5
store volatile i64 256, i64* inttoptr (i64 1074339844 to i64*)
br label %9
9: ; preds = %8, %5
%10 = and i32 %0, 4
%11 = icmp eq i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9
store volatile i64 65536, i64* inttoptr (i64 1074339844 to i64*)
br label %13
13: ; preds = %12, %9
ret void
}
/* Type definitions */
typedef int uint8_t;
struct pcg_state_16 {
  int dummy;
};

/* Variables and functions */
int pcg_mcg_16_xsh_rr_8_random_r(struct pcg_state_16 *);
uint8_t pcg_mcg_16_xsh_rr_8_boundedrand_r(struct pcg_state_16 *rng,
                                          uint8_t bound) {
  uint8_t threshold = ((uint8_t)(-bound)) % bound;
  for (;;) {
    uint8_t r = pcg_mcg_16_xsh_rr_8_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_mcg_16_xsh_rr_8_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_mcg_16_xsh_rr_8_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_mcg_16_xsh_rr_8_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_mcg_16_xsh_rr_8_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_mcg_16_xsh_rr_8_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_mcg_16_xsh_rr_8_random_r@plt>
test   %eax,%eax
js     1120 <pcg_mcg_16_xsh_rr_8_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_16 = type { i32 }
define i32 @pcg_mcg_16_xsh_rr_8_boundedrand_r(%struct.pcg_state_16* %0, i32 %1) {
%3 = alloca %struct.pcg_state_16*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_16* %0, %struct.pcg_state_16** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_16*, %struct.pcg_state_16** %3
%13 = call i32 @pcg_mcg_16_xsh_rr_8_random_r(%struct.pcg_state_16* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_16 = type { i32 }
define i32 @pcg_mcg_16_xsh_rr_8_boundedrand_r(%struct.pcg_state_16* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_mcg_16_xsh_rr_8_random_r(%struct.pcg_state_16* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sJ() {
  dot();
  dash();
  dash();
  dash();
  cBreak();
}


x86 assembly (clang, -O0):
<sJ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sJ>:
push   %rax
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sJ() {
%1 = call i32 (...) @dot()
%2 = call i32 (...) @dash()
%3 = call i32 (...) @dash()
%4 = call i32 (...) @dash()
%5 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sJ() {
%1 = tail call i32 (...) @dot()
%2 = tail call i32 (...) @dash()
%3 = tail call i32 (...) @dash()
%4 = tail call i32 (...) @dash()
%5 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
char *private_strdup(char const *);
char *strrchr(char const *, char);
char *lisys_path_basename(const char *path) {
  char *ptr;
  ptr = strrchr(path, '/');
  if (ptr == NULL)
    return private_strdup(path);
  return private_strdup(ptr + 1);
}


x86 assembly (clang, -O0):
<lisys_path_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115b <lisys_path_basename+0x3b>
mov    -0x10(%rbp),%rdi
call   1030 <private_strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    116c <lisys_path_basename+0x4c>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1030 <private_strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lisys_path_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1140 <lisys_path_basename+0x20>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rbx
jmp    1030 <private_strdup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <private_strdup@plt>

LLVM IR (-O0):
define i8* @lisys_path_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i8* @private_strdup(i8* %10)
store i8* %11, i8** %2
br label %16
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = call i8* @private_strdup(i8* %14)
store i8* %15, i8** %2
br label %16
16: ; preds = %12, %9
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
define i8* @lisys_path_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @private_strdup(i8* %0)
br label %9
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = tail call i8* @private_strdup(i8* %7)
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %10
}
/* Variables and functions */
scalar_t__ isupper(char);
char tolower(char);
void str_tolower(char *s) {
  for (; *s; s++)
    if (isupper(*s))
      *s = tolower(*s);
}


x86 assembly (clang, -O0):
<str_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1179 <str_tolower+0x59>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1163 <str_tolower+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1168 <str_tolower+0x48>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <str_tolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_tolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <str_tolower+0x35>
mov    %rdi,%rbx
jmp    113c <str_tolower+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <str_tolower+0x35>
movsbl %al,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     1130 <str_tolower+0x10>
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
jmp    1130 <str_tolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @str_tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @isupper(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @tolower(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %4, %9
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Variables and functions */
double pochhammer_func(double, int, int);
double falling_fact(double x, int n) { return pochhammer_func(x, n, -1); }


x86 assembly (clang, -O0):
<falling_fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    $0xffffffff,%esi
call   1030 <pochhammer_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @falling_fact(double %0, i32 %1) {
%3 = tail call double @pochhammer_func(double %0, i32 %1, i32 -1)
ret double %3
}
/* Type definitions */
typedef unsigned long long uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
uint8_t get_bits_required(uint64_t value) {
  uint8_t count = 63;
  while (count && !(value & (1ULL << count)))
    count--;
  return count;
}


x86 assembly (clang, -O0):
<get_bits_required>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x3f,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1142 <get_bits_required+0x42>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1152 <get_bits_required+0x52>
jmp    1163 <get_bits_required+0x63>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <get_bits_required+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bits_required>:
mov    $0x3f,%eax
cs nopw 0x0(%rax,%rax,1)
nop
bt     %rax,%rdi
jb     1140 <get_bits_required+0x40>
lea    -0x1(%rax),%ecx
movzbl %cl,%ecx
bt     %rcx,%rdi
jb     1137 <get_bits_required+0x37>
lea    -0x2(%rax),%ecx
movzbl %cl,%ecx
bt     %rcx,%rdi
jb     113c <get_bits_required+0x3c>
add    $0xfffffffffffffffd,%rax
jne    1110 <get_bits_required+0x10>
xor    %eax,%eax
ret
add    $0xffffffffffffffff,%rax
ret
add    $0xfffffffffffffffe,%rax
ret

LLVM IR (-O0):
define i64 @get_bits_required(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 63, i64* %3
br label %4
4: ; preds = %16, %1
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = shl i64 1, %9
%11 = and i64 %8, %10
%12 = icmp ne i64 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %7, %4
%15 = phi i1 [ false, %4 ], [ %13, %7 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i64, i64* %3
%18 = add i64 %17, -1
store i64 %18, i64* %3
br label %4
19: ; preds = %14
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @get_bits_required(i64 %0) {
br label %2
2: ; preds = %17, %1
%3 = phi i64 [ 63, %1 ], [ %18, %17 ]
%4 = shl nuw i64 1, %3
%5 = and i64 %4, %0
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %2
%8 = add nsw i64 %3, -1
%9 = shl nuw i64 1, %8
%10 = and i64 %9, %0
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = add nsw i64 %3, -2
%14 = shl nuw i64 1, %13
%15 = and i64 %14, %0
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = add nsw i64 %3, -3
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %2
20: ; preds = %17, %12, %7, %2
%21 = phi i64 [ %3, %2 ], [ %8, %7 ], [ %13, %12 ], [ 0, %17 ]
ret i64 %21
}
/* Variables and functions */
bool isEnglishLetter(char character) {
  return ((character >= 'a' && character <= 'z') ||
          (character >= 'A' && character <= 'Z'));
}


x86 assembly (clang, -O0):
<isEnglishLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isEnglishLetter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <isEnglishLetter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <isEnglishLetter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEnglishLetter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isEnglishLetter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
float c2f(int c) { return c * 1.8 + 32; }


x86 assembly (clang, -O0):
<c2f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2f>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @c2f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @llvm.fmuladd.f64(double %4, double 1.800000e+00, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @c2f(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void sighandler(int signo) {
  if (signo == SIGINT) {
    printf("You keyboard interrupted!\n");
    exit(3);
  }
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    1153 <sighandler+0x33>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
je     112e <sighandler+0xe>
pop    %rax
ret
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [27 x i8] c"You keyboard interrupted!\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 3)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [26 x i8] c"You keyboard interrupted!\00"
define void @sighandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 3)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, double);
int /*<<< orphan*/ stdout;
void ring_element_display(void *x, void *arg) {
  { arg = arg; }
  if (NULL != x)
    fprintf(stdout, "\tdisplay element {object=>0x%p,value=>%.3f}\n", x,
            *(double *)x);
}


x86 assembly (clang, -O0):
<ring_element_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1155 <ring_element_display+0x45>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_element_display>:
test   %rdi,%rdi
je     1131 <ring_element_display+0x21>
mov    %rdi,%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
movsd  (%rdx),%xmm0
lea    0xed4(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [45 x i8] c"\09display element {object=>0x%p,value=>%.3f}\0A\00"
define void @ring_element_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8* %5, i8** %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* null, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %10, double %13)
br label %15
15: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [45 x i8] c"\09display element {object=>0x%p,value=>%.3f}\0A\00"
define void @ring_element_display(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stdout
%6 = bitcast i8* %0 to double*
%7 = load double, double* %6
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, double %7)
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CompileHilevel();
int /*<<< orphan*/ Create();
int /*<<< orphan*/ GetWord();
void DoColonDefinition() {
  GetWord();
  Create();
  CompileHilevel();
}


x86 assembly (clang, -O0):
<DoColonDefinition>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GetWord@plt>
mov    $0x0,%al
call   1030 <Create@plt>
mov    $0x0,%al
call   1050 <CompileHilevel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoColonDefinition>:
push   %rax
xor    %eax,%eax
call   1040 <GetWord@plt>
xor    %eax,%eax
call   1030 <Create@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <CompileHilevel@plt>

LLVM IR (-O0):
define void @DoColonDefinition() {
%1 = call i32 (...) @GetWord()
%2 = call i32 (...) @Create()
%3 = call i32 (...) @CompileHilevel()
ret void
}

LLVM IR (-O2):
define void @DoColonDefinition() {
%1 = tail call i32 (...) @GetWord()
%2 = tail call i32 (...) @Create()
%3 = tail call i32 (...) @CompileHilevel()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_perf();
int /*<<< orphan*/ malloc_perf();
int main(int argc, char *argv[]) {
  malloc_perf();
  free_perf();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @malloc_perf()
%4 = tail call i32 (...) @free_perf()
ret i32 0
}
/* Type definitions */
union bpf_attr {
  int target_fd;
  int attach_bpf_fd;
  int attach_type;
};
typedef enum bpf_attach_type {
  ____Placeholder_bpf_attach_type
} bpf_attach_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_DETACH;
int /*<<< orphan*/ memset(union bpf_attr *, int /*<<< orphan*/, int);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_detach2(int prog_fd, int target_fd, enum bpf_attach_type type) {
  union bpf_attr attr;
  memset(&attr, 0, sizeof(attr));
  attr.target_fd = target_fd;
  attr.attach_bpf_fd = prog_fd;
  attr.attach_type = type;
  return sys_bpf(BPF_PROG_DETACH, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_detach2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_detach2>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebx,(%rsp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <sys_bpf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 @memset(%union.bpf_attr* %7, i32 0, i32 4)
%9 = load i32, i32* %5
%10 = bitcast %union.bpf_attr* %7 to i32*
store i32 %9, i32* %10
%11 = load i32, i32* %4
%12 = bitcast %union.bpf_attr* %7 to i32*
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = bitcast %union.bpf_attr* %7 to i32*
store i32 %13, i32* %14
%15 = load i32, i32* @BPF_PROG_DETACH
%16 = call i32 @sys_bpf(i32 %15, %union.bpf_attr* %7, i32 4)
ret i32 %16
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_PROG_DETACH = global i32 0
define i32 @bpf_prog_detach2(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = call i32 @memset(%union.bpf_attr* %4, i32 0, i32 4)
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
store i32 %2, i32* %7
%8 = load i32, i32* @BPF_PROG_DETACH
%9 = call i32 @sys_bpf(i32 %8, %union.bpf_attr* %4, i32 4)
ret i32 %9
}
/* Type definitions */
struct bitmap_t {
  int dummy;
};

/* Variables and functions */
struct bitmap_t *bitmap_alloc_zero();
int /*<<< orphan*/ bitmap_set_bit(size_t, int, struct bitmap_t *);
struct bitmap_t *bitmap_alloc_set(size_t bit) {
  struct bitmap_t *set = bitmap_alloc_zero();
  bitmap_set_bit(bit, 1, set);
  return set;
}


x86 assembly (clang, -O0):
<bitmap_alloc_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bitmap_alloc_zero@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1040 <bitmap_set_bit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_alloc_set>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <bitmap_alloc_zero@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %rax,%rdx
call   1040 <bitmap_set_bit@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.bitmap_t = type { i32 }
define %struct.bitmap_t* @bitmap_alloc_set(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.bitmap_t*
store i64 %0, i64* %2
%4 = call %struct.bitmap_t* (...) @bitmap_alloc_zero()
store %struct.bitmap_t* %4, %struct.bitmap_t** %3
%5 = load i64, i64* %2
%6 = load %struct.bitmap_t*, %struct.bitmap_t** %3
%7 = call i32 @bitmap_set_bit(i64 %5, i32 1, %struct.bitmap_t* %6)
%8 = load %struct.bitmap_t*, %struct.bitmap_t** %3
ret %struct.bitmap_t* %8
}

LLVM IR (-O2):
%struct.bitmap_t = type { i32 }
define %struct.bitmap_t* @bitmap_alloc_set(i64 %0) {
%2 = tail call %struct.bitmap_t* (...) @bitmap_alloc_zero()
%3 = tail call i32 @bitmap_set_bit(i64 %0, i32 1, %struct.bitmap_t* %2)
ret %struct.bitmap_t* %2
}
/* Variables and functions */
int iszero(const void *k, size_t len) {
  const unsigned char *start = k;
  const unsigned char *end = start + len;
  while (start < end)
    if (*start++)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<iszero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1157 <iszero+0x57>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,(%rax)
je     1152 <iszero+0x52>
movl   $0x0,-0x4(%rbp)
jmp    115e <iszero+0x5e>
jmp    1120 <iszero+0x20>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iszero>:
add    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %rsi,%rdi
jae    1121 <iszero+0x21>
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
je     1110 <iszero+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iszero(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
br label %4
4: ; preds = %7, %2
%5 = phi i8* [ %0, %2 ], [ %8, %7 ]
%6 = icmp ult i8* %5, %3
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4, %7
%12 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %12
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_append(void *m, const char *types, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_append>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_append(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_append(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int js_AlertYesNo(const char *title, const char *message) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @js_AlertYesNo(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void rop3_61_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | S;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_61_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_61_0_0>:
mov    (%rdi),%al
or     %sil,%al
not    %al
or     %dl,%al
xor    %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_61_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_61_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %5, -1
%7 = or i8 %6, %2
%8 = xor i8 %7, %1
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char s[1024];
  scanf("%s", s);
  reverse(s, &s[strlen(s) - 1]);
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x400(%rbp),%rax
mov    %rax,-0x408(%rbp)
lea    -0x400(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x408(%rbp),%rdi
sub    $0x1,%eax
cltq
lea    -0x400(%rbp),%rsi
add    %rax,%rsi
call   1030 <reverse@plt>
lea    -0x400(%rbp),%rsi
lea    0xe62(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xeb1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rax,%rbx,1),%rsi
add    $0xffffffffffffffff,%rsi
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xe88(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %8
%10 = call i32 @reverse(i8* %4, i8* %9)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %6
%8 = call i32 @reverse(i8* %2, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}