xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ permutation(int *, int /*<<< orphan*/, int);
int main(void) {
  int list[] = {1, 2, 3};
  int len = 3;
  permutation(list, 0, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x4(%rbp)
movl   $0x3,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1030 <permutation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <permutation@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.list = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = bitcast [3 x i32]* %1 to i8*
store i32 3, i32* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @permutation(i32* %4, i32 0, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.list = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @permutation(i32* %3, i32 0, i32 3)
ret i32 0
}
int udp_init(short port) {}


x86 assembly (clang, -O0):
<udp_init>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @udp_init(i16 signext %0) {
ret i32 undef
}
int XpmLibraryVersion() { return 30401; }


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

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

LLVM IR (-O0):
define i32 @XpmLibraryVersion() {
ret i32 30401
}

LLVM IR (-O2):
define i32 @XpmLibraryVersion() {
ret i32 30401
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double e_time(void) {
  static struct timeval now;
  gettimeofday(&now, NULL);
  return (double)(now.tv_sec + now.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<e_time>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f15(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x2f0b(%rip),%xmm0
movsd  0x2efb(%rip),%xmm1
movsd  0xec3(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_time>:
push   %rax
lea    0x2f18(%rip),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x2f10(%rip),%xmm1
movsd  0x2f00(%rip),%xmm0
divsd  0xec8(%rip),%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
@e_time.now = internal global %struct.timeval zeroinitializer
define double @e_time() {
%1 = call i32 @gettimeofday(%struct.timeval* @e_time.now, i32* null)
%2 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @e_time.now, i32 0, i32 1)
%3 = sitofp i64 %2 to double
%4 = load double, double* getelementptr inbounds (%struct.timeval, %struct.timeval* @e_time.now, i32 0, i32 0)
%5 = fdiv double %4, 1.000000e+06
%6 = fadd double %3, %5
ret double %6
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
@e_time.now = internal global %struct.timeval zeroinitializer
define double @e_time() {
%1 = tail call i32 @gettimeofday(%struct.timeval* @e_time.now, i32* null)
%2 = load i64, i64* getelementptr inbounds (%struct.timeval, %struct.timeval* @e_time.now, i64 0, i32 1)
%3 = sitofp i64 %2 to double
%4 = load double, double* getelementptr inbounds (%struct.timeval, %struct.timeval* @e_time.now, i64 0, i32 0)
%5 = fdiv double %4, 1.000000e+06
%6 = fadd double %5, %3
ret double %6
}
/* Variables and functions */
int InPortb(int);
int /*<<< orphan*/ OutPortb(int, int);
int /*<<< orphan*/ OutPortw(int, int);
void UnProtectCRTC(void) {
  int v;
  OutPortb(0x3d4, 0x11);
  v = InPortb(0x3d4 + 1);
  v = v & 0x7F;
  OutPortb(0x3d4, 0x11);
  OutPortw(0x3d4, 0x11 | (v << 8));
}


x86 assembly (clang, -O0):
<UnProtectCRTC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3d4,%edi
mov    $0x11,%esi
call   1040 <OutPortb@plt>
mov    $0x3d5,%edi
call   1050 <InPortb@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0x11,%esi
call   1040 <OutPortb@plt>
mov    -0x4(%rbp),%esi
shl    $0x8,%esi
or     $0x11,%esi
mov    $0x3d4,%edi
call   1030 <OutPortw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnProtectCRTC>:
push   %rbx
mov    $0x3d4,%edi
mov    $0x11,%esi
call   1040 <OutPortb@plt>
mov    $0x3d5,%edi
call   1050 <InPortb@plt>
mov    %eax,%ebx
mov    $0x3d4,%edi
mov    $0x11,%esi
call   1040 <OutPortb@plt>
and    $0x7f,%ebx
shl    $0x8,%ebx
or     $0x11,%ebx
mov    $0x3d4,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <OutPortw@plt>

LLVM IR (-O0):
define void @UnProtectCRTC() {
%1 = alloca i32
%2 = call i32 @OutPortb(i32 980, i32 17)
%3 = call i32 @InPortb(i32 981)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, 127
store i32 %5, i32* %1
%6 = call i32 @OutPortb(i32 980, i32 17)
%7 = load i32, i32* %1
%8 = shl i32 %7, 8
%9 = or i32 17, %8
%10 = call i32 @OutPortw(i32 980, i32 %9)
ret void
}

LLVM IR (-O2):
define void @UnProtectCRTC() {
%1 = tail call i32 @OutPortb(i32 980, i32 17)
%2 = tail call i32 @InPortb(i32 981)
%3 = tail call i32 @OutPortb(i32 980, i32 17)
%4 = shl i32 %2, 8
%5 = and i32 %4, 32512
%6 = or i32 %5, 17
%7 = tail call i32 @OutPortw(i32 980, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_REQ_INFO_it;
void X509_REQ_INFO_free(X509_REQ_INFO *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_INFO_it);
}


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

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

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

LLVM IR (-O2):
@X509_REQ_INFO_it = global i32 0
define void @X509_REQ_INFO_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_REQ_INFO_it)
ret void
}
void subsystem_unregister(struct kset *x) { return; }


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

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

LLVM IR (-O0):
%struct.kset = type opaque
define void @subsystem_unregister(%struct.kset* %0) {
%2 = alloca %struct.kset*
store %struct.kset* %0, %struct.kset** %2
ret void
}

LLVM IR (-O2):
%struct.kset = type opaque
define void @subsystem_unregister(%struct.kset* nocapture %0) {
ret void
}
/* Variables and functions */
bool nrf51_errata_62(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_62() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./sender [IPv6 do servidor] [MAC do servidor] [URL] [path]\n");
  printf("Example: ./sender XXXX::XXXX:XXXX:XXXX:XXXX XX:XX:XX:XX:XX:XX "
         "www.google.com /\n");
}


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

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

LLVM IR (-O0):
@.str = [67 x i8] c"Usage: ./sender [IPv6 do servidor] [MAC do servidor] [URL] [path]\0A\00"
@.str.1 = [80 x i8] c"Example: ./sender XXXX::XXXX:XXXX:XXXX:XXXX XX:XX:XX:XX:XX:XX www.google.com /\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [66 x i8] c"Usage: ./sender [IPv6 do servidor] [MAC do servidor] [URL] [path]\00"
@str.2 = [79 x i8] c"Example: ./sender XXXX::XXXX:XXXX:XXXX:XXXX XX:XX:XX:XX:XX:XX www.google.com /\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.2, i64 0, i64 0))
ret void
}
int my_strlen(char *str) {
  int l;
  l = 0;
  while (str[l] != '\0')
    l++;
  return (l);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <my_strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @md_slurp() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
void *d1_allocmem(unsigned int size) {
  unsigned int *ptr;
  ptr = (unsigned int *)malloc((size_t)size);
  if (!ptr) {
    return NULL;
  }
  return (void *)ptr;
}


x86 assembly (clang, -O0):
<d1_allocmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <d1_allocmem+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1149 <d1_allocmem+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d1_allocmem>:
mov    %edi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define i8* @d1_allocmem(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int right(int i) { return (2 * i + 2); }


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

x86 assembly (clang, -O2):
<right>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @right(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ merge(int, int, int, int *);
void merge_sort(int p, int r, int *arr) {
  if (p < r) {
    int q = (p + r) / 2;
    merge_sort(p, q, arr);
    merge_sort(q + 1, r, arr);
    merge(p, q, r, arr);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1182 <merge_sort+0x62>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <merge_sort@plt>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <merge_sort@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    %esi,%edi
jge    1172 <merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %edi,%r12d
lea    (%r15,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1040 <merge_sort@plt>
lea    0x1(%rbx),%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1040 <merge_sort@plt>
mov    %r12d,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @merge_sort(i32 %0, i32 %1, i32* %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %1, %0
%8 = sdiv i32 %7, 2
tail call void @merge_sort(i32 %0, i32 %8, i32* %2)
%9 = add nsw i32 %8, 1
tail call void @merge_sort(i32 %9, i32 %1, i32* %2)
%10 = tail call i32 @merge(i32 %0, i32 %8, i32 %1, i32* %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void my_close(int *sockfd) {
  close(*sockfd);
  *sockfd = -1;
}


x86 assembly (clang, -O0):
<my_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_close>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
movl   $0xffffffff,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @my_close(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @close(i32 %4)
%6 = load i32*, i32** %2
store i32 -1, i32* %6
ret void
}

LLVM IR (-O2):
define void @my_close(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
store i32 -1, i32* %0
ret void
}
void fixup_endfun(u, l, narg) int *u;
int l, narg;
{
  u[l - 1] = 998;
  u[l] = narg;
  u[l + 1] = 999;
}


x86 assembly (clang, -O0):
<fixup_endfun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x3e6,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x3e7,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup_endfun>:
movslq %esi,%rax
movl   $0x3e6,-0x4(%rdi,%rax,4)
mov    %edx,(%rdi,%rax,4)
movl   $0x3e7,0x4(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @fixup_endfun(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %7, i64 %10
store i32 998, i32* %11
%12 = load i32, i32* %6
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
store i32 999, i32* %21
ret void
}

LLVM IR (-O2):
define void @fixup_endfun(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 998, i32* %6
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %2, i32* %8
%9 = add nsw i32 %1, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 999, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ permute(char *, int /*<<< orphan*/, int);
int strlen(char *);
void main() {
  char s[] = "abcd";
  int len = strlen(s);
  permute(s, 0, len - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
lea    -0x5(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <permute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <permute@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"abcd\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = alloca i32
%3 = bitcast [5 x i8]* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %2
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @permute(i8* %6, i32 0, i32 %8)
ret void
}

LLVM IR (-O2):
@__const.main.s = [5 x i8] c"abcd\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = call i32 @permute(i8* %2, i32 0, i32 %4)
ret void
}
int double_comparison(const void *dp1, const void *dp2) {
  if (*(const double *)dp1 < *(const double *)dp2)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<double_comparison>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <double_comparison+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1139 <double_comparison+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_comparison>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setbe  %al
add    %eax,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @double_comparison(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 double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @double_comparison(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = select i1 %7, i32 -1, i32 1
ret i32 %8
}
void _Unwind_Resume() {}


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

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

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

LLVM IR (-O2):
define void @_Unwind_Resume() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ yyyShowProd(int);
void yyyShowProds() {
  int i;
  for (i = 1; i <= 52; i++)
    yyyShowProd(i);
}


x86 assembly (clang, -O0):
<yyyShowProds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x34,-0x4(%rbp)
jg     113f <yyyShowProds+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <yyyShowProd@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <yyyShowProds+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyyShowProds>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <yyyShowProd@plt>
add    $0x1,%ebx
cmp    $0x35,%ebx
jne    1120 <yyyShowProds+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @yyyShowProds() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 52
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @yyyShowProd(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @yyyShowProds() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @yyyShowProd(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 53
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int parse_direction(const char *direction) {
  if (0 == strncmp(direction, "in", 4))
    return 0;
  else if (0 == strncmp(direction, "out", 4))
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<parse_direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    114b <parse_direction+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1181 <parse_direction+0x71>
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    117a <parse_direction+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <parse_direction+0x71>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_direction>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1148 <parse_direction+0x38>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"in\00"
@.str.1 = [4 x i8] c"out\00"
define i32 @parse_direction(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 1, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
float UI_GetValue(int ownerDraw) { return 0.0f; }


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

x86 assembly (clang, -O2):
<UI_GetValue>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @UI_GetValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @UI_GetValue(i32 %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ acos(double);
int /*<<< orphan*/ acosf(float);
int /*<<< orphan*/ acosl(long double);
void uninitvar_acos(void) {
  float f;
  (void)acosf(f);
  double d;
  (void)acos(d);
  long double ld;
  (void)acosl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <acosf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <acos@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <acosl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_acos>:
sub    $0x18,%rsp
call   1040 <acosf@plt>
call   1050 <acos@plt>
call   1030 <acosl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_acos() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @acosf(float %4)
%6 = load double, double* %2
%7 = call i32 @acos(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @acosl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_acos() {
%1 = tail call i32 @acosf(float undef)
%2 = tail call i32 @acos(double undef)
%3 = tail call i32 @acosl(x86_fp80 undef)
ret void
}
int test_imm_03int64_lowword_mem(long long *val) {
  return ((*val) & (0x03 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_03int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 3
%6 = icmp ne i64 %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_03int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void i2d_ASN1_VISIBLESTRING(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_ASN1_VISIBLESTRING() {
ret void
}
/* Variables and functions */
long double copysign(long double, long double);
long double copysignl(long double x, long double y) { return copysign(x, y); }


x86 assembly (clang, -O0):
<copysignl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <copysign@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignl>:
jmp    1030 <copysign@plt>

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

LLVM IR (-O2):
define x86_fp80 @copysignl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @copysign(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int strlen(char *s) {
  char *curr;
  curr = s;
  while (*curr != '\0') {
    curr++;
  }
  return curr - s;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void tr_print_str(const char *str) { write(1, str, strlen(str)); }


x86 assembly (clang, -O0):
<tr_print_str>:
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   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_print_str>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @tr_print_str(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 i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @tr_print_str(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRC1_set(void) { return U_WMRCORENONE_set("U_WMRC1"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRC1\00"
define i8* @U_WMRC1_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRC1\00"
define i8* @U_WMRC1_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int no_printf(const char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @no_printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t msb(const uint64_t t) {
  uint8_t r = 0;
  uint64_t t_m = t;
  while (t_m >>= 1) {
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1138 <msb+0x38>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1115 <msb+0x15>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msb>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111d <msb+0x1d>
mov    %edi,%ecx
nopl   0x0(%rax)
sar    %ecx
add    $0x1,%rax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <msb+0x10>
ret

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

LLVM IR (-O2):
define i64 @msb(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 0, %1 ]
%6 = ashr i32 %4, 1
%7 = add nuw nsw i64 %5, 1
%8 = icmp ult i32 %4, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %10
}
void gtk_binding_entry_add_signall() {}


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

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

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

LLVM IR (-O2):
define void @gtk_binding_entry_add_signall() {
ret void
}
/* Variables and functions */
char *findJavaTZ_md(void *);
char *SVM_FindJavaTZmd(const char *tzmappings, int length) {
  return findJavaTZ_md((void *)0);
}


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

x86 assembly (clang, -O2):
<SVM_FindJavaTZmd>:
xor    %edi,%edi
jmp    1030 <findJavaTZ_md@plt>

LLVM IR (-O0):
define i8* @SVM_FindJavaTZmd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i8* @findJavaTZ_md(i8* null)
ret i8* %5
}

LLVM IR (-O2):
define i8* @SVM_FindJavaTZmd(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @findJavaTZ_md(i8* null)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ GLvoid;
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glTexImage1D(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/ *);
void TexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width,
                GLint border, GLenum format, GLenum type, GLvoid *pixels) {
  glTexImage1D(target, level, internalFormat, width, border, format, type,
               pixels);
}


x86 assembly (clang, -O0):
<TexImage1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%rax
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <glTexImage1D@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TexImage1D>:
jmp    1030 <glTexImage1D@plt>

LLVM IR (-O0):
define void @TexImage1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32*
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32* %7, i32** %16
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = load i32, i32* %15
%24 = load i32*, i32** %16
%25 = call i32 @glTexImage1D(i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23, i32* %24)
ret void
}

LLVM IR (-O2):
define void @TexImage1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32* %7) {
%9 = tail call i32 @glTexImage1D(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32* %7)
ret void
}
/* Type definitions */
struct libusb20_backend {
  int dummy;
};

/* Variables and functions */
struct libusb20_backend *libusb20_be_alloc_ugen20(void) {
  struct libusb20_backend *pbe;
  pbe = NULL;
  return (pbe);
}


x86 assembly (clang, -O0):
<libusb20_be_alloc_ugen20>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.libusb20_backend = type { i32 }
define %struct.libusb20_backend* @libusb20_be_alloc_ugen20() {
%1 = alloca %struct.libusb20_backend*
store %struct.libusb20_backend* null, %struct.libusb20_backend** %1
%2 = load %struct.libusb20_backend*, %struct.libusb20_backend** %1
ret %struct.libusb20_backend* %2
}

LLVM IR (-O2):
%struct.libusb20_backend = type { i32 }
define noalias %struct.libusb20_backend* @libusb20_be_alloc_ugen20() {
ret %struct.libusb20_backend* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ RIPEMD160_CTX;

/* Variables and functions */
int /*<<< orphan*/ RIPEMD160_Final(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ RIPEMD160_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ RIPEMD160_Update(int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ const *, size_t);
void bbp_rmd160(uint8_t *digest, const uint8_t *message, size_t len) {
  RIPEMD160_CTX ctx;
  RIPEMD160_Init(&ctx);
  RIPEMD160_Update(&ctx, message, len);
  RIPEMD160_Final(digest, &ctx);
}


x86 assembly (clang, -O0):
<bbp_rmd160>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <RIPEMD160_Init@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rdi
call   1040 <RIPEMD160_Update@plt>
mov    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <RIPEMD160_Final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbp_rmd160>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1030 <RIPEMD160_Init@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <RIPEMD160_Update@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <RIPEMD160_Final@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @bbp_rmd160(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%8 = call i32 @RIPEMD160_Init(i32* %7)
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = call i32 @RIPEMD160_Update(i32* %7, i32* %9, i64 %10)
%12 = load i32*, i32** %4
%13 = call i32 @RIPEMD160_Final(i32* %12, i32* %7)
ret void
}

LLVM IR (-O2):
define void @bbp_rmd160(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @RIPEMD160_Init(i32* %4)
%7 = call i32 @RIPEMD160_Update(i32* %4, i32* %1, i64 %2)
%8 = call i32 @RIPEMD160_Final(i32* %0, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(unsigned char);
unsigned char *advanceToNextChunk(unsigned char *ptr) {
  while (!isdigit(*ptr)) {
    ptr += sizeof(char);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<advanceToNextChunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113d <advanceToNextChunk+0x2d>
jmp    114e <advanceToNextChunk+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <advanceToNextChunk+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<advanceToNextChunk>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isdigit@plt>
test   %eax,%eax
je     1120 <advanceToNextChunk+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @advanceToNextChunk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i32 @isdigit(i8 zeroext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %3
12: ; preds = %3
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @advanceToNextChunk(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i32 @isdigit(i8 zeroext %4)
%6 = icmp eq i32 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
ret i8* %3
}
void delay10ms(void) {
  unsigned int a, b = 0;
  for (a = 0; a < 18000; a++)
    b++;
}


x86 assembly (clang, -O0):
<delay10ms>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x4650,-0x4(%rbp)
jae    1136 <delay10ms+0x36>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <delay10ms+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay10ms() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 18000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add i32 %10, 1
store i32 %11, i32* %1
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay10ms() {
ret void
}
int do_106() { return 106; }


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

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

LLVM IR (-O0):
define i32 @do_106() {
ret i32 106
}

LLVM IR (-O2):
define i32 @do_106() {
ret i32 106
}
/* Type definitions */
struct args {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct args *);
void free_args(struct args *arg) { free(arg); }


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

x86 assembly (clang, -O2):
<free_args>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.args = type { i32 }
define void @free_args(%struct.args* nocapture %0) {
%2 = tail call i32 @free(%struct.args* %0)
ret void
}
void sigalrm_sleep(int signo) {}


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

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

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

LLVM IR (-O2):
define void @sigalrm_sleep(i32 %0) {
ret void
}
/* Variables and functions */
int get_smallest_number(int);
int /*<<< orphan*/ printf(char *, int);
main() { printf("solution 5 => %i\n", get_smallest_number(20)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
call   1040 <get_smallest_number@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"solution 5 => %i\0A\00"
define i32 @main() {
%1 = call i32 @get_smallest_number(i32 20)
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"solution 5 => %i\0A\00"
define i32 @main() {
%1 = tail call i32 @get_smallest_number(i32 20)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fz_free(void *);
void zfree(void *opaque, void *ptr) { fz_free(ptr); }


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

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

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

LLVM IR (-O2):
define void @zfree(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @fz_free(i8* %1)
ret void
}