xunge/DecIR huggingface dataset:
C(int n, char *N) {
  while (n > 1) {
    if (n % 2)
      n = (n * 3 + 1) / 2;
    else
      n /= 2;
    if (n < 1001)
      N[n] = 1;
  }
}


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116c <C+0x6c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1140 <C+0x40>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    114e <C+0x4e>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x3e9,-0x8(%rbp)
jge    1167 <C+0x67>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
jmp    110b <C+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
cmp    $0x2,%edi
jge    1115 <C+0x15>
ret
cs nopw 0x0(%rax,%rax,1)
cmp    $0x3,%eax
jle    1105 <C+0x5>
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%eax
cmove  %edi,%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
cmp    $0x7d1,%eax
jg     1110 <C+0x10>
movslq %edi,%rcx
movb   $0x1,(%rsi,%rcx,1)
jmp    1110 <C+0x10>

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

LLVM IR (-O2):
define i32 @C(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %18
4: ; preds = %2, %16
%5 = phi i32 [ %11, %16 ], [ %0, %2 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = mul nsw i32 %5, 3
%9 = add nsw i32 %8, 1
%10 = select i1 %7, i32 %5, i32 %9
%11 = sdiv i32 %10, 2
%12 = icmp slt i32 %10, 2002
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = sext i32 %11 to i64
%15 = getelementptr inbounds i8, i8* %1, i64 %14
store i8 1, i8* %15
br label %16
16: ; preds = %13, %4
%17 = icmp sgt i32 %10, 3
br i1 %17, label %4, label %18
18: ; preds = %16, %2
ret i32 undef
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCGIFNETMASK;
int wapi_get_addr(int, char const *, int /*<<< orphan*/, struct in_addr *);
int wapi_get_netmask(int sock, const char *ifname, struct in_addr *addr) {
  return wapi_get_addr(sock, ifname, SIOCGIFNETMASK, addr);
}


x86 assembly (clang, -O0):
<wapi_get_netmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
call   1030 <wapi_get_addr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wapi_get_netmask>:
mov    %rdx,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edx
jmp    1030 <wapi_get_addr@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@SIOCGIFNETMASK = global i32 0
define i32 @wapi_get_netmask(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.in_addr*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.in_addr* %2, %struct.in_addr** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* @SIOCGIFNETMASK
%10 = load %struct.in_addr*, %struct.in_addr** %6
%11 = call i32 @wapi_get_addr(i32 %7, i8* %8, i32 %9, %struct.in_addr* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@SIOCGIFNETMASK = global i32 0
define i32 @wapi_get_netmask(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = load i32, i32* @SIOCGIFNETMASK
%5 = tail call i32 @wapi_get_addr(i32 %0, i8* %1, i32 %4, %struct.in_addr* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GPSVelocitySensorHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void GPSVelocitySensorUpdated() { UAVObjUpdated(GPSVelocitySensorHandle()); }


x86 assembly (clang, -O0):
<GPSVelocitySensorUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GPSVelocitySensorHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSVelocitySensorUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <GPSVelocitySensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @GPSVelocitySensorUpdated() {
%1 = call i32 (...) @GPSVelocitySensorHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSVelocitySensorUpdated() {
%1 = tail call i32 (...) @GPSVelocitySensorHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
double log(double);
float ftom(float f) {
  return (f > 0 ? 17.3123405046 * log(.12231220585 * f) : -1500);
}


x86 assembly (clang, -O0):
<ftom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1161 <ftom+0x51>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed1(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1173 <ftom+0x63>
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1173 <ftom+0x63>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftom>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1138 <ftom+0x28>
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
call   1030 <log@plt>
mulsd  0xede(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret
movss  0xec0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ftom(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double 0x3FBF4FDA4C0701B6, %7
%9 = call double @log(double %8)
%10 = fmul double 0x40314FF58C1C7920, %9
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi double [ %10, %5 ], [ -1.500000e+03, %11 ]
%14 = fptrunc double %13 to float
ret float %14
}

LLVM IR (-O2):
define float @ftom(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fpext float %0 to double
%5 = fmul double %4, 0x3FBF4FDA4C0701B6
%6 = tail call double @log(double %5)
%7 = fmul double %6, 0x40314FF58C1C7920
%8 = fptrunc double %7 to float
br label %9
9: ; preds = %1, %3
%10 = phi float [ %8, %3 ], [ -1.500000e+03, %1 ]
ret float %10
}
/* Variables and functions */
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
int is_id_char(char c) { return isalpha(c) || isdigit(c) || c == '_'; }


x86 assembly (clang, -O0):
<is_id_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1171 <is_id_char+0x51>
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1171 <is_id_char+0x51>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_id_char>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <isalpha@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    114b <is_id_char+0x2b>
movsbl %bpl,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    114b <is_id_char+0x2b>
xor    %ebx,%ebx
cmp    $0x5f,%bpl
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_id_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @isdigit(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 95
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_id_char(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i64 @isdigit(i8 signext %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp eq i8 %0, 95
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %4, %1
%11 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memcpy(void **, void *, int);
void memalign_free(void *ptr) {
  void *unalignptr;
  if (!ptr) {
    return;
  }
  ptr = (char *)ptr - (((sizeof(void *)) + 8 - 1) / 8 * 8);
  memcpy(&unalignptr, ptr, sizeof(void *));
  free(unalignptr);
}


x86 assembly (clang, -O0):
<memalign_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <memalign_free+0x1c>
jmp    1163 <memalign_free+0x43>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memalign_free>:
test   %rdi,%rdi
je     1147 <memalign_free+0x27>
push   %rax
mov    %rdi,%rsi
add    $0xfffffffffffffff8,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @memalign_free(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 -8
%7 = call i32 @memcpy(i8** %2, i8* %6, i32 8)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %1, %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void put_mac(FILE *f, char *buf, int len) {
  buf[len] = 0x0d;
  fwrite(buf, len + 1, 1, f);
}


x86 assembly (clang, -O0):
<put_mac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0xd,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_mac>:
mov    %rsi,%rax
mov    %rdi,%rcx
movslq %edx,%rsi
movb   $0xd,(%rax,%rsi,1)
add    $0x1,%esi
mov    %rax,%rdi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define void @put_mac(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8 13, i8* %10
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = load i32*, i32** %4
%15 = call i32 @fwrite(i8* %11, i32 %13, i32 1, i32* %14)
ret void
}

LLVM IR (-O2):
define void @put_mac(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 13, i8* %5
%6 = add nsw i32 %2, 1
%7 = tail call i32 @fwrite(i8* %1, i32 %6, i32 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ version();
void help(void) {
  version();
  printf("Usage: %s [OPTIONS] file\n\n", "cant");
  printf("OPTIONS:\n");
  printf(" -h\tShow this help\n");
  printf(" -v\tShow version info\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <version@plt>
lea    0xece(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
xor    %eax,%eax
call   1050 <version@plt>
lea    0xec1(%rip),%rdi
lea    0xed5(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s [OPTIONS] file\0A\0A\00"
@.str.1 = [5 x i8] c"cant\00"
@.str.2 = [10 x i8] c"OPTIONS:\0A\00"
@.str.3 = [20 x i8] c" -h\09Show this help\0A\00"
@.str.4 = [23 x i8] c" -v\09Show version info\0A\00"
define void @help() {
%1 = call i32 (...) @version()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s [OPTIONS] file\0A\0A\00"
@.str.1 = [5 x i8] c"cant\00"
@str = [9 x i8] c"OPTIONS:\00"
@str.5 = [19 x i8] c" -h\09Show this help\00"
@str.6 = [22 x i8] c" -v\09Show version info\00"
define void @help() {
%1 = tail call i32 (...) @version()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char is_hint;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
void set_XPointerMovedEvent_is_hint(void *_p, char _v) {
  ((XPointerMovedEvent *)_p)->is_hint = (char)_v;
}


x86 assembly (clang, -O0):
<set_XPointerMovedEvent_is_hint>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XPointerMovedEvent_is_hint>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8 }
define void @set_XPointerMovedEvent_is_hint(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i8 %5, i8* %8
ret void
}

LLVM IR (-O2):
define void @set_XPointerMovedEvent_is_hint(i8* nocapture writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
ret void
}
int DoAThing() { return 42; }


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

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

LLVM IR (-O0):
define i32 @DoAThing() {
ret i32 42
}

LLVM IR (-O2):
define i32 @DoAThing() {
ret i32 42
}
/* Type definitions */
struct can_frame {
  int can_id;
  int can_dlc;
  int *data;
};
typedef int canid_t;

/* Variables and functions */
int can_send_frame(int, struct can_frame *);
int can_send_write_flash(int fd, canid_t addr) {
  struct can_frame msg;
  msg.can_id = addr | 1 << 31;
  msg.can_dlc = 8;
  msg.data[0] = 0x05;
  return can_send_frame(fd, &msg);
}


x86 assembly (clang, -O0):
<can_send_write_flash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x18(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <can_send_frame@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
%struct.can_frame = type { i32, i32, i32* }
define i32 @can_send_write_flash(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.can_frame
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = or i32 %6, -2147483648
%8 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 1
store i32 8, i32* %9
%10 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %5, i32 0, i32 2
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 5, i32* %12
%13 = load i32, i32* %3
%14 = call i32 @can_send_frame(i32 %13, %struct.can_frame* %5)
ret i32 %14
}

LLVM IR (-O2):
int _gp_timTrp(dummy)
int dummy;
{ return (time(0)); }


x86 assembly (clang, -O0):
<_gp_timTrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <time@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gp_timTrp>:
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @_gp_timTrp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
ret i32 %3
}

LLVM IR (-O2):
define i32 @_gp_timTrp(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @time to i32 (i32, ...)*)(i32 0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int GetAnswer();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  uint32_t answer;
  answer = GetAnswer();
  printf("%d\n", answer);
  return answer;
}


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    $0x0,%al
call   1030 <GetAnswer@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <GetAnswer@plt>
mov    %eax,%ebx
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\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 (...) @GetAnswer()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @GetAnswer()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void endian(char *cind) {
  char ch[4];
  int *ich;
  ich = (int *)&ch[0];
  *ich = 0x00000000;
  ch[3] = 0x02;
  strcpy(cind, "f4");
  if (*ich == 2)
    strcpy(cind, "t4");
}


x86 assembly (clang, -O0):
<endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movb   $0x2,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x2,(%rax)
jne    115f <endian+0x4f>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"f4\00"
define void @endian(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int towide_dbcs(int /*<<< orphan*/ *, char const *, unsigned int);
int towide_big5(wchar_t *wc, const char *mb, unsigned n) {
  return (towide_dbcs(wc, mb, n));
}


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

x86 assembly (clang, -O2):
<towide_big5>:
jmp    1030 <towide_dbcs@plt>

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

LLVM IR (-O2):
define i32 @towide_big5(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @towide_dbcs(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
int k_strcpy(char *dest, const char *src) {
  int index = 0;
  while (src[index] != '\0') {
    dest[index] = src[index];
    index++;
  }
  dest[index++] = '\0';
  return index;
}


x86 assembly (clang, -O0):
<k_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <k_strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <k_strcpy+0x13>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_strcpy>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <k_strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rdi,%rax,1)
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <k_strcpy+0x10>
mov    %eax,%ecx
add    $0x1,%eax
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i32 @k_strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %9 to i32
br label %15
15: ; preds = %13, %2
%16 = phi i32 [ 0, %2 ], [ %14, %13 ]
%17 = zext i32 %16 to i64
%18 = add nuw nsw i32 %16, 1
%19 = getelementptr inbounds i8, i8* %0, i64 %17
store i8 0, i8* %19
ret i32 %18
}
void free_dmatrix(double **m, long nrl, long nrh, long ncl, long nch) {
  free((m[nrl] + ncl - 1));
  free((m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dmatrix(double** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca double**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store double** %0, double*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load double**, double*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds double*, double** %11, i64 %12
%14 = load double*, double** %13
%15 = load i64, i64* %9
%16 = getelementptr inbounds double, double* %14, i64 %15
%17 = getelementptr inbounds double, double* %16, i64 -1
%18 = bitcast double* %17 to i8*
%19 = load double**, double*** %6
%20 = load i64, i64* %7
%21 = getelementptr inbounds double*, double** %19, i64 %20
%22 = getelementptr inbounds double*, double** %21, i64 -1
%23 = bitcast double** %22 to i8*
ret void
}

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 %3
%9 = getelementptr inbounds double, double* %8, i64 -1
%10 = bitcast double* %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds double*, double** %6, i64 -1
%12 = bitcast double** %11 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
scalar_t__ __ceil(double);
long double __ceill(long double x) { return ((long double)__ceil((double)x)); }


x86 assembly (clang, -O0):
<__ceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <__ceil@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ceill>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <__ceil@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__ceill(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @__ceil(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @__ceill(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @__ceil(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
scalar_t__ smbw_getcwd(char *, size_t);
char *getcwd(char *buf, size_t size) { return (char *)smbw_getcwd(buf, size); }


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

x86 assembly (clang, -O2):
<getcwd>:
jmp    1030 <smbw_getcwd@plt>

LLVM IR (-O0):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @smbw_getcwd(i8* %5, i64 %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = tail call i64 @smbw_getcwd(i8* %0, i64 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
unsigned int vied_bitpos_to_bytepos(unsigned int bitpos) {
  return (bitpos + 7) / 8;
}


x86 assembly (clang, -O0):
<vied_bitpos_to_bytepos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
shr    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vied_bitpos_to_bytepos>:
lea    0x7(%rdi),%eax
shr    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @vied_bitpos_to_bytepos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 7
%5 = udiv i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @vied_bitpos_to_bytepos(i32 %0) {
%2 = add i32 %0, 7
%3 = lshr i32 %2, 3
ret i32 %3
}
int plt_sockCleanup() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @plt_sockCleanup() {
ret i32 0
}
OP(dd, e7) { op_e7(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_e7@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_e7()
ret i32 undef
}
unsigned long get_svp_cma_basepfn(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_svp_cma_basepfn() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_svp_cma_basepfn() {
ret i64 0
}
int totalNQueens(int n) {
  int ret[] = {0, 1, 0, 0, 2, 10, 4, 40, 92, 352, 724, 2680, 14200, 73712};
  if (n <= 13)
    return ret[n];
  return -1;
}


x86 assembly (clang, -O0):
<totalNQueens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x38,%edx
call   1030 <memcpy@plt>
cmpl   $0xd,-0x8(%rbp)
jg     114a <totalNQueens+0x3a>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <totalNQueens+0x41>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<totalNQueens>:
mov    $0xffffffff,%eax
cmp    $0xd,%edi
jg     1117 <totalNQueens+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.totalNQueens.ret = [14 x i32] [i32 0, i32 1, i32 0, i32 0, i32 2, i32 10, i32 4, i32 40, i32 92, i32 352, i32 724, i32 2680, i32 14200, i32 73712]
define i32 @totalNQueens(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [14 x i32]
store i32 %0, i32* %3
%5 = bitcast [14 x i32]* %4 to i8*
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 13
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [14 x i32], [14 x i32]* %4, i64 0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@__const.totalNQueens.ret = [14 x i32] [i32 0, i32 1, i32 0, i32 0, i32 2, i32 10, i32 4, i32 40, i32 92, i32 352, i32 724, i32 2680, i32 14200, i32 73712]
define i32 @totalNQueens(i32 %0) {
%2 = icmp slt i32 %0, 14
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [14 x i32], [14 x i32]* @__const.totalNQueens.ret, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int checkRow(char *, char);
char checkField(char *playground) {
  int won = 0;
  won = checkRow(playground, 'o');
  if (won > 0)
    return 'o';
  won = checkRow(playground, 'x');
  if (won > 0)
    return 'x';
  return 0;
}


x86 assembly (clang, -O0):
<checkField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x6f,%esi
call   1030 <checkRow@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1147 <checkField+0x37>
movb   $0x6f,-0x1(%rbp)
jmp    116f <checkField+0x5f>
mov    -0x10(%rbp),%rdi
mov    $0x78,%esi
call   1030 <checkRow@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    116b <checkField+0x5b>
movb   $0x78,-0x1(%rbp)
jmp    116f <checkField+0x5f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkField>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x6f,%esi
call   1030 <checkRow@plt>
mov    %eax,%ecx
mov    $0x6f,%al
test   %ecx,%ecx
jg     1143 <checkField+0x33>
mov    $0x78,%ebp
mov    %rbx,%rdi
mov    $0x78,%esi
call   1030 <checkRow@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @checkField(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @checkRow(i8* %5, i8 signext 111)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i8 111, i8* %2
br label %17
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @checkRow(i8* %11, i8 signext 120)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i8 120, i8* %2
br label %17
16: ; preds = %10
store i8 0, i8* %2
br label %17
17: ; preds = %16, %15, %9
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @checkField(i8* %0) {
%2 = tail call i32 @checkRow(i8* %0, i8 signext 111)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @checkRow(i8* %0, i8 signext 120)
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, i8 120, i8 0
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 111, %1 ], [ %7, %4 ]
ret i8 %9
}
/* Variables and functions */
int parse_int_file(int /*<<< orphan*/, char *, int);
int get_physical_die_id(int cpu) {
  int ret;
  ret = parse_int_file(0, "/sys/devices/system/cpu/cpu%d/topology/die_id", cpu);
  if (ret < 0)
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<get_physical_die_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %edi,%edi
lea    0xed9(%rip),%rsi
call   1030 <parse_int_file@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1140 <get_physical_die_id+0x30>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_physical_die_id>:
push   %rbx
mov    %edi,%edx
lea    0xee6(%rip),%rsi
xor    %ebx,%ebx
xor    %edi,%edi
call   1030 <parse_int_file@plt>
test   %eax,%eax
cmovs  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"/sys/devices/system/cpu/cpu%d/topology/die_id\00"
define i32 @get_physical_die_id(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @parse_int_file(i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [46 x i8] c"/sys/devices/system/cpu/cpu%d/topology/die_id\00"
define i32 @get_physical_die_id(i32 %0) {
%2 = tail call i32 @parse_int_file(i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
ret i32 %4
}
int unlinkat(int dirfd, const char *pathname, int flags) {
  check_wl(pathname, "remove");
  int (*real_unlink_with_mode)(int, const char *, int);
  real_unlink_with_mode = dlsym(((void *)(-1l)), "unlinkat");
  return (*real_unlink_with_mode)(dirfd, pathname, flags);
}


x86 assembly (clang, -O0):
<unlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1040 <check_wl@plt>
mov    $0xffffffffffffffff,%rdi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <dlsym@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlinkat>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <check_wl@plt>
lea    0xec3(%rip),%rsi
mov    $0xffffffffffffffff,%rdi
xor    %eax,%eax
call   1030 <dlsym@plt>
cltq
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    *%rax

LLVM IR (-O0):
@.str = [7 x i8] c"remove\00"
@.str.1 = [9 x i8] c"unlinkat\00"
define i32 @unlinkat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32 (i32, i8*, i32)*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @check_wl to i32 (i8*, i8*, ...)*)(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dlsym to i32 (i8*, i8*, ...)*)(i8* inttoptr (i64 -1 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32 (i32, i8*, i32)*
store i32 (i32, i8*, i32)* %12, i32 (i32, i8*, i32)** %7
%13 = load i32 (i32, i8*, i32)*, i32 (i32, i8*, i32)** %7
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 %13(i32 %14, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"remove\00"
@.str.1 = [9 x i8] c"unlinkat\00"
define i32 @unlinkat(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @check_wl to i32 (i8*, i8*, ...)*)(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @dlsym to i32 (i8*, i8*, ...)*)(i8* inttoptr (i64 -1 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32 (i32, i8*, i32)*
%8 = tail call i32 %7(i32 %0, i8* %1, i32 %2)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int print_error(int errcode) {
  printf("Error: %d\n", errcode);
  return errcode;
}


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

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %d\0A\00"
define i32 @print_error(i32 returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void HelloFunc() { printf("Hello World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @HelloFunc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @HelloFunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sesc_simulation_mark();
void sesc_simulation_mark_() { sesc_simulation_mark(); }


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

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

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

LLVM IR (-O2):
define void @sesc_simulation_mark_() {
%1 = tail call i32 (...) @sesc_simulation_mark()
ret void
}
double extrapolate(double x, double x0, double x1, double y0, double y1,
                   double u0, double u1) {
  double c;
  c = (y1 - y0) / (x1 - x0) * (x1 - x0) * (2.0 * u0 + u1) / 6.0;
  return y0 + x * (x - x0);
}


x86 assembly (clang, -O0):
<extrapolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
addsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<extrapolate>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @extrapolate(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%16 = load double, double* %12
%17 = load double, double* %11
%18 = fsub double %16, %17
%19 = load double, double* %10
%20 = load double, double* %9
%21 = fsub double %19, %20
%22 = fdiv double %18, %21
%23 = load double, double* %10
%24 = load double, double* %9
%25 = fsub double %23, %24
%26 = fmul double %22, %25
%27 = load double, double* %13
%28 = load double, double* %14
%29 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %27, double %28)
%30 = fmul double %26, %29
%31 = fdiv double %30, 6.000000e+00
store double %31, double* %15
%32 = load double, double* %11
%33 = load double, double* %8
%34 = load double, double* %8
%35 = load double, double* %9
%36 = fsub double %34, %35
%37 = call double @llvm.fmuladd.f64(double %33, double %36, double %32)
ret double %37
}

LLVM IR (-O2):
define double @extrapolate(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fsub double %0, %1
%9 = tail call double @llvm.fmuladd.f64(double %0, double %8, double %3)
ret double %9
}
/* Type definitions */
struct dvb_frontend {
  int dummy;
};

/* Variables and functions */
int tda18271_toggle_output(struct dvb_frontend *, int);
int tda18271_sleep(struct dvb_frontend *fe) {
  int ret;
  ret = tda18271_toggle_output(fe, 1);
  return ret;
}


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

x86 assembly (clang, -O2):
<tda18271_sleep>:
mov    $0x1,%esi
jmp    1030 <tda18271_toggle_output@plt>

LLVM IR (-O0):
%struct.dvb_frontend = type { i32 }
define i32 @tda18271_sleep(%struct.dvb_frontend* %0) {
%2 = alloca %struct.dvb_frontend*
%3 = alloca i32
store %struct.dvb_frontend* %0, %struct.dvb_frontend** %2
%4 = load %struct.dvb_frontend*, %struct.dvb_frontend** %2
%5 = call i32 @tda18271_toggle_output(%struct.dvb_frontend* %4, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.dvb_frontend = type { i32 }
define i32 @tda18271_sleep(%struct.dvb_frontend* %0) {
%2 = tail call i32 @tda18271_toggle_output(%struct.dvb_frontend* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void functionA() { printf("\nEstou na Funcao A\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"\0AEstou na Funcao A\0A\00"
define void @functionA() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"\0AEstou na Funcao A\00"
define void @functionA() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}