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

/* Variables and functions */
int /*<<< orphan*/ wcstod(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
int /*<<< orphan*/ wcstof(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
int /*<<< orphan*/ wcstold(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
void uninitvar_wcstof(void) {
  const wchar_t *s;
  wchar_t **endp;
  (void)wcstof(s, endp);
  (void)wcstod(s, endp);
  (void)wcstold(s, endp);
}


x86 assembly (clang, -O0):
<uninitvar_wcstof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <wcstof@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wcstod@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <wcstold@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wcstof>:
push   %rax
call   1040 <wcstof@plt>
call   1030 <wcstod@plt>
pop    %rax
jmp    1050 <wcstold@plt>

LLVM IR (-O0):
define void @uninitvar_wcstof() {
%1 = alloca i32*
%2 = alloca i32**
%3 = load i32*, i32** %1
%4 = load i32**, i32*** %2
%5 = call i32 @wcstof(i32* %3, i32** %4)
%6 = load i32*, i32** %1
%7 = load i32**, i32*** %2
%8 = call i32 @wcstod(i32* %6, i32** %7)
%9 = load i32*, i32** %1
%10 = load i32**, i32*** %2
%11 = call i32 @wcstold(i32* %9, i32** %10)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcstof() {
%1 = tail call i32 @wcstof(i32* undef, i32** undef)
%2 = tail call i32 @wcstod(i32* undef, i32** undef)
%3 = tail call i32 @wcstold(i32* undef, i32** undef)
ret void
}
char *appaserver_parameter_file_get_dbms(void) { return (char *)0; }


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

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

LLVM IR (-O0):
define i8* @appaserver_parameter_file_get_dbms() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @appaserver_parameter_file_get_dbms() {
ret i8* null
}
/* Variables and functions */
unsigned long get_unaligned(unsigned long *);
unsigned long flat_get_addr_from_rp(unsigned long *rp, unsigned long relval) {
  unsigned long addr = get_unaligned(rp);
  if (relval & 0x80000000)
    addr &= 0x003fffff;
  else if (relval & 0x40000000)
    addr &= 0x000003ff;
  return (addr);
}


x86 assembly (clang, -O0):
<flat_get_addr_from_rp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_unaligned@plt>
mov    %rax,-0x18(%rbp)
movabs $0x80000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1158 <flat_get_addr_from_rp+0x48>
mov    -0x18(%rbp),%rax
and    $0x3fffff,%rax
mov    %rax,-0x18(%rbp)
jmp    117f <flat_get_addr_from_rp+0x6f>
mov    -0x10(%rbp),%rax
and    $0x40000000,%rax
cmp    $0x0,%rax
je     117a <flat_get_addr_from_rp+0x6a>
mov    -0x18(%rbp),%rax
and    $0x3ff,%rax
mov    %rax,-0x18(%rbp)
jmp    117f <flat_get_addr_from_rp+0x6f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flat_get_addr_from_rp>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_unaligned@plt>
test   $0x80000000,%ebx
jne    1135 <flat_get_addr_from_rp+0x25>
mov    %eax,%ecx
and    $0x3ff,%ecx
test   $0x40000000,%ebx
cmovne %rcx,%rax
pop    %rbx
ret
and    $0x3fffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @flat_get_addr_from_rp(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = call i64 @get_unaligned(i64* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %4
%9 = and i64 %8, 2147483648
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %5
%13 = and i64 %12, 4194303
store i64 %13, i64* %5
br label %22
14: ; preds = %2
%15 = load i64, i64* %4
%16 = and i64 %15, 1073741824
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i64, i64* %5
%20 = and i64 %19, 1023
store i64 %20, i64* %5
br label %21
21: ; preds = %18, %14
br label %22
22: ; preds = %21, %11
%23 = load i64, i64* %5
ret i64 %23
}

LLVM IR (-O2):
define i64 @flat_get_addr_from_rp(i64* %0, i64 %1) {
%3 = tail call i64 @get_unaligned(i64* %0)
%4 = and i64 %1, 2147483648
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = and i64 %3, 4194303
br label %13
8: ; preds = %2
%9 = and i64 %1, 1073741824
%10 = icmp eq i64 %9, 0
%11 = and i64 %3, 1023
%12 = select i1 %10, i64 %3, i64 %11
br label %13
13: ; preds = %8, %6
%14 = phi i64 [ %7, %6 ], [ %12, %8 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void success(int dev) { printf("    test passed stage %d\n", dev); }


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

x86 assembly (clang, -O2):
<success>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [26 x i8] c" test passed stage %d\0A\00"
define void @success(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int position(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *, int);
int main(void) {
  char *chaine = "mon langage c, langage java, langage php, langage python";
  char *mot = "langage";
  printf("Première occurence de '%s' dans '%s' : %d\n", mot, chaine,
         position(chaine, mot));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xef8(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <position@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0xf07(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <position@plt>
lea    0xefd(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [57 x i8] c"mon langage c, langage java, langage php, langage python\00"
@.str.1 = [8 x i8] c"langage\00"
@.str.2 = [44 x i8] c"Premi\C3\A8re occurence de '%s' dans '%s' : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @position(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"mon langage c, langage java, langage php, langage python\00"
@.str.1 = [8 x i8] c"langage\00"
@.str.2 = [44 x i8] c"Premi\C3\A8re occurence de '%s' dans '%s' : %d\0A\00"
define i32 @main() {
%1 = tail call i32 @position(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
float convertTemperature(char msb, char lsb) {
  signed int rawval = 0;
  if ((msb & (1 << 7)) > 0) {
    rawval -= 0x10000;
  }
  rawval += msb << 8;
  rawval += lsb;
  return (float)rawval * 0.0625;
}


x86 assembly (clang, -O0):
<convertTemperature>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jle    1134 <convertTemperature+0x34>
mov    -0x8(%rbp),%eax
sub    $0x10000,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x8,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertTemperature>:
mov    %edi,%eax
and    $0xffff0000,%eax
shl    $0x8,%edi
add    %esi,%edi
add    %eax,%edi
cvtsi2ss %edi,%xmm0
mulss  0xee6(%rip),%xmm0
ret

LLVM IR (-O0):
define float @convertTemperature(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 0, i32* %5
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = and i32 %7, 128
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 65536
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %2
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = load i32, i32* %5
%18 = add nsw i32 %17, %16
store i32 %18, i32* %5
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = load i32, i32* %5
%22 = add nsw i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = sitofp i32 %23 to float
%25 = fpext float %24 to double
%26 = fmul double %25, 6.250000e-02
%27 = fptrunc double %26 to float
ret float %27
}

LLVM IR (-O2):
define float @convertTemperature(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 -65536
%7 = shl nsw i32 %3, 8
%8 = sext i8 %1 to i32
%9 = add nsw i32 %7, %8
%10 = add nsw i32 %9, %6
%11 = sitofp i32 %10 to float
%12 = fmul float %11, 6.250000e-02
ret float %12
}
int test_imm_4Bint8_reg(signed char val) {
  return ((val) & (-0x4B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Bint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffb5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_4Bint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -75
%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_4Bint8_reg(i8 signext %0) {
%2 = and i8 %0, -75
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct msgb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ talloc_free(struct msgb *);
void msgb_free(struct msgb *m) { talloc_free(m); }


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

x86 assembly (clang, -O2):
<msgb_free>:
jmp    1030 <talloc_free@plt>

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

LLVM IR (-O2):
%struct.msgb = type { i32 }
define void @msgb_free(%struct.msgb* %0) {
%2 = tail call i32 @talloc_free(%struct.msgb* %0)
ret void
}
int qsort_cmp__int(const void *x, const void *y) {
  if (*((int *)x) > *((int *)y))
    return (-1);
  else
    return (*((int *)x) < *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp__int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <qsort_cmp__int+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp__int+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp__int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp__int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
scalar_t__ malloc(int);
int blowheap_crash() {
  int i;
  int *a = (int *)malloc(sizeof(int));
  for (i = 0;; i++) {
    a[i] = i;
  }
}


x86 assembly (clang, -O0):
<blowheap_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <blowheap_crash+0x1d>

x86 assembly (clang, -O2):
<blowheap_crash>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
xor    %ecx,%ecx
nopl   (%rax)
mov    %ecx,(%rax,%rcx,4)
add    $0x1,%rcx
jmp    1120 <blowheap_crash+0x10>

LLVM IR (-O0):
define i32 @blowheap_crash() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
store i32 0, i32* %1
br label %5
5: ; preds = %11, %0
%6 = load i32, i32* %1
%7 = load i32*, i32** %2
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
store i32 %6, i32* %10
br label %11
11: ; preds = %5
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %5
}

LLVM IR (-O2):
define i32 @blowheap_crash() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ %7, %3 ], [ 0, %0 ]
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = trunc i64 %4 to i32
store i32 %6, i32* %5
%7 = add nuw i64 %4, 1
br label %3
}
void yydestruct(const char *yymsg, int yytype, unsigned long int *yyvaluep) {
  ((void)(yyvaluep));
  if (!yymsg)
    yymsg = "Deleting";
  ;
  switch (yytype) {
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<yydestruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1125 <yydestruct+0x25>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <yydestruct+0x2a>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"Deleting\00"
define void @yydestruct(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %3
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %4
br label %11
11: ; preds = %10, %3
%12 = load i32, i32* %5
switch i32 %12, label %13 [
]
13: ; preds = %11
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @yydestruct(i8* nocapture %0, i32 %1, i64* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_short;
struct sockaddr_s {
  int dummy;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int WINS_SetSocketPort(struct sockaddr_s *addr, int port) {
  ((struct sockaddr_in *)addr)->sin_port = htons((u_short)port);
  return 0;
}


x86 assembly (clang, -O0):
<WINS_SetSocketPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WINS_SetSocketPort>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_s = type { i32 }
%struct.sockaddr_in = type { i32 }
define i32 @WINS_SetSocketPort(%struct.sockaddr_s* %0, i32 %1) {
%3 = alloca %struct.sockaddr_s*
%4 = alloca i32
store %struct.sockaddr_s* %0, %struct.sockaddr_s** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htons(i32 %5)
%7 = load %struct.sockaddr_s*, %struct.sockaddr_s** %3
%8 = bitcast %struct.sockaddr_s* %7 to %struct.sockaddr_in*
%9 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i32 %6, i32* %9
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_s = type { i32 }
define i32 @WINS_SetSocketPort(%struct.sockaddr_s* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htons(i32 %1)
%4 = getelementptr %struct.sockaddr_s, %struct.sockaddr_s* %0, i64 0, i32 0
store i32 %3, i32* %4
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *basename(const char *path) {
  const char *ptr = strrchr(path, '/');
  return ptr ? ptr + 1 : path;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int main(int argc, char *argv[]) {
  int M[4][5];
  for (int i = 1; i <= 4; i++)
    for (int j = 1; j <= 5; j++)
      M[i - 1][j - 1] = (i / j) * (j / i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x64(%rbp)
cmpl   $0x4,-0x64(%rbp)
jg     118c <main+0x8c>
movl   $0x1,-0x68(%rbp)
cmpl   $0x5,-0x68(%rbp)
jg     1179 <main+0x79>
mov    -0x64(%rbp),%eax
cltd
idivl  -0x68(%rbp)
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%eax
cltd
idivl  -0x64(%rbp)
mov    -0x6c(%rbp),%edx
imul   %eax,%edx
mov    -0x64(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x60(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    -0x68(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    112a <main+0x2a>
jmp    117e <main+0x7e>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
char *getBuild() { return "GAYFGT"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"GAYFGT\00"
define i8* @getBuild() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"GAYFGT\00"
define i8* @getBuild() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int rename(char const *, char const *);
int p_rename(const char *old, const char *new_) { return rename(old, new_); }


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

x86 assembly (clang, -O2):
<p_rename>:
jmp    1030 <rename@plt>

LLVM IR (-O0):
define i32 @p_rename(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 @rename(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @p_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
void string_cat_int(struct string_t *string, int val) {
  if (!string)
    return;
}


x86 assembly (clang, -O0):
<string_cat_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111b <string_cat_int+0x1b>
jmp    111b <string_cat_int+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.string_t = type opaque
define void @string_cat_int(%struct.string_t* %0, i32 %1) {
%3 = alloca %struct.string_t*
%4 = alloca i32
store %struct.string_t* %0, %struct.string_t** %3
store i32 %1, i32* %4
%5 = load %struct.string_t*, %struct.string_t** %3
%6 = icmp ne %struct.string_t* %5, null
br i1 %6, label %8, label %7
7: ; preds = %2
br label %8
8: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.string_t = type opaque
define void @string_cat_int(%struct.string_t* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int htonl(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  uint32_t i = htonl(0x12345678);
  printf("%x", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x12345678,%edi
call   1040 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x12345678,%edi
call   1040 <htonl@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @htonl(i32 305419896)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int FNVHash64(unsigned char *, int);
uint64_t FNVHashInt64(uint64_t hashme) {
  unsigned char buf[8];
  int i;
  for (i = 0; i < 8; i++) {
    buf[i] = (unsigned char)(hashme & 0x00000000000000FFULL);
    hashme >>= 8;
  }
  return FNVHash64(buf, 8);
}


x86 assembly (clang, -O0):
<FNVHashInt64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1157 <FNVHashInt64+0x47>
movslq -0x4(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0xc(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1122 <FNVHashInt64+0x12>
lea    -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1030 <FNVHash64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FNVHashInt64>:
push   %rax
mov    %edi,%eax
mov    %al,(%rsp)
mov    %ah,0x1(%rsp)
mov    %edi,%ecx
shr    $0x10,%ecx
mov    %cl,0x2(%rsp)
mov    %edi,%ecx
shr    $0x18,%ecx
mov    %cl,0x3(%rsp)
sar    $0x1f,%eax
movzbl %al,%eax
imul   $0x1010101,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <FNVHash64@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @FNVHashInt64(i32 %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %0, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 2
store i8 %9, i8* %10
%11 = lshr i32 %0, 24
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 3
store i8 %12, i8* %13
%14 = ashr i32 %0, 31
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 4
%17 = call i32 @FNVHash64(i8* %3, i32 8)
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ n;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, unsigned int *, int);
unsigned int get_dev_urandom() {
  int fd;
  unsigned int n = 0;
  fd = open("/dev/urandom", O_RDONLY);
  if (fd > 0) {
    read(fd, &n, sizeof(n));
  }
  close(fd);
  return n;
}


x86 assembly (clang, -O0):
<get_dev_urandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1172 <get_dev_urandom+0x42>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dev_urandom>:
push   %rbp
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    116d <get_dev_urandom+0x3d>
lea    0x4(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1040 <read@plt>
mov    0x4(%rsp),%ebp
jmp    116f <get_dev_urandom+0x3f>
xor    %ebp,%ebp
mov    %ebx,%edi
call   1030 <close@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @get_dev_urandom() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i32 @read(i32 %8, i32* %2, i32 4)
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* %1
%12 = call i32 @close(i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@O_RDONLY = global i32 0
define i32 @get_dev_urandom() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @read(i32 %4, i32* %1, i32 4)
%8 = load i32, i32* %1
br label %9
9: ; preds = %6, %0
%10 = phi i32 [ %8, %6 ], [ 0, %0 ]
%11 = tail call i32 @close(i32 %4)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int getInfo(char *buf, int bufLen) {
  static const char *INFO = "info { name=Position }";
  int reqLen = strlen(INFO) + 1;
  if (buf != 0 && reqLen <= bufLen) {
    memcpy(buf, INFO, reqLen);
  }
  return reqLen;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2efa(%rip),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <getInfo+0x4b>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116b <getInfo+0x4b>
mov    -0x8(%rbp),%rdi
mov    0x2ecd(%rip),%rsi
mov    -0x10(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
test   %rbx,%rbx
je     1154 <getInfo+0x34>
cmp    %r14d,%eax
jge    1154 <getInfo+0x34>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@getInfo.INFO = internal global i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0)
@.str = [23 x i8] c"info { name=Position }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** @getInfo.INFO
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8*, i8** @getInfo.INFO
%18 = load i32, i32* %5
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %11, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@.str = [23 x i8] c"info { name=Position }\00"
define i32 @getInfo(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 1
%5 = icmp ne i8* %0, null
%6 = icmp slt i32 %3, %1
%7 = select i1 %5, i1 %6, i1 false
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %8, %2
ret i32 %4
}
/* Type definitions */
struct packet {
  int dummy;
};

/* Variables and functions */
struct packet *packet_encapsulate(struct packet *, struct packet *);
int /*<<< orphan*/ packet_free(struct packet *);
struct packet *packet_encapsulate_and_free(struct packet *outer,
                                           struct packet *inner) {
  struct packet *packet = packet_encapsulate(outer, inner);
  packet_free(outer);
  packet_free(inner);
  return packet;
}


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

x86 assembly (clang, -O2):
<packet_encapsulate_and_free>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <packet_encapsulate@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <packet_free@plt>
mov    %r14,%rdi
call   1030 <packet_free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.packet = type { i32 }
define %struct.packet* @packet_encapsulate_and_free(%struct.packet* %0, %struct.packet* %1) {
%3 = alloca %struct.packet*
%4 = alloca %struct.packet*
%5 = alloca %struct.packet*
store %struct.packet* %0, %struct.packet** %3
store %struct.packet* %1, %struct.packet** %4
%6 = load %struct.packet*, %struct.packet** %3
%7 = load %struct.packet*, %struct.packet** %4
%8 = call %struct.packet* @packet_encapsulate(%struct.packet* %6, %struct.packet* %7)
store %struct.packet* %8, %struct.packet** %5
%9 = load %struct.packet*, %struct.packet** %3
%10 = call i32 @packet_free(%struct.packet* %9)
%11 = load %struct.packet*, %struct.packet** %4
%12 = call i32 @packet_free(%struct.packet* %11)
%13 = load %struct.packet*, %struct.packet** %5
ret %struct.packet* %13
}

LLVM IR (-O2):
%struct.packet = type { i32 }
define %struct.packet* @packet_encapsulate_and_free(%struct.packet* %0, %struct.packet* %1) {
%3 = tail call %struct.packet* @packet_encapsulate(%struct.packet* %0, %struct.packet* %1)
%4 = tail call i32 @packet_free(%struct.packet* %0)
%5 = tail call i32 @packet_free(%struct.packet* %1)
ret %struct.packet* %3
}
void gf2(void) {}


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

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

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

LLVM IR (-O2):
define void @gf2() {
ret void
}
void EC_GROUP_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_dup() {
ret void
}
/* Type definitions */
typedef size_t uint8_t;
typedef int /*<<< orphan*/ const int8_t;

/* Variables and functions */
int8_t access(const int8_t *stack, uint8_t offset) { return stack[offset]; }


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @access(i32* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 %1
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int read_syscall(int, char *, int);
int write_syscall(int, char *, int);
int cat(int in_fd, int out_fd) {
  char buffer[128];
  int result;
  while (1) {
    result = read_syscall(in_fd, buffer, 128);
    if (result <= 0)
      break;
    result = write_syscall(out_fd, buffer, result);
    if (result <= 0)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1040 <read_syscall@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
jg     115d <cat+0x3d>
jmp    118f <cat+0x6f>
mov    -0x8(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    -0x94(%rbp),%edx
call   1030 <write_syscall@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
jg     118a <cat+0x6a>
jmp    118f <cat+0x6f>
jmp    1131 <cat+0x11>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x80,%edx
call   1040 <read_syscall@plt>
test   %eax,%eax
jle    1164 <cat+0x44>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write_syscall@plt>
test   %eax,%eax
jg     1140 <cat+0x20>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cat(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [128 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %2, %22
%8 = load i32, i32* %3
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = call i32 @read_syscall(i32 %8, i8* %9, i32 128)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %7
br label %23
14: ; preds = %7
%15 = load i32, i32* %4
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%17 = load i32, i32* %6
%18 = call i32 @write_syscall(i32 %15, i8* %16, i32 %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = icmp sle i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %14
br label %23
22: ; preds = %14
br label %7
23: ; preds = %21, %13
ret i32 0
}

LLVM IR (-O2):
define i32 @cat(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %8, %2
%6 = call i32 @read_syscall(i32 %0, i8* %4, i32 128)
%7 = icmp slt i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = call i32 @write_syscall(i32 %1, i8* %4, i32 %6)
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %5
11: ; preds = %8, %5
ret i32 0
}
adrx0adrreg1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (((short *)10000000)[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<adrx0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x87a22(%rax),%dx
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0adrreg1_set>:
movzwl 0x87a22(%r9),%eax
movslq %edx,%rcx
mov    %ax,0x989680(%rcx,%rcx,1)
ret

LLVM IR (-O0):
define i32 @adrx0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = getelementptr inbounds i16, i16* %16, i64 277777
%18 = load i16, i16* %17
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %20
store i16 %18, i16* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adrx0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %5, i64 277777
%8 = load i16, i16* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %9
store i16 %8, i16* %10
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ vfb_putchar(char const);
void vfb_putstr(const char *str, const int size) {
  int ite;
  for (ite = 0; ite < size; ++ite)
    vfb_putchar(str[ite]);
}


x86 assembly (clang, -O0):
<vfb_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <vfb_putstr+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <vfb_putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <vfb_putstr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfb_putstr>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <vfb_putstr+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <vfb_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <vfb_putstr+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @vfb_putstr(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @vfb_putchar(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
float square(float x) { return (x + x + x + x); }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
addss  %xmm0,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @square(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fadd float %3, %4
%6 = load float, float* %2
%7 = fadd float %5, %6
%8 = load float, float* %2
%9 = fadd float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @square(float %0) {
%2 = fadd float %0, %0
%3 = fadd float %2, %0
%4 = fadd float %3, %0
ret float %4
}
/* Type definitions */
struct value_vstack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vstack_push_vector(struct value_vstack *, float *, int);
void vstack_push_scalar(struct value_vstack *s, float x) {
  vstack_push_vector(s, &x, 1);
}


x86 assembly (clang, -O0):
<vstack_push_scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <vstack_push_vector@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vstack_push_scalar>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <vstack_push_vector@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.value_vstack = type { i32 }
define void @vstack_push_scalar(%struct.value_vstack* %0, float %1) {
%3 = alloca %struct.value_vstack*
%4 = alloca float
store %struct.value_vstack* %0, %struct.value_vstack** %3
store float %1, float* %4
%5 = load %struct.value_vstack*, %struct.value_vstack** %3
%6 = call i32 @vstack_push_vector(%struct.value_vstack* %5, float* %4, i32 1)
ret void
}

LLVM IR (-O2):
%struct.value_vstack = type { i32 }
define void @vstack_push_scalar(%struct.value_vstack* %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = call i32 @vstack_push_vector(%struct.value_vstack* %0, float* %3, i32 1)
ret void
}