xunge/DecIR huggingface dataset:
/* Variables and functions */
int factorial(int, int);
int main(void) { return factorial(5, 10) % 256; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0xa,%esi
call   1030 <factorial@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0xa,%esi
call   1030 <factorial@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @factorial(i32 5, i32 10)
%2 = srem i32 %1, 256
ret i32 %2
}
/* Variables and functions */
double floor(double);
double hue_shift(double x) { return (x - floor(x)); }


x86 assembly (clang, -O0):
<hue_shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hue_shift>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hue_shift(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.floor.f64(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @hue_shift(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
ret double %3
}
int nonet_exit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @nonet_exit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nonet_exit() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_ucs4(void *elem, void *priv) {
  uint32_t *v = elem;
  free(--v);
}


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

x86 assembly (clang, -O2):
<free_ucs4>:
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_ucs4(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 -4
%4 = bitcast i8* %3 to i32*
%5 = tail call i32 @free(i32* %4)
ret void
}
/* Variables and functions */
char *get_cpunamechar();
int /*<<< orphan*/ printf(char *, char *);
void get_subarchitecture(void) { printf("%s", get_cpunamechar()); }


x86 assembly (clang, -O0):
<get_subarchitecture>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_cpunamechar@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_subarchitecture>:
push   %rax
xor    %eax,%eax
call   1030 <get_cpunamechar@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @get_subarchitecture() {
%1 = tail call i8* (...) @get_cpunamechar()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void mem_move(void *mem, const void *src, size_t size) {
  memmove(mem, src, size);
}


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

x86 assembly (clang, -O2):
<mem_move>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @mem_move(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}
void GB_ISLE_f_FP32(float *z, const float *x, const float *y) {
  (*z) = ((*x) <= (*y));
}


x86 assembly (clang, -O0):
<GB_ISLE_f_FP32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2ss %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ISLE_f_FP32>:
movss  (%rsi),%xmm0
cmpless (%rdx),%xmm0
movss  0xeef(%rip),%xmm1
andps  %xmm0,%xmm1
movss  %xmm1,(%rdi)
ret

LLVM IR (-O0):
define void @GB_ISLE_f_FP32(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = load float, float* %7
%9 = load float*, float** %6
%10 = load float, float* %9
%11 = fcmp ole float %8, %10
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to float
%14 = load float*, float** %4
store float %13, float* %14
ret void
}

LLVM IR (-O2):
define void @GB_ISLE_f_FP32(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fcmp ole float %4, %5
%7 = uitofp i1 %6 to float
store float %7, float* %0
ret void
}
/* Variables and functions */
char *getRecap(char *);
int /*<<< orphan*/ printf(char *, char *);
void printRecap() {
  char buffer[500];
  printf("%s", getRecap(buffer));
}


x86 assembly (clang, -O0):
<printRecap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rdi
call   1040 <getRecap@plt>
mov    %rax,%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printRecap>:
sub    $0x1f8,%rsp
mov    %rsp,%rdi
call   1040 <getRecap@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x1f8,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @printRecap() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = call i8* @getRecap(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printRecap() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = call i8* @getRecap(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
int(ars_d_set_tcpopt_sack)(struct ars_packet *pkt, int layer, char *f,
                           char *v) {
  return 0;
}


x86 assembly (clang, -O0):
<ars_d_set_tcpopt_sack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ars_packet = type opaque
define i32 @ars_d_set_tcpopt_sack(%struct.ars_packet* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.ars_packet*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.ars_packet* %0, %struct.ars_packet** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ars_packet = type opaque
define i32 @ars_d_set_tcpopt_sack(%struct.ars_packet* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hola\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"Hola\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *NPN_GetJavaEnv();
void *NPP_GetJavaClass();
void *Private_GetJavaClass(void) {
  void *clazz = NPP_GetJavaClass();
  if (clazz) {
    void *env = NPN_GetJavaEnv();
    return 0;
  }
  return (0L);
}


x86 assembly (clang, -O0):
<Private_GetJavaClass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <NPP_GetJavaClass@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1156 <Private_GetJavaClass+0x36>
mov    $0x0,%al
call   1040 <NPN_GetJavaEnv@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x8(%rbp)
jmp    115e <Private_GetJavaClass+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Private_GetJavaClass>:
push   %rax
xor    %eax,%eax
call   1030 <NPP_GetJavaClass@plt>
test   %rax,%rax
je     1134 <Private_GetJavaClass+0x14>
xor    %eax,%eax
call   1040 <NPN_GetJavaEnv@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @Private_GetJavaClass() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = call i8* (...) @NPP_GetJavaClass()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i8* (...) @NPN_GetJavaEnv()
store i8* %8, i8** %3
store i8* null, i8** %1
br label %10
9: ; preds = %0
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @Private_GetJavaClass() {
%1 = tail call i8* (...) @NPP_GetJavaClass()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i8* (...) @NPN_GetJavaEnv()
br label %5
5: ; preds = %0, %3
ret i8* null
}
long long test_llrintl(long double x) { return __builtin_llrintl(x); }


x86 assembly (clang, -O0):
<test_llrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <llrintl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_llrintl>:
jmp    1030 <llrintl@plt>

LLVM IR (-O0):
define i64 @test_llrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @llrintl(x86_fp80 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_llrintl(x86_fp80 %0) {
%2 = tail call i64 @llrintl(x86_fp80 %0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
struct s_sd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ return_sense(int, int /*<<< orphan*/, struct s_sd *,
                                int /*<<< orphan*/ *);
void sam_illegal_request(uint16_t ascq, struct s_sd *sd, uint8_t *sam_stat) {
  return_sense(0x05, ascq, sd, sam_stat);
}


x86 assembly (clang, -O0):
<sam_illegal_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x5,%edi
call   1030 <return_sense@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam_illegal_request>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x5,%edi
jmp    1030 <return_sense@plt>

LLVM IR (-O0):
%struct.s_sd = type { i32 }
define void @sam_illegal_request(i32 %0, %struct.s_sd* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.s_sd*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.s_sd* %1, %struct.s_sd** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.s_sd*, %struct.s_sd** %5
%9 = load i32*, i32** %6
%10 = call i32 @return_sense(i32 5, i32 %7, %struct.s_sd* %8, i32* %9)
ret void
}

LLVM IR (-O2):
%struct.s_sd = type { i32 }
define void @sam_illegal_request(i32 %0, %struct.s_sd* %1, i32* %2) {
%4 = tail call i32 @return_sense(i32 5, i32 %0, %struct.s_sd* %1, i32* %2)
ret void
}
int msecs_to_ticks(int m) { return (m << 5); }


x86 assembly (clang, -O0):
<msecs_to_ticks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msecs_to_ticks>:
mov    %edi,%eax
shl    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @msecs_to_ticks(i32 %0) {
%2 = shl i32 %0, 5
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ recv_request(int);
void serve_request(void *ptr) {
  int s = *(int *)ptr;
  printf("serving request on socket %i\n", s);
  recv_request(s);
  close(s);
  return;
}


x86 assembly (clang, -O0):
<serve_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1030 <recv_request@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serve_request>:
push   %rbx
mov    (%rdi),%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1030 <recv_request@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <close@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"serving request on socket %i\0A\00"
define void @serve_request(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @recv_request(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"serving request on socket %i\0A\00"
define void @serve_request(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @recv_request(i32 %3)
%6 = tail call i32 @close(i32 %3)
ret void
}
/* Variables and functions */
int shim_tgkill(int /*<<< orphan*/, int, int);
int shim_tkill(int tid, int sig) { return shim_tgkill(0, tid, sig); }


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

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

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

LLVM IR (-O2):
define i32 @shim_tkill(i32 %0, i32 %1) {
%3 = tail call i32 @shim_tgkill(i32 0, i32 %0, i32 %1)
ret i32 %3
}
const char *rcsid(const char *p) {
  return rcsid(
      p = "@(#)$File: apptype.c,v 1.7 2007/01/12 17:38:27 christos Exp $");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"@(#)$File: apptype.c,v 1.7 2007/01/12 17:38:27 christos Exp $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ PressKey241(unsigned char);
void presskey(unsigned char k) { PressKey241(k); }


x86 assembly (clang, -O0):
<presskey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <PressKey241@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<presskey>:
jmp    1030 <PressKey241@plt>

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

LLVM IR (-O2):
define void @presskey(i8 zeroext %0) {
%2 = tail call i32 @PressKey241(i8 zeroext %0)
ret void
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_display {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_display_set_user_data(struct wl_display *wl_display, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_display, user_data);
}


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

x86 assembly (clang, -O2):
<wl_display_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

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

LLVM IR (-O2):
%struct.wl_display = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_display_set_user_data(%struct.wl_display* %0, i8* %1) {
%3 = bitcast %struct.wl_display* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int /*<<< orphan*/ test3();
int /*<<< orphan*/ test4();
int main(int argc, char *argv[]) {
  test1();
  test2();
  test3();
  test4();
  printf("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test1@plt>
mov    $0x0,%al
call   1070 <test2@plt>
mov    $0x0,%al
call   1030 <test3@plt>
mov    $0x0,%al
call   1060 <test4@plt>
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test1@plt>
xor    %eax,%eax
call   1070 <test2@plt>
xor    %eax,%eax
call   1040 <test3@plt>
xor    %eax,%eax
call   1060 <test4@plt>
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test1()
%7 = call i32 (...) @test2()
%8 = call i32 (...) @test3()
%9 = call i32 (...) @test4()
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test1()
%4 = tail call i32 (...) @test2()
%5 = tail call i32 (...) @test3()
%6 = tail call i32 (...) @test4()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *get_array_addr(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ set_count(void *, int /*<<< orphan*/);
void *array_init() {
  void *array = get_array_addr(malloc(sizeof(int)));
  set_count(array, 0);
  return array;
}


x86 assembly (clang, -O0):
<array_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %eax,%edi
call   1040 <get_array_addr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <set_count@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_init>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %eax,%edi
call   1040 <get_array_addr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <set_count@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @array_init() {
%1 = alloca i8*
%2 = call i32 @malloc(i32 4)
%3 = call i8* @get_array_addr(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @set_count(i8* %4, i32 0)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
define i8* @array_init() {
%1 = tail call i32 @malloc(i32 4)
%2 = tail call i8* @get_array_addr(i32 %1)
%3 = tail call i32 @set_count(i8* %2, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ clog_init();
void clog_init__(void) { clog_init(); }


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

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

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

LLVM IR (-O2):
define void @clog_init__() {
%1 = tail call i32 (...) @clog_init()
ret void
}
/* Type definitions */
struct arg_date {
  int dummy;
};

/* Variables and functions */
struct arg_date *arg_daten(char const *, char const *, char const *,
                           char const *, int, int, char const *);
struct arg_date *arg_date1(const char *shortopts, const char *longopts,
                           const char *format, const char *datatype,
                           const char *glossary) {
  return arg_daten(shortopts, longopts, format, datatype, 1, 1, glossary);
}


x86 assembly (clang, -O0):
<arg_date1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    $0x1,%r9d
mov    %r9d,%r8d
mov    %rax,(%rsp)
call   1030 <arg_daten@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_date1>:
push   %rax
mov    %r8,(%rsp)
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <arg_daten@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.arg_date = type { i32 }
define %struct.arg_date* @arg_date1(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call %struct.arg_date* @arg_daten(i8* %11, i8* %12, i8* %13, i8* %14, i32 1, i32 1, i8* %15)
ret %struct.arg_date* %16
}

LLVM IR (-O2):
%struct.arg_date = type { i32 }
define %struct.arg_date* @arg_date1(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call %struct.arg_date* @arg_daten(i8* %0, i8* %1, i8* %2, i8* %3, i32 1, i32 1, i8* %4)
ret %struct.arg_date* %6
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, char **);
int main(int argc, char **argv, char **envp) {
  execve("./hello.sh", argv, envp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xece(%rip),%rdi
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"./hello.sh\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %5
%8 = load i8**, i8*** %6
%9 = call i32 @execve(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"./hello.sh\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @execve(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1, i8** %2)
ret i32 0
}
void __attribute__((weak)) EXTI9_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI9_Callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void cli_print_line(char *line) {
  printf("%s", line);
  printf("\n");
}


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

x86 assembly (clang, -O2):
<cli_print_line>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @cli_print_line(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __writeString(char *);
int spaceOut(int val) {
  for (; val > 0; val -= 10000) {
    if ((val % 100000) == 0)
      __writeString(" ");
  }
}


x86 assembly (clang, -O0):
<spaceOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115a <spaceOut+0x4a>
mov    -0x8(%rbp),%eax
mov    $0x186a0,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1145 <spaceOut+0x35>
lea    0xec0(%rip),%rdi
call   1030 <__writeString@plt>
jmp    114a <spaceOut+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x2710,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <spaceOut+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaceOut>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    116d <spaceOut+0x5d>
mov    %edi,%ebx
lea    0x2710(%rbx),%ebp
lea    0xed9(%rip),%r14
jmp    1144 <spaceOut+0x34>
nopl   0x0(%rax)
add    $0xffffd8f0,%ebx
add    $0xffffd8f0,%ebp
cmp    $0x2710,%ebp
jle    116d <spaceOut+0x5d>
mov    %ebx,%eax
shr    $0x5,%eax
imul   $0xa7c5ac5,%rax,%rax
shr    $0x27,%rax
imul   $0xfffe7960,%eax,%eax
add    %ebp,%eax
cmp    $0x2710,%eax
jne    1130 <spaceOut+0x20>
mov    %r14,%rdi
call   1030 <__writeString@plt>
jmp    1130 <spaceOut+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i32 @spaceOut(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %3
%9 = srem i32 %8, 100000
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @__writeString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 10000
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i32 @spaceOut(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ %0, %1 ]
%5 = urem i32 %4, 100000
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @__writeString(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = add nsw i32 %4, -10000
%11 = icmp sgt i32 %4, 10000
br i1 %11, label %3, label %12
12: ; preds = %9, %1
ret i32 undef
}
/* Variables and functions */
scalar_t__ tan(float);
float sdTan(float s) { return (float)tan(s * (3.1415926535f / 180.0)); }


x86 assembly (clang, -O0):
<sdTan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <tan@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdTan>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <tan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sdTan(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, 0x3F91DF46AAAAAAAB
%6 = fptrunc double %5 to float
%7 = call i64 @tan(float %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @sdTan(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x3F91DF46AAAAAAAB
%4 = fptrunc double %3 to float
%5 = tail call i64 @tan(float %4)
%6 = sitofp i64 %5 to float
ret float %6
}
int re_search(bufp, string, length, start, range, regs)
struct re_pattern_buffer *bufp;
const char *string;
int length, start, range;
struct re_registers *regs;
{
  return re_search_stub(bufp, string, length, start, range, length, regs, 0);
}


x86 assembly (clang, -O0):
<re_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x28(%rbp),%rax
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1030 <re_search_stub@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_search>:
push   %rax
mov    %r9,%r10
mov    %edx,%r9d
xor    %eax,%eax
push   $0x0
push   %r10
call   1030 <re_search_stub@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = alloca %struct.re_pattern_buffer*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.re_registers* %5, %struct.re_registers** %12
%13 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %9
%19 = load %struct.re_registers*, %struct.re_registers** %12
%20 = call i32 (%struct.re_pattern_buffer*, i8*, i32, i32, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_search_stub to i32 (%struct.re_pattern_buffer*, i8*, i32, i32, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %13, i8* %14, i32 %15, i32 %16, i32 %17, i32 %18, %struct.re_registers* %19, i32 0)
ret i32 %20
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = tail call i32 (%struct.re_pattern_buffer*, i8*, i32, i32, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_search_stub to i32 (%struct.re_pattern_buffer*, i8*, i32, i32, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %2, %struct.re_registers* %5, i32 0)
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseq_set_constrained(uint8_t *p_mp2vseq) { p_mp2vseq[11] |= 0x4; }


x86 assembly (clang, -O0):
<mp2vseq_set_constrained>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%ecx
or     $0x4,%ecx
mov    %ecx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseq_set_constrained>:
orb    $0x4,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseq_set_constrained(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 11
%5 = load i32, i32* %4
%6 = or i32 %5, 4
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mp2vseq_set_constrained(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 11
%3 = load i32, i32* %2
%4 = or i32 %3, 4
store i32 %4, i32* %2
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ INT16_MAX;
scalar_t__ INT16_MIN;
int16_t __hsail_sat_add_s16(int16_t a, int16_t b) {
  int32_t c = (int32_t)a + (int32_t)b;
  if (c > INT16_MAX)
    return INT16_MAX;
  else if (c < INT16_MIN)
    return INT16_MIN;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_add_s16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%rax
jle    113f <__hsail_sat_add_s16+0x3f>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_add_s16+0x6e>
mov    -0x20(%rbp),%rax
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
jge    1166 <__hsail_sat_add_s16+0x66>
mov    0x2e7e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_add_s16+0x6e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_add_s16>:
add    %rsi,%rdi
mov    0x2ed6(%rip),%rcx
mov    0x2ec7(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rdi
cmovge %rdi,%rax
mov    (%rcx),%rcx
cmp    %rcx,%rdi
cmovg  %rcx,%rax
ret

LLVM IR (-O0):
@INT16_MAX = global i64 0
@INT16_MIN = global i64 0
define i64 @__hsail_sat_add_s16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add nsw i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = load i64, i64* @INT16_MAX
%12 = icmp sgt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i64, i64* @INT16_MAX
store i64 %14, i64* %3
br label %23
15: ; preds = %2
%16 = load i64, i64* %6
%17 = load i64, i64* @INT16_MIN
%18 = icmp slt i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i64, i64* @INT16_MIN
store i64 %20, i64* %3
br label %23
21: ; preds = %15
%22 = load i64, i64* %6
store i64 %22, i64* %3
br label %23
23: ; preds = %21, %19, %13
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
@INT16_MAX = global i64 0
@INT16_MIN = global i64 0
define i64 @__hsail_sat_add_s16(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = load i64, i64* @INT16_MAX
%5 = icmp sgt i64 %3, %4
%6 = load i64, i64* @INT16_MIN
%7 = icmp slt i64 %3, %6
%8 = select i1 %7, i64 %6, i64 %3
%9 = select i1 %5, i64 %4, i64 %8
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void debugx32_deflabel(char *name, int32_t segment, int64_t offset,
                       int is_global, char *special) {
  (void)name;
  (void)segment;
  (void)offset;
  (void)is_global;
  (void)special;
}


x86 assembly (clang, -O0):
<debugx32_deflabel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @debugx32_deflabel(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
ret void
}

LLVM IR (-O2):
define void @debugx32_deflabel(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ stdout;
void al_ansi_escape_color(int fg, int bg, int style) {
  fprintf(stdout, "\\[\\e[0;38;5;%d;48;5;%d;%dm\\]", fg, bg, style);
}


x86 assembly (clang, -O0):
<al_ansi_escape_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_ansi_escape_color>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [29 x i8] c"\\[\\e[0;38;5;%d;48;5;%d;%dm\\]\00"
define void @al_ansi_escape_color(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stdout
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [29 x i8] c"\\[\\e[0;38;5;%d;48;5;%d;%dm\\]\00"
define void @al_ansi_escape_color(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
indreg0reg1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = r1; }


x86 assembly (clang, -O0):
<indreg0reg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0reg1_set>:
mov    %si,(%r8)
ret

LLVM IR (-O0):
define i32 @indreg0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %9
%17 = load i16*, i16** %12
store i16 %16, i16* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @indreg0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = trunc i32 %1 to i16
store i16 %7, i16* %4
ret i32 undef
}
void free_2d_realnums(double **tdarr, int rows, int cols) {
  int i;
  for (i = 0; i < rows; i++)
    free(tdarr[i]);
  free(tdarr);
}


x86 assembly (clang, -O0):
<free_2d_realnums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <free_2d_realnums+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <free_2d_realnums+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2d_realnums>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2d_realnums+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2d_realnums+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2d_realnums(double** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds double*, double** %0, i64 %8
%10 = bitcast double** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast double** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decimalToBinary(long, int, int, char *);
void signedMagnitude(long n, int size, char result[size + 1]) {
  result[size] = '\0';
  if (n < 0) {
    n *= -1;
    result[0] = '1';
  } else {
    result[0] = '0';
  }
  decimalToBinary(n, 1, size, result);
}


x86 assembly (clang, -O0):
<signedMagnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpq   $0x0,-0x8(%rbp)
jge    114f <signedMagnitude+0x3f>
imul   $0xffffffffffffffff,-0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x31,(%rax)
jmp    1156 <signedMagnitude+0x46>
mov    -0x18(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <decimalToBinary@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedMagnitude>:
mov    %rdx,%rcx
movslq %esi,%rdx
movb   $0x0,(%rcx,%rdx,1)
mov    %rdi,%rax
shr    $0x3f,%rax
or     $0x30,%al
mov    %rdi,%rsi
neg    %rsi
cmovns %rsi,%rdi
mov    %al,(%rcx)
mov    $0x1,%esi
jmp    1030 <decimalToBinary@plt>

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

LLVM IR (-O2):
define void @signedMagnitude(i64 %0, i32 %1, i8* %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
store i8 0, i8* %5
%6 = icmp slt i64 %0, 0
%7 = sub nsw i64 0, %0
%8 = select i1 %6, i8 49, i8 48
%9 = select i1 %6, i64 %7, i64 %0
store i8 %8, i8* %2
%10 = tail call i32 @decimalToBinary(i64 %9, i32 1, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int tuner_i2c_write(void *, unsigned char, int, unsigned char *, int);
signed int fc8180_write(void *handle, unsigned char addr, unsigned char data) {
  signed int res;
  res = tuner_i2c_write(handle, addr, 1, &data, 1);
  return res;
}


x86 assembly (clang, -O0):
<fc8180_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%r8d
lea    -0xa(%rbp),%rcx
movzbl -0x9(%rbp),%esi
mov    %r8d,%edx
call   1030 <tuner_i2c_write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8180_write>:
push   %rax
mov    %dl,0x7(%rsp)
lea    0x7(%rsp),%rcx
mov    $0x1,%edx
mov    $0x1,%r8d
call   1030 <tuner_i2c_write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fc8180_write(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
store i8 %2, i8* %4
%5 = call i32 @tuner_i2c_write(i8* %0, i8 zeroext %1, i32 1, i8* %4, i32 1)
ret i32 %5
}