xunge/DecIR huggingface dataset:
extern void update(void *data) { (void)data; }


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

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

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

LLVM IR (-O2):
define void @update(i8* nocapture %0) {
ret void
}
double FPStoKTS(double FPS) {
  double KTS = 0.5924838 * FPS;
  return KTS;
}


x86 assembly (clang, -O0):
<FPStoKTS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPStoKTS>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @FPStoKTS(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FE2F5A0960D1D1F, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @FPStoKTS(double %0) {
%2 = fmul double %0, 0x3FE2F5A0960D1D1F
ret double %2
}
/* Variables and functions */
void neuralops_maxpool2d_2x2_bwd(size_t batch_sz, size_t in_width,
                                 size_t in_height, size_t chan,
                                 const float *in_buf, const float *out_grad,
                                 float *in_grad) {}


x86 assembly (clang, -O0):
<neuralops_maxpool2d_2x2_bwd>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @neuralops_maxpool2d_2x2_bwd(i64 %0, i64 %1, i64 %2, i64 %3, float* %4, float* %5, float* %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store float* %4, float** %12
store float* %5, float** %13
store float* %6, float** %14
ret void
}

LLVM IR (-O2):
define void @neuralops_maxpool2d_2x2_bwd(i64 %0, i64 %1, i64 %2, i64 %3, float* nocapture %4, float* nocapture %5, float* nocapture %6) {
ret void
}
int intFuncNoArgs(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @intFuncNoArgs() {
ret i32 42
}

LLVM IR (-O2):
define i32 @intFuncNoArgs() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void sign_off(void) {
  puts("Thus terminates another magnificent program from");
  puts("SeeSaw Software!");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"Thus terminates another magnificent program from\00"
@.str.1 = [17 x i8] c"SeeSaw Software!\00"
define void @sign_off() {
%1 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Thus terminates another magnificent program from\00"
@.str.1 = [17 x i8] c"SeeSaw Software!\00"
define void @sign_off() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void element2ASCII(char c) {}


x86 assembly (clang, -O0):
<element2ASCII>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @element2ASCII(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t ZOBRIST_SIDE_TO_MOVE_INDEX() {
  const size_t base = 64 * 12;
  const size_t off = 0;
  const size_t index = base + off;
  assert(index >= 64 * 12);
  assert(index <= 64 * 12);
  return index;
}


x86 assembly (clang, -O0):
<ZOBRIST_SIDE_TO_MOVE_INDEX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x300,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x300,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x300,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZOBRIST_SIDE_TO_MOVE_INDEX>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x300,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @ZOBRIST_SIDE_TO_MOVE_INDEX() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
store i64 768, i64* %1
store i64 0, i64* %2
store i64 768, i64* %3
%4 = call i32 @assert(i32 1)
%5 = call i32 @assert(i32 1)
ret i64 768
}

LLVM IR (-O2):
define i64 @ZOBRIST_SIDE_TO_MOVE_INDEX() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i64 768
}
/* Type definitions */
struct connection_pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cp_delete(struct connection_pool *);
struct connection_pool *cp_new();
int /*<<< orphan*/ test(struct connection_pool *);
int main() {
  struct connection_pool *server = cp_new();
  test(server);
  cp_delete(server);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <cp_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <test@plt>
mov    %rbx,%rdi
call   1030 <cp_delete@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.connection_pool = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.connection_pool*
store i32 0, i32* %1
%3 = call %struct.connection_pool* (...) @cp_new()
store %struct.connection_pool* %3, %struct.connection_pool** %2
%4 = load %struct.connection_pool*, %struct.connection_pool** %2
%5 = call i32 @test(%struct.connection_pool* %4)
%6 = load %struct.connection_pool*, %struct.connection_pool** %2
%7 = call i32 @cp_delete(%struct.connection_pool* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.connection_pool = type { i32 }
define i32 @main() {
%1 = tail call %struct.connection_pool* (...) @cp_new()
%2 = tail call i32 @test(%struct.connection_pool* %1)
%3 = tail call i32 @cp_delete(%struct.connection_pool* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_userstate_callback(int32_t session, int32_t actor, char *name,
                               int32_t user_id, int32_t channel_id,
                               int32_t mute, int32_t deaf, int32_t suppress,
                               int32_t self_mute, int32_t self_deaf,
                               char *comment, int32_t priority_speaker,
                               int32_t recording, void *user_data) {
  printf("userstate_callback\n");
}


x86 assembly (clang, -O0):
<mumble_userstate_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"userstate_callback\0A\00"
define void @mumble_userstate_callback(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i8* %10, i32 %11, i32 %12, i8* %13) {
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i32
%27 = alloca i32
%28 = alloca i8*
store i32 %0, i32* %15
store i32 %1, i32* %16
store i8* %2, i8** %17
store i32 %3, i32* %18
store i32 %4, i32* %19
store i32 %5, i32* %20
store i32 %6, i32* %21
store i32 %7, i32* %22
store i32 %8, i32* %23
store i32 %9, i32* %24
store i8* %10, i8** %25
store i32 %11, i32* %26
store i32 %12, i32* %27
store i8* %13, i8** %28
%29 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"userstate_callback\00"
define void @mumble_userstate_callback(i32 %0, i32 %1, i8* nocapture readnone %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i8* nocapture readnone %10, i32 %11, i32 %12, i8* nocapture readnone %13) {
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
void WideTimer4B_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @WideTimer4B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
double fp_barrier(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @fp_barrier(double returned %0) {
ret double %0
}
void vgatv_macrovision(unsigned long tv_std, unsigned int cp_trigger_bits) {}


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

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

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

LLVM IR (-O2):
define void @vgatv_macrovision(i64 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned long long on_connected() {
  printf("bridge: on_connect\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<on_connected>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [19 x i8] c"bridge: on_connect\00"
define i64 @on_connected() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void aguardarTerminoDeThreads(pthread_t thread[]) {
  int i;
  for (i = 0; i < 4; i++) {
    pthread_join(thread[i], NULL);
  }
}


x86 assembly (clang, -O0):
<aguardarTerminoDeThreads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    114f <aguardarTerminoDeThreads+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <pthread_join@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <aguardarTerminoDeThreads+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aguardarTerminoDeThreads>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
call   1030 <pthread_join@plt>
mov    0x4(%rbx),%edi
xor    %esi,%esi
call   1030 <pthread_join@plt>
mov    0x8(%rbx),%edi
xor    %esi,%esi
call   1030 <pthread_join@plt>
mov    0xc(%rbx),%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <pthread_join@plt>

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

LLVM IR (-O2):
define void @aguardarTerminoDeThreads(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @pthread_join(i32 %2, i32* null)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @pthread_join(i32 %5, i32* null)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @pthread_join(i32 %8, i32* null)
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @pthread_join(i32 %11, i32* null)
ret void
}
int check_option(word, option)
char *word;
char *option;
{
  if (word[0] != '-')
    return 0;
  if (word[1] == '-')
    word++;
  if (strcmp(word + 1, option))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     113c <check_option+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1186 <check_option+0x76>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    1159 <check_option+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     117f <check_option+0x6f>
movl   $0x0,-0x4(%rbp)
jmp    1186 <check_option+0x76>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_option>:
push   %rax
xor    %eax,%eax
cmpb   $0x2d,(%rdi)
jne    1139 <check_option+0x29>
cmpb   $0x2d,0x1(%rdi)
lea    0x1(%rdi),%rax
cmovne %rdi,%rax
add    $0x1,%rax
mov    %rax,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_option(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 45
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 45
%9 = select i1 %8, i8* %6, i8* %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = tail call i32 @strcmp(i8* %10, i8* dereferenceable(1) %1)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %5, %2
%15 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ foo(float, float);
void sumProd(int n) {
  float sum = 0.0;
  float prod = 1.0;
  for (int i = 1; i <= n; i++) {
    sum = sum + i;
    foo(sum, prod);
  }
}


x86 assembly (clang, -O0):
<sumProd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1173 <sumProd+0x63>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <foo@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1137 <sumProd+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumProd>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1167 <sumProd+0x57>
mov    %edi,%r14d
neg    %r14d
xorps  %xmm0,%xmm0
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
cvtsi2ss %ebx,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
movss  0xeb7(%rip),%xmm1
call   1030 <foo@plt>
movss  0x4(%rsp),%xmm0
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <sumProd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sumProd(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 %0, i32* %2
store float 0.000000e+00, float* %3
store float 1.000000e+00, float* %4
store i32 1, i32* %5
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load float, float* %3
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = fadd float %11, %13
store float %14, float* %3
%15 = load float, float* %3
%16 = load float, float* %4
%17 = call i32 @foo(float %15, float %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @sumProd(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ 1, %1 ]
%6 = phi float [ %8, %4 ], [ 0.000000e+00, %1 ]
%7 = sitofp i32 %5 to float
%8 = fadd float %6, %7
%9 = tail call i32 @foo(float %8, float 1.000000e+00)
%10 = add nuw i32 %5, 1
%11 = icmp eq i32 %5, %0
br i1 %11, label %3, label %4
}
void ASN1_TIME_print(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_TIME_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_info(char *, char const *, char const *);
void dump_not_empty(const char *key, const char *value) {
  if (value == NULL || *value == '\0')
    return;
  log_info("  %s: %s", key, value);
}


x86 assembly (clang, -O0):
<dump_not_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113b <dump_not_empty+0x2b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1140 <dump_not_empty+0x30>
jmp    1154 <dump_not_empty+0x44>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <log_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_not_empty>:
mov    %rsi,%rdx
test   %rsi,%rsi
je     112c <dump_not_empty+0x1c>
cmpb   $0x0,(%rdx)
je     112c <dump_not_empty+0x1c>
mov    %rdi,%rsi
lea    0xed9(%rip),%rdi
jmp    1030 <log_info@plt>
ret

LLVM IR (-O0):
@.str = [9 x i8] c" %s: %s\00"
define void @dump_not_empty(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
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7, %2
br label %17
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = call i32 @log_info(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
br label %17
17: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c" %s: %s\00"
define void @dump_not_empty(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @log_info(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %9
9: ; preds = %2, %4, %7
ret void
}
/* Variables and functions */
int random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int order_size() {
  srandom(time(NULL));
  int min = 1000;
  int max = 2000;
  int r = random() % (max - min) + min;
  return r;
}


x86 assembly (clang, -O0):
<order_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
movl   $0x3e8,-0x4(%rbp)
movl   $0x7d0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <random@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<order_size>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1050 <random@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x3e8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @order_size() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @time(i32* null)
%5 = call i32 @srandom(i32 %4)
store i32 1000, i32* %1
store i32 2000, i32* %2
%6 = call i32 (...) @random()
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = sub nsw i32 %7, %8
%10 = srem i32 %6, %9
%11 = load i32, i32* %1
%12 = add nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @order_size() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srandom(i32 %1)
%3 = tail call i32 (...) @random()
%4 = srem i32 %3, 1000
%5 = add nsw i32 %4, 1000
ret i32 %5
}
/* Variables and functions */
int __C_isalnum(int);
int isalnum(int c) { return __C_isalnum(c); }


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

x86 assembly (clang, -O2):
<isalnum>:
jmp    1030 <__C_isalnum@plt>

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = tail call i32 @__C_isalnum(i32 %0)
ret i32 %2
}
void debug_write(const char *msg) {
  while (*msg) {
    __asm__("outb %%al,%%dx;" : : "d"(0xE9), "a"(*msg++));
  }
}


x86 assembly (clang, -O0):
<debug_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1131 <debug_write+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    $0xe9,%edx
out    %al,(%dx)
jmp    1108 <debug_write+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_write>:
mov    (%rdi),%al
test   %al,%al
je     111c <debug_write+0x1c>
add    $0x1,%rdi
mov    $0xe9,%edx
nop
out    %al,(%dx)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <debug_write+0x10>
ret

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

LLVM IR (-O2):
define void @debug_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
tail call void asm sideeffect "outb %al,%dx;", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i32 233, i8 %5)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
double sqrt(double);
double y_bottom(double x) { return -sqrt(1.0 - x * x); }


x86 assembly (clang, -O0):
<y_bottom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<y_bottom>:
push   %rax
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xedf(%rip),%xmm0
subsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1135 <y_bottom+0x25>
sqrtsd %xmm0,%xmm0
jmp    113a <y_bottom+0x2a>
call   1030 <sqrt@plt>
xorpd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @y_bottom(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = call double @sqrt(double %6)
%8 = fneg double %7
ret double %8
}

LLVM IR (-O2):
define double @y_bottom(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = tail call double @sqrt(double %3)
%5 = fneg double %4
ret double %5
}
/* Type definitions */
typedef int volatile uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t USBIntStatusEndpoint(uint32_t ui32Base) {
  uint32_t ui32Status;
  ;
  ui32Status = (*((volatile uint16_t *)(ui32Base + 0x00000002)));
  ui32Status |= ((*((volatile uint16_t *)(ui32Base + 0x00000004))) << 16);
  return (ui32Status);
}


x86 assembly (clang, -O0):
<USBIntStatusEndpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%ecx
shl    $0x10,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntStatusEndpoint>:
mov    %edi,-0x4(%rsp)
movslq -0x4(%rsp),%rax
mov    0x2(%rax),%eax
mov    %eax,-0x8(%rsp)
movslq -0x4(%rsp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
or     %eax,-0x8(%rsp)
mov    -0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @USBIntStatusEndpoint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store volatile i32 %0, i32* %2
%4 = load volatile i32, i32* %2
%5 = add nsw i32 %4, 2
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
store volatile i32 %8, i32* %3
%9 = load volatile i32, i32* %2
%10 = add nsw i32 %9, 4
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = shl i32 %13, 16
%15 = load volatile i32, i32* %3
%16 = or i32 %15, %14
store volatile i32 %16, i32* %3
%17 = load volatile i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @USBIntStatusEndpoint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store volatile i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
%5 = load volatile i32, i32* %2
%6 = add nsw i32 %5, 2
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
store volatile i32 %9, i32* %3
%10 = load volatile i32, i32* %2
%11 = add nsw i32 %10, 4
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = shl i32 %14, 16
%16 = load volatile i32, i32* %3
%17 = or i32 %16, %15
store volatile i32 %17, i32* %3
%18 = load volatile i32, i32* %3
ret i32 %18
}
/* Type definitions */
struct kp_file {
  int dummy;
};

/* Variables and functions */
int skip_section(struct kp_file *, int, char *);
int skip_debug_section(struct kp_file *f, int l0) {
  return skip_section(f, l0, ".debug_");
}


x86 assembly (clang, -O0):
<skip_debug_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <skip_section@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_debug_section>:
lea    0xee9(%rip),%rdx
jmp    1030 <skip_section@plt>

LLVM IR (-O0):
%struct.kp_file = type { i32 }
@.str = [8 x i8] c".debug_\00"
define i32 @skip_debug_section(%struct.kp_file* %0, i32 %1) {
%3 = alloca %struct.kp_file*
%4 = alloca i32
store %struct.kp_file* %0, %struct.kp_file** %3
store i32 %1, i32* %4
%5 = load %struct.kp_file*, %struct.kp_file** %3
%6 = load i32, i32* %4
%7 = call i32 @skip_section(%struct.kp_file* %5, i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.kp_file = type { i32 }
@.str = [8 x i8] c".debug_\00"
define i32 @skip_debug_section(%struct.kp_file* %0, i32 %1) {
%3 = tail call i32 @skip_section(%struct.kp_file* %0, i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_RADIO_GIO0_PIN() { set_io_bit(-1, 5); }


x86 assembly (clang, -O0):
<TOSH_SET_RADIO_GIO0_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x5,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @TOSH_SET_RADIO_GIO0_PIN() {
%1 = call i32 @set_io_bit(i32 -1, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RADIO_GIO0_PIN() {
%1 = tail call i32 @set_io_bit(i32 -1, i32 5)
ret void
}
int Bematech_FI_EstadoGaveta(Var, Retorno) {
  Formata("\x1b|23|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_EstadoGaveta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_EstadoGaveta>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|23|\1B\00"
define i32 @Bematech_FI_EstadoGaveta(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|23|\1B\00"
define i32 @Bematech_FI_EstadoGaveta(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
int IsAlpha(char C) { return (C >= 'a' && C <= 'z') || (C >= 'A' && C <= 'Z'); }


x86 assembly (clang, -O0):
<IsAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <IsAlpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <IsAlpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <IsAlpha+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):
<IsAlpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsAlpha(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 @IsAlpha(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
}
int test_and_clear_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  asm volatile(""
               "btrl %2,%1\n\t"
               "sbbl %0,%0"
               : "=r"(oldbit), "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btr    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_clear_bit>:
btr    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btrl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_and_clear_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btrl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ count_to_hundred(int);
int /*<<< orphan*/ print_num_reverse(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ recurse(int /*<<< orphan*/);
int main() {
  count_to_hundred(1);
  printf("\n");
  print_num_reverse(0);
  printf("\n");
  recurse(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <count_to_hundred@plt>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <print_num_reverse@plt>
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1030 <recurse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1060 <count_to_hundred@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %edi,%edi
call   1050 <print_num_reverse@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %edi,%edi
call   1030 <recurse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @count_to_hundred(i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @print_num_reverse(i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @recurse(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @count_to_hundred(i32 1)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @print_num_reverse(i32 0)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @recurse(i32 0)
ret i32 0
}
/* Variables and functions */
int surrounded_with(char const *, char, char);
int is_globs_expr(const char expr[]) { return surrounded_with(expr, '{', '}'); }


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

x86 assembly (clang, -O2):
<is_globs_expr>:
mov    $0x7b,%esi
mov    $0x7d,%edx
jmp    1030 <surrounded_with@plt>

LLVM IR (-O0):
define i32 @is_globs_expr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @surrounded_with(i8* %3, i8 signext 123, i8 signext 125)
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_globs_expr(i8* %0) {
%2 = tail call i32 @surrounded_with(i8* %0, i8 signext 123, i8 signext 125)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Free(void **);
int /*<<< orphan*/ strcpy(char *, char *);
char *BufferReturn(char **Buffer, char *UserBuffer) {
  if (UserBuffer != NULL) {
    strcpy(UserBuffer, *Buffer);
    Free((void **)Buffer);
    return (UserBuffer);
  } else {
    return (*Buffer);
  }
}


x86 assembly (clang, -O0):
<BufferReturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <BufferReturn+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <Free@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <BufferReturn+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BufferReturn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rdi),%rsi
test   %rbx,%rbx
je     1144 <BufferReturn+0x24>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <Free@plt>
jmp    1147 <BufferReturn+0x27>
mov    %rsi,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @BufferReturn(i8** %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = load i8*, i8** %0
br i1 %3, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* %1, i8* %4)
%7 = tail call i32 @Free(i8** %0)
br label %8
8: ; preds = %2, %5
%9 = phi i8* [ %1, %5 ], [ %4, %2 ]
ret i8* %9
}
/* Variables and functions */
int atoi(char const *);
int ordinate(const char *s) {
  int result = atoi(s);
  if (result > 0)
    --result;
  else
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<ordinate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1140 <ordinate+0x30>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <ordinate+0x37>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordinate>:
push   %rax
call   1030 <atoi@plt>
lea    -0x1(%rax),%edx
xor    %ecx,%ecx
test   %eax,%eax
cmovg  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ordinate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @atoi(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
br label %12
11: ; preds = %1
store i32 0, i32* %3
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @ordinate(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = icmp sgt i32 %2, 0
%4 = add nsw i32 %2, -1
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int read(int, char *, int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void flush_buffer(int fd) {
  int rc;
  char buf[2048];
  memset(buf, 0, sizeof(buf));
  rc = read(fd, buf, sizeof(buf));
  if (rc > 0)
    write(STDOUT_FILENO, buf, rc);
}


x86 assembly (clang, -O0):
<flush_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    $0x800,%edx
call   1050 <read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    118a <flush_buffer+0x5a>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    -0x810(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <write@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_buffer>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1040 <memset@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x800,%edx
call   1050 <read@plt>
test   %eax,%eax
jle    1174 <flush_buffer+0x44>
mov    0x2e88(%rip),%rcx
mov    (%rcx),%edi
mov    %rsp,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @flush_buffer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2048 x i8]
store i32 %0, i32* %2
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 2048)
%7 = load i32, i32* %2
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%9 = call i32 @read(i32 %7, i8* %8, i32 2048)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32, i32* @STDOUT_FILENO
%14 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%15 = load i32, i32* %3
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
br label %17
17: ; preds = %12, %1
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @flush_buffer(i32 %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 2048)
%5 = call i32 @read(i32 %0, i8* %3, i32 2048)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @STDOUT_FILENO
%9 = call i32 @write(i32 %8, i8* %3, i32 %5)
br label %10
10: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GENERAL_NAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ GENERAL_NAME_it;
void GENERAL_NAME_free(GENERAL_NAME *a) {
  ASN1_item_free((ASN1_VALUE *)a, &GENERAL_NAME_it);
}


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

x86 assembly (clang, -O2):
<GENERAL_NAME_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@GENERAL_NAME_it = global i32 0
define void @GENERAL_NAME_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @GENERAL_NAME_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void hide_cursor() { fprintf(stdout, "\33[?25l"); }


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25l\00"
define void @hide_cursor() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25l\00"
define void @hide_cursor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *itostr(int, char *, int);
char *itoa(int n, char c[]) { return itostr(n, c, 10); }


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

x86 assembly (clang, -O2):
<itoa>:
mov    $0xa,%edx
jmp    1030 <itostr@plt>

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

LLVM IR (-O2):
define i8* @itoa(i32 %0, i8* %1) {
%3 = tail call i8* @itostr(i32 %0, i8* %1, i32 10)
ret i8* %3
}