xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ prcode(int /*<<< orphan*/ *, char *);
void generateSipImportVariables(FILE *fp) {
  prcode(fp, "    PyObject *sip_sipmod, *sip_capiobj;\n"
             "\n");
}


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

x86 assembly (clang, -O2):
<generateSipImportVariables>:
lea    0xee9(%rip),%rsi
jmp    1030 <prcode@plt>

LLVM IR (-O0):
@.str = [42 x i8] c" PyObject *sip_sipmod, *sip_capiobj;\0A\0A\00"
define void @generateSipImportVariables(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @prcode(i32* %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c" PyObject *sip_sipmod, *sip_capiobj;\0A\0A\00"
define void @generateSipImportVariables(i32* %0) {
%2 = tail call i32 @prcode(i32* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_fun(int x, int y) {
  while ((x > 0) && (y > 0)) {
    if (x > y) {
      while (x > 0) {
        x = x - 1;
      }
    } else {
      while (y > 0) {
        y = y - 1;
      }
    }
  }
  return x + y;
}


x86 assembly (clang, -O0):
<test_fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jle    1123 <test_fun+0x23>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1133 <test_fun+0x33>
jmp    1188 <test_fun+0x88>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1161 <test_fun+0x61>
jmp    1144 <test_fun+0x44>
cmpl   $0x0,-0x4(%rbp)
jle    115c <test_fun+0x5c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <test_fun+0x44>
jmp    1183 <test_fun+0x83>
jmp    1166 <test_fun+0x66>
cmpl   $0x0,-0x8(%rbp)
jle    117e <test_fun+0x7e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <test_fun+0x66>
jmp    1183 <test_fun+0x83>
jmp    110a <test_fun+0xa>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fun>:
test   %edi,%edi
setg   %r8b
test   %esi,%esi
setg   %dl
xor    %ecx,%ecx
cmp    %esi,%edi
mov    $0x0,%eax
cmova  %esi,%eax
cmovbe %edi,%ecx
test   %dl,%r8b
cmove  %edi,%ecx
cmove  %esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %33, %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %34
13: ; preds = %11
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %13
br label %18
18: ; preds = %21, %17
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %3
br label %18
24: ; preds = %18
br label %33
25: ; preds = %13
br label %26
26: ; preds = %29, %25
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, 1
store i32 %31, i32* %4
br label %26
32: ; preds = %26
br label %33
33: ; preds = %32, %24
br label %5
34: ; preds = %11
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = add nsw i32 %35, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @test_fun(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
%4 = icmp sgt i32 %1, 0
%5 = and i1 %3, %4
%6 = icmp ugt i32 %0, %1
%7 = select i1 %6, i32 %1, i32 0
%8 = and i1 %5, %6
%9 = select i1 %8, i32 0, i32 %0
%10 = select i1 %5, i32 %7, i32 %1
%11 = add nsw i32 %10, %9
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fn_ptr01(void) { printf("fn_ptr01\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"fn_ptr01\00"
define void @fn_ptr01() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVUTIL_CLOSESOCKET(int);
int stream_request_disconnect(int fd) { EVUTIL_CLOSESOCKET(fd); }


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

x86 assembly (clang, -O2):
<stream_request_disconnect>:
jmp    1030 <EVUTIL_CLOSESOCKET@plt>

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

LLVM IR (-O2):
define i32 @stream_request_disconnect(i32 %0) {
%2 = tail call i32 @EVUTIL_CLOSESOCKET(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void help(void) {
  char *help = ""
               "Usage: jail-init [OPTION]...\n"
               "jail init process.\n"
               "  -u            user name.\n"
               "  -l            lock file fd.\n"
               "  -h            help message.\n"
               "\n";
  printf("%s", help);
}


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

x86 assembly (clang, -O2):
<help>:
lea    0xf72(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [137 x i8] c"Usage: jail-init [OPTION]...\0Ajail init process.\0A -u user name.\0A -l lock file fd.\0A -h help message.\0A\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [137 x i8] c"Usage: jail-init [OPTION]...\0Ajail init process.\0A -u user name.\0A -l lock file fd.\0A -h help message.\0A\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GETVAL;
int /*<<< orphan*/ printf(char *, int, int);
int semctl(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
void dispval(int sid, int member) {
  int semval;
  semval = semctl(sid, member, GETVAL, 0);
  printf("semval for member %d is %d\n", member, semval);
}


x86 assembly (clang, -O0):
<dispval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1040 <semctl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispval>:
push   %rbx
mov    %esi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1040 <semctl@plt>
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@GETVAL = global i32 0
@.str = [28 x i8] c"semval for member %d is %d\0A\00"
define void @dispval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = load i32, i32* @GETVAL
%9 = call i32 @semctl(i32 %6, i32 %7, i32 %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@GETVAL = global i32 0
@.str = [28 x i8] c"semval for member %d is %d\0A\00"
define void @dispval(i32 %0, i32 %1) {
%3 = load i32, i32* @GETVAL
%4 = tail call i32 @semctl(i32 %0, i32 %1, i32 %3, i32 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_ll_instruction_write(int);
int8_t hd44780_set_cgram_address(uint8_t cgram_address) {
  uint8_t data = 0x40;
  data = data | (cgram_address & 0x3F);
  return (hd44780_ll_instruction_write(data));
}


x86 assembly (clang, -O0):
<hd44780_set_cgram_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x40,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hd44780_ll_instruction_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd44780_set_cgram_address>:
and    $0x3f,%edi
or     $0x40,%edi
jmp    1030 <hd44780_ll_instruction_write@plt>

LLVM IR (-O0):
define i32 @hd44780_set_cgram_address(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 64, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = and i32 %5, 63
%7 = or i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @hd44780_ll_instruction_write(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @hd44780_set_cgram_address(i32 %0) {
%2 = and i32 %0, 63
%3 = or i32 %2, 64
%4 = tail call i32 @hd44780_ll_instruction_write(i32 %3)
ret i32 %4
}
/* Type definitions */
struct rewrite_batch {
  int dummy;
};
struct fsm {
  int dummy;
};

/* Variables and functions */
struct fsm *fsm_concat(struct fsm *, struct fsm *);
struct fsm *fsm_minimize(struct fsm *);
struct fsm *rewrite_any_4tape(struct rewrite_batch *);
struct fsm *rewr_contains(struct rewrite_batch *rb, struct fsm *lang) {
  return fsm_minimize(fsm_concat(rewrite_any_4tape(rb),
                                 fsm_concat(lang, rewrite_any_4tape(rb))));
}


x86 assembly (clang, -O0):
<rewr_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <rewrite_any_4tape@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <rewrite_any_4tape@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1040 <fsm_concat@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
call   1040 <fsm_concat@plt>
mov    %rax,%rdi
call   1030 <fsm_minimize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewr_contains>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <rewrite_any_4tape@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1050 <rewrite_any_4tape@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fsm_concat@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <fsm_concat@plt>
mov    %rax,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fsm_minimize@plt>

LLVM IR (-O0):
%struct.rewrite_batch = type { i32 }
%struct.fsm = type { i32 }
define %struct.fsm* @rewr_contains(%struct.rewrite_batch* %0, %struct.fsm* %1) {
%3 = alloca %struct.rewrite_batch*
%4 = alloca %struct.fsm*
store %struct.rewrite_batch* %0, %struct.rewrite_batch** %3
store %struct.fsm* %1, %struct.fsm** %4
%5 = load %struct.rewrite_batch*, %struct.rewrite_batch** %3
%6 = call %struct.fsm* @rewrite_any_4tape(%struct.rewrite_batch* %5)
%7 = load %struct.fsm*, %struct.fsm** %4
%8 = load %struct.rewrite_batch*, %struct.rewrite_batch** %3
%9 = call %struct.fsm* @rewrite_any_4tape(%struct.rewrite_batch* %8)
%10 = call %struct.fsm* @fsm_concat(%struct.fsm* %7, %struct.fsm* %9)
%11 = call %struct.fsm* @fsm_concat(%struct.fsm* %6, %struct.fsm* %10)
%12 = call %struct.fsm* @fsm_minimize(%struct.fsm* %11)
ret %struct.fsm* %12
}

LLVM IR (-O2):
%struct.rewrite_batch = type { i32 }
%struct.fsm = type { i32 }
define %struct.fsm* @rewr_contains(%struct.rewrite_batch* %0, %struct.fsm* %1) {
%3 = tail call %struct.fsm* @rewrite_any_4tape(%struct.rewrite_batch* %0)
%4 = tail call %struct.fsm* @rewrite_any_4tape(%struct.rewrite_batch* %0)
%5 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %1, %struct.fsm* %4)
%6 = tail call %struct.fsm* @fsm_concat(%struct.fsm* %3, %struct.fsm* %5)
%7 = tail call %struct.fsm* @fsm_minimize(%struct.fsm* %6)
ret %struct.fsm* %7
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long long get_time() {
  struct timespec ctime;
  clock_gettime(CLOCK_REALTIME, &ctime);
  unsigned long long time = ctime.tv_sec * 1e9 + ctime.tv_nsec;
  return time;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xead(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl (%rsp),%xmm0
cvtsi2sdl 0x4(%rsp),%xmm1
mulsd  0xecb(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xebb(%rip),%xmm0
cvttsd2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @get_time() {
%1 = alloca %struct.timespec
%2 = alloca i64
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %7, double 1.000000e+09, double %10)
%12 = fptoui double %11 to i64
store i64 %12, i64* %2
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_REALTIME = global i32 0
define i64 @get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %7, double 1.000000e+09, double %10)
%12 = fptoui double %11 to i64
ret i64 %12
}
/* Variables and functions */
float scalbnf(float, int);
float test7f(float x, int exp) { return scalbnf(x, exp); }


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

x86 assembly (clang, -O2):
<test7f>:
jmp    1030 <scalbnf@plt>

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

LLVM IR (-O2):
define float @test7f(float %0, i32 %1) {
%3 = tail call float @scalbnf(float %0, i32 %1)
ret float %3
}
void cdrc2a(charac, asci) char *charac;
int *asci;
{ *asci = (int)charac[0]; }


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

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

LLVM IR (-O0):
define void @cdrc2a(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i32*, i32** %4
store i32 %8, i32* %9
ret void
}

LLVM IR (-O2):
define void @cdrc2a(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void sigint_handler(int sig) { write(0, "Ahhh! SIGINT!\n", 14); }


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handler>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
mov    $0xe,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Ahhh! SIGINT!\0A\00"
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @write(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Ahhh! SIGINT!\0A\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @write(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}
unsigned int hash_password(char *s) {
  unsigned int hash = 0x1505;
  int i;
  for (i = 0; s[i] != 0; i++) {
    hash = (hash * 32 + hash) + s[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_password>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <hash_password+0x53>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <hash_password+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_password>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash_password+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash_password+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_password(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = sext i8 %6 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ bar();
int main() {
  bar();
  abort();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct winsize {
  int ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int number_of_columns(void) {
  struct winsize ws;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
  int n = ws.ws_col - 5;
  return n > 128 ? 128 : n;
}


x86 assembly (clang, -O0):
<number_of_columns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jle    1156 <number_of_columns+0x46>
mov    $0x80,%eax
mov    %eax,-0x10(%rbp)
jmp    115c <number_of_columns+0x4c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_columns>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%ecx
cmp    $0x85,%ecx
mov    $0x85,%eax
cmovl  %ecx,%eax
add    $0xfffffffb,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @number_of_columns() {
%1 = alloca %struct.winsize
%2 = alloca i32
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sub nsw i32 %7, 5
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 128
br i1 %10, label %11, label %12
11: ; preds = %0
br label %14
12: ; preds = %0
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %11
%15 = phi i32 [ 128, %11 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @number_of_columns() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp slt i32 %7, 133
%9 = select i1 %8, i32 %7, i32 133
%10 = add nsw i32 %9, -5
ret i32 %10
}
double sqrt(double x) {
  __asm__ __volatile__("sqrtsd %1, %0" : "=x"(x) : "x"(x));
  return x;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
sqrtsd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
sqrtsd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm sideeffect "sqrtsd $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double asm sideeffect "sqrtsd $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
Vadd(a, b, c) double a[3], b[3], c[3];
{
  a[0] = b[0] + c[0];
  a[1] = b[1] + c[1];
  a[2] = b[2] + c[2];
}


x86 assembly (clang, -O0):
<Vadd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x20(%rbp),%rax
addsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vadd>:
movsd  (%rsi),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define i32 @Vadd(double* %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
%8 = load double*, double** %6
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %7
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = fadd double %10, %13
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 0
store double %14, double* %16
%17 = load double*, double** %6
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %7
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fadd double %19, %22
%24 = load double*, double** %5
%25 = getelementptr inbounds double, double* %24, i64 1
store double %23, double* %25
%26 = load double*, double** %6
%27 = getelementptr inbounds double, double* %26, i64 2
%28 = load double, double* %27
%29 = load double*, double** %7
%30 = getelementptr inbounds double, double* %29, i64 2
%31 = load double, double* %30
%32 = fadd double %28, %31
%33 = load double*, double** %5
%34 = getelementptr inbounds double, double* %33, i64 2
store double %32, double* %34
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @Vadd(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ term_align(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *);
void term_gc() { term_align(NULL, NULL, NULL); }


x86 assembly (clang, -O0):
<term_gc>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <term_align@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_gc>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <term_align@plt>

LLVM IR (-O0):
define void @term_gc() {
%1 = call i32 @term_align(i32* null, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @term_gc() {
%1 = tail call i32 @term_align(i32* null, i32* null, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void AbortedMsg() {
  fprintf(stderr, "\n                   B-Toolkit Aborted");
  fprintf(stderr, "\n\n             All data has been preserved\n\n\n");
}


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

x86 assembly (clang, -O2):
<AbortedMsg>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef7(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"\0A B-Toolkit Aborted\00"
@.str.1 = [46 x i8] c"\0A\0A All data has been preserved\0A\0A\0A\00"
define void @AbortedMsg() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"\0A B-Toolkit Aborted\00"
@.str.1 = [46 x i8] c"\0A\0A All data has been preserved\0A\0A\0A\00"
define void @AbortedMsg() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float degree_radians(float degree) { return (degree * (3.1415926535 / 180)); }


x86 assembly (clang, -O0):
<degree_radians>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degree_radians>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @degree_radians(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x3F91DF46A2506B91
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @degree_radians(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46A2506B91
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void latex_print_header(void) {
  puts("\\documentclass{standalone}");
  puts("\\usepackage{tikz-dependency}");
  puts("\\begin{document}");
  puts("\\begin{dependency}[theme = simple, edge style={<-}]");
}


x86 assembly (clang, -O0):
<latex_print_header>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<latex_print_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\\documentclass{standalone}\00"
@.str.1 = [29 x i8] c"\\usepackage{tikz-dependency}\00"
@.str.2 = [17 x i8] c"\\begin{document}\00"
@.str.3 = [52 x i8] c"\\begin{dependency}[theme = simple, edge style={<-}]\00"
define void @latex_print_header() {
%1 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"\\documentclass{standalone}\00"
@.str.1 = [29 x i8] c"\\usepackage{tikz-dependency}\00"
@.str.2 = [17 x i8] c"\\begin{document}\00"
@.str.3 = [52 x i8] c"\\begin{dependency}[theme = simple, edge style={<-}]\00"
define void @latex_print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void bsp_cleanup(void) {
  extern void _sys_exit(int);
  _sys_exit(0);
}


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

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

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

LLVM IR (-O2):
define void @bsp_cleanup() {
tail call void @_sys_exit(i32 0)
ret void
}
const char *get_percent_color(double percent) {
  const char *color = "";
  if (percent >= 5.0)
    color = "\033[31m";
  else {
    if (percent > 0.5)
      color = "\033[32m";
  }
  return color;
}


x86 assembly (clang, -O0):
<get_percent_color>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
lea    0xf05(%rip),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     113b <get_percent_color+0x3b>
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1162 <get_percent_color+0x62>
movsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115d <get_percent_color+0x5d>
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1162 <get_percent_color+0x62>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_percent_color>:
ucomisd 0xef8(%rip),%xmm0
jae    111c <get_percent_color+0x1c>
ucomisd 0xef6(%rip),%xmm0
jbe    1124 <get_percent_color+0x24>
lea    0xefb(%rip),%rax
ret
lea    0xeed(%rip),%rax
ret
lea    0xeea(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
define i8* @get_percent_color(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load double, double* %2
%5 = fcmp oge double %4, 5.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %12
7: ; preds = %1
%8 = load double, double* %2
%9 = fcmp ogt double %8, 5.000000e-01
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %11
11: ; preds = %10, %7
br label %12
12: ; preds = %11, %6
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [6 x i8] c"\1B[32m\00"
define i8* @get_percent_color(double %0) {
%2 = fcmp ult double %0, 5.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fcmp ogt double %0, 5.000000e-01
br i1 %4, label %5, label %6
5: ; preds = %3
br label %6
6: ; preds = %1, %3, %5
%7 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ readFile();
int main() {
  readFile();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @readFile()
ret i32 0
}
void ff_hevc_put_hevc_uni_qpel_v24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_v24_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, unsigned int);
char *substr(const char *str, unsigned start, unsigned end) {
  unsigned n = end - start;
  static char stbuf[256];
  strncpy(stbuf, str + start, n);
  stbuf[n] = 0;
  return stbuf;
}


x86 assembly (clang, -O0):
<substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
lea    0x2f01(%rip),%rdi
call   1030 <strncpy@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
lea    0x2ef0(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ee5(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substr>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
sub    %esi,%ebx
mov    %esi,%esi
add    %rdi,%rsi
lea    0x2f1c(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@substr.stbuf = internal global [256 x i8] zeroinitializer
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub i32 %8, %9
store i32 %10, i32* %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i32, i32* %7
%16 = call i32 @strncpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @substr.stbuf, i64 0, i64 0), i8* %14, i32 %15)
%17 = load i32, i32* %7
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [256 x i8], [256 x i8]* @substr.stbuf, i64 0, i64 %18
store i8 0, i8* %19
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @substr.stbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@substr.stbuf = internal global [256 x i8] zeroinitializer
define i8* @substr(i8* %0, i32 %1, i32 %2) {
%4 = sub i32 %2, %1
%5 = zext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @strncpy(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @substr.stbuf, i64 0, i64 0), i8* %6, i32 %4)
%8 = zext i32 %4 to i64
%9 = getelementptr inbounds [256 x i8], [256 x i8]* @substr.stbuf, i64 0, i64 %8
store i8 0, i8* %9
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @substr.stbuf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void clear_argv(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++) {
    free(argv[i]);
    argv[i] = NULL;
  }
}


x86 assembly (clang, -O0):
<clear_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1161 <clear_argv+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <clear_argv+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_argv>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    114a <clear_argv+0x3a>
mov    %rsi,%r15
mov    %edi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
movq   $0x0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <clear_argv+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @clear_argv(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @free(i8* %9)
store i8* null, i8** %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int exec_that(char **);
scalar_t__ isatty(int /*<<< orphan*/);
int /*<<< orphan*/ pprint(char *, int);
int main(int ac, char **av, char **environ) {
  ac = ac + 42;
  av = av + 42;
  if ((isatty(0)))
    pprint("\x1b[1mMysh>>\x1b[0m ", 1);
  if ((exec_that(environ)) == 1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2a,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x150,%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
call   1040 <isatty@plt>
cmp    $0x0,%rax
je     1183 <main+0x53>
lea    0xe87(%rip),%rdi
mov    $0x1,%esi
call   1050 <pprint@plt>
mov    -0x18(%rbp),%rdi
call   1030 <exec_that@plt>
cmp    $0x1,%eax
jne    11a1 <main+0x71>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <main+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rdx,%rbx
xor    %edi,%edi
call   1040 <isatty@plt>
test   %rax,%rax
je     1151 <main+0x21>
lea    0xeb9(%rip),%rdi
mov    $0x1,%esi
call   1050 <pprint@plt>
mov    %rbx,%rdi
call   1030 <exec_that@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\1B[1mMysh>>\1B[0m \00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 42
store i32 %9, i32* %5
%10 = load i8**, i8*** %6
%11 = getelementptr inbounds i8*, i8** %10, i64 42
store i8** %11, i8*** %6
%12 = call i64 @isatty(i32 0)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @pprint(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
br label %16
16: ; preds = %14, %3
%17 = load i8**, i8*** %7
%18 = call i32 @exec_that(i8** %17)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %4
br label %22
21: ; preds = %16
store i32 0, i32* %4
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
@.str = [16 x i8] c"\1B[1mMysh>>\1B[0m \00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i64 @isatty(i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @pprint(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @exec_that(i8** %2)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
void bitmap_set(uint32_t *bitmap, unsigned nr) {
  unsigned i = ((nr) / (32U));
  uint32_t mask = (1U << ((nr) % 32U));
  bitmap[i] |= mask;
}


x86 assembly (clang, -O0):
<bitmap_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_set>:
mov    %esi,%ecx
mov    %esi,%eax
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x5,%eax
or     %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @bitmap_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = udiv i32 %7, 32
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = urem i32 %9, 32
%11 = shl i32 1, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = or i32 %17, %12
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @bitmap_set(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = zext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %5
store i32 %9, i32* %7
ret void
}
void xmlevent(int event, char *yytext) {}


x86 assembly (clang, -O0):
<xmlevent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xmlevent(i32 %0, i8* nocapture %1) {
ret void
}
unsigned XXH_versionNumber(void) { return (0 * 100 * 100 + 7 * 100 + 0); }


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

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

LLVM IR (-O0):
define i32 @XXH_versionNumber() {
ret i32 700
}

LLVM IR (-O2):
define i32 @XXH_versionNumber() {
ret i32 700
}