xunge/DecIR huggingface dataset:
void do_while_2_Good() {
  int count = 10;
  int a[count];
  int i = 0;
  do {
    a[i] = 0;
  } while (++i < count);
}


x86 assembly (clang, -O0):
<do_while_2_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmp    -0x4(%rbp),%eax
jl     113d <do_while_2_Good+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_while_2_Good() {
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *flu_strdup(char *s) {
  int l = strlen(s);
  char *r = calloc(l + 1, sizeof(char));
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<flu_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flu_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @flu_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @calloc(i32 %8, i32 1)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @flu_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int test_imm_DEuint16_reg(unsigned short val) {
  return ((val) & (0xDE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DEuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xde,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DEuint16_reg>:
test   $0xde,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DEuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 222
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
__attribute__((no, noclone)) int f9(signed char x, signed char y) {
  int a = x;
  int b = y;
  int c = a + b;
  return c & 0x78;
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x78,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
lea    (%rdi,%rsi,1),%eax
and    $0x78,%eax
ret

LLVM IR (-O0):
define i32 @f9(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
store i32 %9, i32* %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = and i32 %15, 120
ret i32 %16
}

LLVM IR (-O2):
define i32 @f9(i8 signext %0, i8 signext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = add nuw nsw i32 %4, %3
%6 = and i32 %5, 120
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
char const *ip(char const *, int /*<<< orphan*/);
const char *ipv6(const char *interface) { return ip(interface, AF_INET6); }


x86 assembly (clang, -O0):
<ipv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <ip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ip@plt>

LLVM IR (-O0):
@AF_INET6 = global i32 0
define i8* @ipv6(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @AF_INET6
%5 = call i8* @ip(i8* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@AF_INET6 = global i32 0
define i8* @ipv6(i8* %0) {
%2 = load i32, i32* @AF_INET6
%3 = tail call i8* @ip(i8* %0, i32 %2)
ret i8* %3
}
/* Type definitions */
struct pmd_part {
  int dummy;
};
struct fmdriver_work {
  int dummy;
};
struct driver_pmd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pmd_cmdd6_md(struct fmdriver_work *, struct driver_pmd *,
                                struct pmd_part *);
int /*<<< orphan*/ pmd_part_lfo_flip(struct pmd_part *);
void pmd_cmdbd_lfo2_md(struct fmdriver_work *work, struct driver_pmd *pmd,
                       struct pmd_part *part) {
  pmd_part_lfo_flip(part);
  pmd_cmdd6_md(work, pmd, part);
  pmd_part_lfo_flip(part);
}


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

x86 assembly (clang, -O2):
<pmd_cmdbd_lfo2_md>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <pmd_part_lfo_flip@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <pmd_cmdd6_md@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <pmd_part_lfo_flip@plt>

LLVM IR (-O0):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdbd_lfo2_md(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%7 = load %struct.pmd_part*, %struct.pmd_part** %6
%8 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %7)
%9 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
%10 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%11 = load %struct.pmd_part*, %struct.pmd_part** %6
%12 = call i32 @pmd_cmdd6_md(%struct.fmdriver_work* %9, %struct.driver_pmd* %10, %struct.pmd_part* %11)
%13 = load %struct.pmd_part*, %struct.pmd_part** %6
%14 = call i32 @pmd_part_lfo_flip(%struct.pmd_part* %13)
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type { i32 }
%struct.driver_pmd = type { i32 }
%struct.pmd_part = type { i32 }
define void @pmd_cmdbd_lfo2_md(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
%5 = tail call i32 @pmd_cmdd6_md(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2)
%6 = tail call i32 @pmd_part_lfo_flip(%struct.pmd_part* %2)
ret void
}
void dot(mode, argc, argv) int mode, argc;
char *argv[];
{ printf("tget/tput not yet implemented Lee...\n"); }


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"tget/tput not yet implemented Lee...\0A\00"
define void @dot(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"tget/tput not yet implemented Lee...\00"
define void @dot(i32 %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int isdigit(char);
int is_number(char *number) {
  int digit = 1;
  while (digit && (*number != '\0')) {
    digit = isdigit(*number);
    number++;
  }
  return digit;
}


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1142 <is_number+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1152 <is_number+0x42>
jmp    1172 <is_number+0x62>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <is_number+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_number>:
push   %rbx
mov    (%rdi),%cl
test   %cl,%cl
je     1139 <is_number+0x29>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %cl,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1140 <is_number+0x30>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1120 <is_number+0x10>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %11
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %11, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = icmp eq i32 %10, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %7, %1
%14 = phi i32 [ 1, %1 ], [ %10, %4 ], [ 0, %7 ]
ret i32 %14
}
void UYVYToNV12() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToNV12() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sha256_finish_ctx(void *, unsigned char *);
void sha256_final(unsigned char *digest, void *context) {
  sha256_finish_ctx(context, digest);
}


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

x86 assembly (clang, -O2):
<sha256_final>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <sha256_finish_ctx@plt>

LLVM IR (-O0):
define void @sha256_final(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 = load i8*, i8** %3
%7 = call i32 @sha256_finish_ctx(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @sha256_final(i8* %0, i8* %1) {
%3 = tail call i32 @sha256_finish_ctx(i8* %1, i8* %0)
ret void
}
/* Variables and functions */
double pow(int, int);
double pot_nonrec(int x, int p) {
  if (p == 0) {
    return 1;
  } else if (x == 0) {
    return 0;
  } else {
    double pot = pow(x, p);
  }
}


x86 assembly (clang, -O0):
<pot_nonrec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    113a <pot_nonrec+0x2a>
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <pot_nonrec+0x56>
cmpl   $0x0,-0xc(%rbp)
jne    1151 <pot_nonrec+0x41>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <pot_nonrec+0x56>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1166 <pot_nonrec+0x56>
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pot_nonrec>:
push   %rax
test   %esi,%esi
je     1120 <pot_nonrec+0x10>
test   %edi,%edi
je     112a <pot_nonrec+0x1a>
call   1030 <pow@plt>
pop    %rax
ret
movsd  0xed8(%rip),%xmm0
pop    %rax
ret
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pot_nonrec(i32 %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store double 1.000000e+00, double* %3
br label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store double 0.000000e+00, double* %3
br label %19
14: ; preds = %10
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call double @pow(i32 %15, i32 %16)
store double %17, double* %6
br label %18
18: ; preds = %14
br label %19
19: ; preds = %9, %13, %18
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @pot_nonrec(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call double @pow(i32 %0, i32 %1)
br label %8
8: ; preds = %4, %2, %6
%9 = phi double [ undef, %6 ], [ 1.000000e+00, %2 ], [ 0.000000e+00, %4 ]
ret double %9
}
double _func(double x) { return (3 * x + 1); }


x86 assembly (clang, -O0):
<_func>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @_func(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %3, double 1.000000e+00)
ret double %4
}

LLVM IR (-O2):
define double @_func(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.000000e+00, double 1.000000e+00)
ret double %2
}
int Check_CPU_support_AES() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Check_CPU_support_AES() {
ret i32 0
}
/* Type definitions */
struct treenode {
  int dummy;
};

/* Variables and functions */
struct treenode *make_tree();
void main() { struct treenode *root = make_tree(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <make_tree@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.treenode = type { i32 }
define void @main() {
%1 = alloca %struct.treenode*
%2 = call %struct.treenode* (...) @make_tree()
store %struct.treenode* %2, %struct.treenode** %1
ret void
}

LLVM IR (-O2):
%struct.treenode = type { i32 }
define void @main() {
%1 = tail call %struct.treenode* (...) @make_tree()
ret void
}
double int2double(int x) { return x; }


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

x86 assembly (clang, -O2):
<int2double>:
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @int2double(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
ret double %4
}

LLVM IR (-O2):
define double @int2double(i32 %0) {
%2 = sitofp i32 %0 to double
ret double %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_initialize_number_of_dobldobl_polynomials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(333, &length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_initialize_number_of_dobldobl_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x14d,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_initialize_number_of_dobldobl_polynomials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x14d,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_initialize_number_of_dobldobl_polynomials(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 333, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_dobldobl_polynomials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 333, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Type definitions */
struct addr {
  int dummy;
};

/* Variables and functions */
struct addr *make_addr_unix_abstract(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
struct addr *make_addr_unix_abstract_s(const char *name) {
  return make_addr_unix_abstract(name, strlen(name));
}


x86 assembly (clang, -O0):
<make_addr_unix_abstract_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <make_addr_unix_abstract@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_addr_unix_abstract_s>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <make_addr_unix_abstract@plt>

LLVM IR (-O0):
%struct.addr = type { i32 }
define %struct.addr* @make_addr_unix_abstract_s(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call %struct.addr* @make_addr_unix_abstract(i8* %3, i32 %5)
ret %struct.addr* %6
}

LLVM IR (-O2):
%struct.addr = type { i32 }
define %struct.addr* @make_addr_unix_abstract_s(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call %struct.addr* @make_addr_unix_abstract(i8* %0, i32 %2)
ret %struct.addr* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void displayMyInt(char *key, void *data) {
  int *intData = data;
  printf("\nkey: %s data: %d", key, *intData);
}


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

x86 assembly (clang, -O2):
<displayMyInt>:
mov    %rdi,%rax
mov    (%rsi),%edx
lea    0xee4(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"\0Akey: %s data: %d\00"
define void @displayMyInt(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** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i8*, i8** %3
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0Akey: %s data: %d\00"
define void @displayMyInt(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4)
ret void
}
int test_imm_34uint16_mem(unsigned short *val) {
  return ((*val) & (0x34 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_34uint16_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, 52
%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_34uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 52
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void vfdlib_fastclear(char *buffer) {
  int i;
  int *intBuffer = (int *)buffer;
  for (i = 0; i < (32 * 64) >> 2; i++)
    *(intBuffer++) = 0;
}


x86 assembly (clang, -O0):
<vfdlib_fastclear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x200,-0xc(%rbp)
jge    1147 <vfdlib_fastclear+0x47>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
movl   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <vfdlib_fastclear+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfdlib_fastclear>:
push   %rax
mov    $0x800,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @vfdlib_fastclear(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
struct hashmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hashmap_clear_destroy(struct hashmap *);
struct hashmap *hashmap_new();
int /*<<< orphan*/ hashmap_set(struct hashmap *, char *, char *);
int test_hashmap_clear_destroy(void) {
  struct hashmap *map;
  map = hashmap_new();
  hashmap_set(map, "test", "hello");
  hashmap_clear_destroy(map);
  return 0;
}


x86 assembly (clang, -O0):
<test_hashmap_clear_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <hashmap_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
lea    0xeb0(%rip),%rdx
call   1040 <hashmap_set@plt>
mov    -0x8(%rbp),%rdi
call   1050 <hashmap_clear_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hashmap_clear_destroy>:
push   %rbx
xor    %eax,%eax
call   1030 <hashmap_new@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rsi
lea    0xebc(%rip),%rdx
mov    %rax,%rdi
call   1040 <hashmap_set@plt>
mov    %rbx,%rdi
call   1050 <hashmap_clear_destroy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hashmap = type { i32 }
@.str = [5 x i8] c"test\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @test_hashmap_clear_destroy() {
%1 = alloca %struct.hashmap*
%2 = call %struct.hashmap* (...) @hashmap_new()
store %struct.hashmap* %2, %struct.hashmap** %1
%3 = load %struct.hashmap*, %struct.hashmap** %1
%4 = call i32 @hashmap_set(%struct.hashmap* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = load %struct.hashmap*, %struct.hashmap** %1
%6 = call i32 @hashmap_clear_destroy(%struct.hashmap* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.hashmap = type { i32 }
@.str = [5 x i8] c"test\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @test_hashmap_clear_destroy() {
%1 = tail call %struct.hashmap* (...) @hashmap_new()
%2 = tail call i32 @hashmap_set(%struct.hashmap* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @hashmap_clear_destroy(%struct.hashmap* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timespec {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ hack_clock_gettime(int /*<<< orphan*/, struct timespec *);
time_t hack_time(time_t *pres) {
  struct timespec ts;
  hack_clock_gettime(CLOCK_REALTIME, &ts);
  time_t now = ts.tv_sec;
  if (pres)
    *pres = now;
  return now;
}


x86 assembly (clang, -O0):
<hack_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <hack_clock_gettime@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1148 <hack_time+0x38>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hack_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <hack_clock_gettime@plt>
mov    0x8(%rsp),%eax
test   %rbx,%rbx
je     1136 <hack_time+0x26>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @hack_time(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.timespec
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32, i32* @CLOCK_REALTIME
%6 = call i32 @hack_clock_gettime(i32 %5, %struct.timespec* %3)
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32*, i32** %2
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = load i32*, i32** %2
store i32 %12, i32* %13
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @hack_time(i32* writeonly %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_REALTIME
%5 = call i32 @hack_clock_gettime(i32 %4, %struct.timespec* %2)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = icmp eq i32* %0, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 %7, i32* %0
br label %10
10: ; preds = %9, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_safe_text(const char *text_to_safe) {
  printf("safe text: %s\n", text_to_safe);
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"safe text: %s\0A\00"
define void @print_safe_text(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int cat(int p[10], int n) { return p[n]; }


x86 assembly (clang, -O0):
<cat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @cat(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @cat(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
void sgi_set_pcylcount(void) {}


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

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

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

LLVM IR (-O2):
define void @sgi_set_pcylcount() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ eb128_compose_264(int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
bool eb128i_less_or_equal_264(const uint64_t alo, const int64_t ahi,
                              const uint64_t blo, const int64_t bhi) {
  return eb128_compose_264(alo, ahi) <= eb128_compose_264(blo, bhi);
}


x86 assembly (clang, -O0):
<eb128i_less_or_equal_264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb128i_less_or_equal_264>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <eb128_compose_264@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <eb128_compose_264@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
setle  %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eb128i_less_or_equal_264(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 = load i32, i32* %6
%11 = call i64 @eb128_compose_264(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @eb128_compose_264(i32 %12, i32 %13)
%15 = icmp sle i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @eb128i_less_or_equal_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @eb128_compose_264(i32 %0, i32 %1)
%6 = tail call i64 @eb128_compose_264(i32 %2, i32 %3)
%7 = icmp sle i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int PMPI_Init(int *, char ***);
int MPI_Init(int *argc, char **argv[]) {
  ;
  return PMPI_Init(argc, argv);
}


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

x86 assembly (clang, -O2):
<MPI_Init>:
jmp    1030 <PMPI_Init@plt>

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

LLVM IR (-O2):
define i32 @MPI_Init(i32* %0, i8*** %1) {
%3 = tail call i32 @PMPI_Init(i32* %0, i8*** %1)
ret i32 %3
}
/* Variables and functions */
void *leakproof_malloc(char const *, unsigned int, unsigned int);
int /*<<< orphan*/ memset(void *, char, unsigned int);
void *leakproof_calloc(const char *file, unsigned line, unsigned n,
                       unsigned size) {
  void *leakproof__block = leakproof_malloc(file, line, n * size);
  if (leakproof__block)
    memset(leakproof__block, '\0', n * size);
  return leakproof__block;
}


x86 assembly (clang, -O0):
<leakproof_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
imul   -0x14(%rbp),%edx
call   1040 <leakproof_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1169 <leakproof_calloc+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%edx
imul   -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leakproof_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
imul   %ecx,%ebx
mov    %ebx,%edx
call   1040 <leakproof_malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1144 <leakproof_calloc+0x24>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @leakproof_calloc(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = mul i32 %3, %2
%6 = tail call i8* @leakproof_malloc(i8* %0, i32 %1, i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @memset(i8* %6, i8 signext 0, i32 %5)
br label %10
10: ; preds = %8, %4
ret i8* %6
}
int average_basic(int num, int a, int b, int c) { return 0; }


x86 assembly (clang, -O0):
<average_basic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @average_basic(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
ret i32 0
}

LLVM IR (-O2):
define i32 @average_basic(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
unsigned long int unsignedlongint_ignoring_signedshortint(unsigned long int x,
                                                          signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedlongint_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedlongint_ignoring_signedshortint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlongint_ignoring_signedshortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
/* Variables and functions */
double M_PI;
double degtorad(double rad) { return rad * M_PI / 180; }


x86 assembly (clang, -O0):
<degtorad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<degtorad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @degtorad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @degtorad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
int android_hideOpenglesWindow(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @android_hideOpenglesWindow() {
ret i32 -1
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int decode_open(struct tcb *, int /*<<< orphan*/);
int sys_open(struct tcb *tcp) { return decode_open(tcp, 0); }


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

x86 assembly (clang, -O2):
<sys_open>:
xor    %esi,%esi
jmp    1030 <decode_open@plt>

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_open(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @decode_open(%struct.tcb* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_open(%struct.tcb* %0) {
%2 = tail call i32 @decode_open(%struct.tcb* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_file_content_read_as_string();
int /*<<< orphan*/ test_str_rstrip();
int main(int argc, char **argv) {
  test_file_content_read_as_string();
  test_str_rstrip();
  printf("\n\nAll test are OK\n\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   1030 <test_file_content_read_as_string@plt>
mov    $0x0,%al
call   1050 <test_str_rstrip@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0A\0AAll test are OK\0A\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 (...) @test_file_content_read_as_string()
%7 = call i32 (...) @test_str_rstrip()
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"\0A\0AAll test are OK\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_file_content_read_as_string()
%4 = tail call i32 (...) @test_str_rstrip()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_43int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x43,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_43int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 67
%7 = icmp ne i64 %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_43int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4390912
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int *functA(int);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int k = 100;
  int *p = NULL;
  p = functA(k);
  printf("k: %d, p: %p\n", k, p);
  printf("*p: %d \n", *p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <functA@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1040 <functA@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    $0x64,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"k: %d, p: %p\0A\00"
@.str.1 = [9 x i8] c"*p: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 100, i32* %2
store i32* null, i32** %3
%4 = load i32, i32* %2
%5 = call i32* @functA(i32 %4)
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %6, i32* %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"k: %d, p: %p\0A\00"
@.str.1 = [9 x i8] c"*p: %d \0A\00"
define i32 @main() {
%1 = tail call i32* @functA(i32 100)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 100, i32* %1)
%3 = load i32, i32* %1
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
int lower(int c) {
  if (c >= 'A' && c <= 'Z') {
    return c + 'a' - 'A';
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <lower+0x2c>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <lower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 97
%12 = sub nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void BrzVariable_ackdown(struct comp *comp, int port) {}


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

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

LLVM IR (-O0):
%struct.comp = type opaque
define void @BrzVariable_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.comp = type opaque
define void @BrzVariable_ackdown(%struct.comp* nocapture %0, i32 %1) {
ret void
}