xunge/DecIR huggingface dataset:
int strcmp(const char *s1, const char *s2) {
  signed char c1, c2;
  for (;;) {
    c1 = (signed char)*s1++;
    c2 = (signed char)*s2++;
    if (c1 != c2)
      return (int)c1 - (int)c2;
    else if (c1 == '\0')
      return 0;
  }
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
je     1156 <strcmp+0x56>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1179 <strcmp+0x79>
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jne    116f <strcmp+0x6f>
movl   $0x0,-0x4(%rbp)
jmp    1179 <strcmp+0x79>
jmp    1174 <strcmp+0x74>
jmp    110c <strcmp+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%eax
movsbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i8* [ %1, %2 ], [ %14, %13 ]
%5 = phi i8* [ %0, %2 ], [ %15, %13 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp eq i8 %6, %7
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = sext i8 %6 to i32
%11 = sext i8 %7 to i32
%12 = sub nsw i32 %10, %11
br label %17
13: ; preds = %3
%14 = getelementptr inbounds i8, i8* %4, i64 1
%15 = getelementptr inbounds i8, i8* %5, i64 1
%16 = icmp eq i8 %6, 0
br i1 %16, label %17, label %3
17: ; preds = %13, %9
%18 = phi i32 [ %12, %9 ], [ 0, %13 ]
ret i32 %18
}
void kexit(int err_num) {}


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

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

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

LLVM IR (-O2):
define void @kexit(i32 %0) {
ret void
}
void foo_void(void) {}


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

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

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

LLVM IR (-O2):
define void @foo_void() {
ret void
}
void toi_usm_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @toi_usm_exit() {
ret void
}
int test_imm_B7uint16_mem(unsigned short *val) {
  return ((*val) & (0xB7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B7uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xb7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B7uint16_mem>:
testb  $0xb7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B7uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 183
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 183
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo_2_1_1_2_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_2_2_2_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void data_segment_gdata() {
  output_line("\t.area  SMALLC_GENERATED_DATA  (REL,CON,DSEG)");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"\09.area SMALLC_GENERATED_DATA (REL,CON,DSEG)\00"
define void @data_segment_gdata() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"\09.area SMALLC_GENERATED_DATA (REL,CON,DSEG)\00"
define void @data_segment_gdata() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
int HTTPWrapperSSLNegotiate(int s, const struct sockaddr *name, int namelen,
                            char *hostname) {
  return -1;
}


x86 assembly (clang, -O0):
<HTTPWrapperSSLNegotiate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.sockaddr = type opaque
define i32 @HTTPWrapperSSLNegotiate(i32 %0, %struct.sockaddr* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 -1
}
float f_cos_xx_6(float xx) {
  return 1 + xx * (-0.3084251375340424 +
                   xx * (0.01585247243656319 + xx * (-0.0003206691702035272)));
}


x86 assembly (clang, -O0):
<f_cos_xx_6>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xee4(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xee0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec0(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_cos_xx_6>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee8(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f_cos_xx_6(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0xBF3503EF994EDCFB, double 0x3F903BA16AB3FFC3)
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double 0xBFD3BD3CC9BE45DD)
%11 = call double @llvm.fmuladd.f64(double %4, double %10, double 1.000000e+00)
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @f_cos_xx_6(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0xBF3503EF994EDCFB, double 0x3F903BA16AB3FFC3)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 0xBFD3BD3CC9BE45DD)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 1.000000e+00)
%6 = fptrunc double %5 to float
ret float %6
}
void f1(char *a, char *b) { __clear_cache(a, b); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <__clear_cache>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nop

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
jmp    1110 <__clear_cache>
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @f1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__clear_cache to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @f1(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__clear_cache to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t badvpn_read_be32(const char *c_ptr) {
  const uint8_t *ptr = (const uint8_t *)c_ptr;
  return ((uint32_t)ptr[0] << 24) | ((uint32_t)ptr[1] << 16) |
         ((uint32_t)ptr[2] << 8) | ((uint32_t)ptr[3] << 0);
}


x86 assembly (clang, -O0):
<badvpn_read_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<badvpn_read_be32>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @badvpn_read_be32(i8* %0) {
%2 = alloca i8*
%3 = alloca i64*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 24
%11 = load i64*, i64** %3
%12 = getelementptr inbounds i64, i64* %11, i64 1
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 16
%16 = or i32 %10, %15
%17 = load i64*, i64** %3
%18 = getelementptr inbounds i64, i64* %17, i64 2
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 8
%22 = or i32 %16, %21
%23 = load i64*, i64** %3
%24 = getelementptr inbounds i64, i64* %23, i64 3
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = shl i32 %26, 0
%28 = or i32 %22, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @badvpn_read_be32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 16
%11 = or i32 %10, %5
%12 = getelementptr inbounds i8, i8* %0, i64 16
%13 = bitcast i8* %12 to i64*
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = shl i32 %15, 8
%17 = or i32 %11, %16
%18 = getelementptr inbounds i8, i8* %0, i64 24
%19 = bitcast i8* %18 to i64*
%20 = load i64, i64* %19
%21 = trunc i64 %20 to i32
%22 = or i32 %17, %21
ret i32 %22
}
void disable_scratch_hw_bp(struct task *task, struct breakpoint *bp) {
  (void)task;
  (void)bp;
}


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

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

LLVM IR (-O0):
%struct.task = type opaque
%struct.breakpoint = type opaque
define void @disable_scratch_hw_bp(%struct.task* %0, %struct.breakpoint* %1) {
%3 = alloca %struct.task*
%4 = alloca %struct.breakpoint*
store %struct.task* %0, %struct.task** %3
store %struct.breakpoint* %1, %struct.breakpoint** %4
%5 = load %struct.task*, %struct.task** %3
%6 = load %struct.breakpoint*, %struct.breakpoint** %4
ret void
}

LLVM IR (-O2):
%struct.task = type opaque
%struct.breakpoint = type opaque
define void @disable_scratch_hw_bp(%struct.task* nocapture %0, %struct.breakpoint* nocapture %1) {
ret void
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
gid_t getegid(void) {
  printf("getegid\n");
  return 0xaffab1e;
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"getegid\00"
define i32 @getegid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 184527646
}
int tokenize_close() { return 1; }


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

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

LLVM IR (-O0):
define i32 @tokenize_close() {
ret i32 1
}

LLVM IR (-O2):
define i32 @tokenize_close() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Lut_N(double *, double *, int);
void Lut_10(double *out, double *in) { Lut_N(out, in, 10); }


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

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

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

LLVM IR (-O2):
define void @Lut_10(double* %0, double* %1) {
%3 = tail call i32 @Lut_N(double* %0, double* %1, i32 10)
ret void
}
/* Variables and functions */
float Com_Clamp(float min, float max, float value) {
  if (value < min) {
    return min;
  }
  if (value > max) {
    return max;
  }
  return value;
}


x86 assembly (clang, -O0):
<Com_Clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <Com_Clamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <Com_Clamp+0x5d>
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <Com_Clamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <Com_Clamp+0x5d>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_Clamp>:
minss  %xmm2,%xmm1
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @Com_Clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %7
%9 = load float, float* %5
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %5
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %7
%15 = load float, float* %6
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %6
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %7
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @Com_Clamp(float %0, float %1, float %2) {
%4 = fcmp olt float %2, %0
%5 = fcmp ogt float %2, %1
%6 = select i1 %5, float %1, float %2
%7 = select i1 %4, float %0, float %6
ret float %7
}
void free_3d_int(int ***p, int ndim1) {
  int i;
  free(p[0][0]);
  for (i = 0; i < ndim1; i++)
    free(p[i]);
  free(p);
}


x86 assembly (clang, -O0):
<free_3d_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <free_3d_int+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <free_3d_int+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free_3d_int(i32*** nocapture %0, i32 %1) {
%3 = bitcast i32*** %0 to i8***
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds i32**, i32*** %0, i64 %10
%12 = bitcast i32*** %11 to i8**
%13 = load i8*, i8** %12
tail call void @free(i8* %13)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %2
%17 = bitcast i32*** %0 to i8*
tail call void @free(i8* %17)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_servo_position(int, int);
void lib_set_servo_position(int servo, int position) {
  set_servo_position(servo, position);
}


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

x86 assembly (clang, -O2):
<lib_set_servo_position>:
jmp    1030 <set_servo_position@plt>

LLVM IR (-O0):
define void @lib_set_servo_position(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 @set_servo_position(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @lib_set_servo_position(i32 %0, i32 %1) {
%3 = tail call i32 @set_servo_position(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "false", message); }


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

x86 assembly (clang, -O2):
<g_error>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ copy_frame_data(struct obs_source_frame *,
                                   struct obs_source_frame const *);
void obs_source_frame_copy(struct obs_source_frame *dst,
                           const struct obs_source_frame *src) {
  copy_frame_data(dst, src);
}


x86 assembly (clang, -O0):
<obs_source_frame_copy>:
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 <copy_frame_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obs_source_frame_copy>:
jmp    1030 <copy_frame_data@plt>

LLVM IR (-O0):
%struct.obs_source_frame = type { i32 }
define void @obs_source_frame_copy(%struct.obs_source_frame* %0, %struct.obs_source_frame* %1) {
%3 = alloca %struct.obs_source_frame*
%4 = alloca %struct.obs_source_frame*
store %struct.obs_source_frame* %0, %struct.obs_source_frame** %3
store %struct.obs_source_frame* %1, %struct.obs_source_frame** %4
%5 = load %struct.obs_source_frame*, %struct.obs_source_frame** %3
%6 = load %struct.obs_source_frame*, %struct.obs_source_frame** %4
%7 = call i32 @copy_frame_data(%struct.obs_source_frame* %5, %struct.obs_source_frame* %6)
ret void
}

LLVM IR (-O2):
%struct.obs_source_frame = type { i32 }
define void @obs_source_frame_copy(%struct.obs_source_frame* %0, %struct.obs_source_frame* %1) {
%3 = tail call i32 @copy_frame_data(%struct.obs_source_frame* %0, %struct.obs_source_frame* %1)
ret void
}
int f2(long c, int shamt) { return 1 << (c << shamt); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    %cl,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%ecx
shl    %cl,%rdi
mov    $0x1,%eax
mov    %edi,%ecx
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f2(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = shl i64 %5, %7
%9 = trunc i64 %8 to i32
%10 = shl i32 1, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f2(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 %0, %3
%5 = trunc i64 %4 to i32
%6 = shl nuw i32 1, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
int /*<<< orphan*/ __coverity_mark_as_afm_freed__(void *, char *);
void g_free(void *ptr) {
  __coverity_free__(ptr);
  __coverity_mark_as_afm_freed__(ptr, "g_free");
}


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

x86 assembly (clang, -O2):
<g_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <__coverity_free__@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__coverity_mark_as_afm_freed__@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"g_free\00"
define void @g_free(i8* %0) {
%2 = tail call i32 @__coverity_free__(i8* %0)
%3 = tail call i32 @__coverity_mark_as_afm_freed__(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *_intel_fast_memcpy(void *dest, const void *src, size_t n) {
  return memcpy(dest, src, n);
}


x86 assembly (clang, -O0):
<_intel_fast_memcpy>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @_intel_fast_memcpy(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
ret i8* %7
}

LLVM IR (-O2):
define i8* @_intel_fast_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
double _abr(r)
double r;
{ return (r >= 0 ? r : -r); }


x86 assembly (clang, -O0):
<_abr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <_abr+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <_abr+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_abr>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmplesd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @_abr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @_abr(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
int cairo_code_draw_casNLabel_get_height() { return 10; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casNLabel_get_height() {
ret i32 10
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casNLabel_get_height() {
ret i32 10
}
int add(int i, int y) { return i + y; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int main() {
  volatile int a = 0x01234567;
  if (__builtin_bswap32(a) != 0x67452301) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1234567,-0x8(%rbp)
mov    -0x8(%rbp),%eax
bswap  %eax
cmp    $0x67452301,%eax
je     112e <main+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <main+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1234567,-0x4(%rsp)
01
mov    -0x4(%rsp),%ecx
xor    %eax,%eax
cmp    $0x1234567,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 19088743, i32* %2
%3 = load volatile i32, i32* %2
%4 = call i32 @llvm.bswap.i32(i32 %3)
%5 = icmp ne i32 %4, 1732584193
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 19088743, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp ne i32 %3, 19088743
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fa_libcmem_free(void *pool, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<fa_libcmem_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @fa_libcmem_free(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 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @fa_libcmem_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fill_circle(int, int, int, int);
void dot(int x, int y, int color, int radius) {
  fill_circle(x + 16, y + 16, radius, color);
}


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

x86 assembly (clang, -O2):
<dot>:
mov    %edx,%eax
add    $0x10,%edi
add    $0x10,%esi
mov    %ecx,%edx
mov    %eax,%ecx
jmp    1030 <fill_circle@plt>

LLVM IR (-O0):
define void @dot(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 16
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 16
%13 = load i32, i32* %8
%14 = load i32, i32* %7
%15 = call i32 @fill_circle(i32 %10, i32 %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @dot(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %0, 16
%6 = add nsw i32 %1, 16
%7 = tail call i32 @fill_circle(i32 %5, i32 %6, i32 %3, i32 %2)
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *cfw_strdup(const char *s) {
  char *copy;
  size_t len;
  len = strlen(s);
  if ((copy = malloc(len + 1)) == NULL)
    return NULL;
  memcpy(copy, s, len + 1);
  return copy;
}


x86 assembly (clang, -O0):
<cfw_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1171 <cfw_strdup+0x41>
movq   $0x0,-0x8(%rbp)
jmp    118e <cfw_strdup+0x5e>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfw_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1162 <cfw_strdup+0x32>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @cfw_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Wc(char);
int /*<<< orphan*/ Wreg(int);
void WregPair(int n) {
  Wreg(n + 1);
  Wc(':');
  Wreg(n);
}


x86 assembly (clang, -O0):
<WregPair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <Wreg@plt>
mov    $0x3a,%edi
call   1030 <Wc@plt>
mov    -0x4(%rbp),%edi
call   1040 <Wreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WregPair>:
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1040 <Wreg@plt>
mov    $0x3a,%edi
call   1030 <Wc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <Wreg@plt>

LLVM IR (-O0):
define void @WregPair(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @Wreg(i32 %4)
%6 = call i32 @Wc(i8 signext 58)
%7 = load i32, i32* %2
%8 = call i32 @Wreg(i32 %7)
ret void
}

LLVM IR (-O2):
define void @WregPair(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @Wreg(i32 %2)
%4 = tail call i32 @Wc(i8 signext 58)
%5 = tail call i32 @Wreg(i32 %0)
ret void
}
const char *SVN_RevString(void) {
  return "Mar 17 2022"
         " "
         "15:29:02";
}


x86 assembly (clang, -O0):
<SVN_RevString>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SVN_RevString>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Mar 17 2022 15:29:02\00"
define i8* @SVN_RevString() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"Mar 17 2022 15:29:02\00"
define i8* @SVN_RevString() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
void av_murmur3_final() {}


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

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

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

LLVM IR (-O2):
define void @av_murmur3_final() {
ret void
}
/* Variables and functions */
char *mempcpy(char *, char *, int);
void mempcpy0() {
  char src[] = {1, 2, 3, 4};
  char dst[5] = {0};
  mempcpy(dst, src, 4);
  if (mempcpy(dst, src, 4) != &dst[4]) {
    (void)*(char *)0;
  }
  if (dst[0] != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<mempcpy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x9(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <memset@plt>
lea    -0x9(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <mempcpy@plt>
lea    -0x9(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <mempcpy@plt>
lea    -0x9(%rbp),%rcx
add    $0x4,%rcx
cmp    %rcx,%rax
je     1176 <mempcpy0+0x56>
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
je     1183 <mempcpy0+0x63>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mempcpy0>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x4030201,0x14(%rsp)
04
movb   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
lea    0x14(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <mempcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <mempcpy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.mempcpy0.src = [4 x i8] c"\01\02\03\04"
define void @mempcpy0() {
%1 = alloca [4 x i8]
%2 = alloca [5 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [5 x i8]* %2 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%7 = call i8* @mempcpy(i8* %5, i8* %6, i32 4)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%10 = call i8* @mempcpy(i8* %8, i8* %9, i32 4)
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
%12 = icmp ne i8* %10, %11
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = load i8, i8* null
br label %15
15: ; preds = %13, %0
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i8, i8* null
br label %22
22: ; preds = %20, %15
ret void
}

LLVM IR (-O2):
define void @mempcpy0() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = bitcast i32* %1 to i8*
store i32 67305985, i32* %1
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i8* @mempcpy(i8* %4, i8* %3, i32 4)
%6 = call i8* @mempcpy(i8* %4, i8* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float strToFloat(char string[]);
  printf("%f\n", strToFloat("-867.6921"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <strToFloat@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [10 x i8] c"-867.6921\00"
define i32 @main() {
%1 = tail call float @strToFloat(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %1)
ret i32 0
}
int Pos(int n, int i, int j) { return (i * (n + 2 - i)) + j; }


x86 assembly (clang, -O0):
<Pos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pos>:
sub    %esi,%edi
lea    0x2(%rdi),%eax
imul   %esi,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Pos(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* %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 2
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = mul nsw i32 %7, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Pos(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 2
%5 = sub i32 %4, %1
%6 = mul nsw i32 %5, %1
%7 = add nsw i32 %6, %2
ret i32 %7
}
int iface_get_mif(struct iface *iface __attribute__((unused))) { return -1; }


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

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

LLVM IR (-O0):
%struct.iface = type opaque
define i32 @iface_get_mif(%struct.iface* %0) {
%2 = alloca %struct.iface*
store %struct.iface* %0, %struct.iface** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.iface = type opaque
define i32 @iface_get_mif(%struct.iface* nocapture readnone %0) {
ret i32 -1
}
double UC_11_1_11(double F_g_s_rep, double F_g_u_d) {
  return (F_g_s_rep / F_g_u_d);
}


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

x86 assembly (clang, -O2):
<UC_11_1_11>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @UC_11_1_11(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
int pix_version(irafheader)
char *irafheader;
{
  if (irafncmp(irafheader, "impix", 5) != 0) {
    if (strncmp(irafheader, "impv2", 5) != 0)
      return (0);
    else
      return (2);
  } else
    return (1);
}


x86 assembly (clang, -O0):
<pix_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x5,%edx
mov    $0x0,%al
call   1040 <irafncmp@plt>
cmp    $0x0,%eax
je     1182 <pix_version+0x62>
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1176 <pix_version+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1189 <pix_version+0x69>
movl   $0x2,-0x4(%rbp)
jmp    1189 <pix_version+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pix_version>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <irafncmp@plt>
test   %eax,%eax
je     115c <pix_version+0x3c>
lea    0xec4(%rip),%rsi
mov    $0x5,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"impix\00"
@.str.1 = [6 x i8] c"impv2\00"
define i32 @pix_version(i8* %0) {
%2 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @irafncmp to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 0
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int getlen(char *const arr[]) {
  int i;
  for (i = 0; arr[i] != NULL; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<getlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <getlen+0x35>
jmp    1127 <getlen+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <getlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @getlen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}