xunge/DecIR huggingface dataset:
/* Variables and functions */
long long __normal___divdi3(long long, long long);
long long __wrap___divdi3(long long a, long long b) {
  return __normal___divdi3(a, b);
}


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

x86 assembly (clang, -O2):
<__wrap___divdi3>:
jmp    1030 <__normal___divdi3@plt>

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

LLVM IR (-O2):
define i64 @__wrap___divdi3(i64 %0, i64 %1) {
%3 = tail call i64 @__normal___divdi3(i64 %0, i64 %1)
ret i64 %3
}
int fun323() { return 323; }


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

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

LLVM IR (-O0):
define i32 @fun323() {
ret i32 323
}

LLVM IR (-O2):
define i32 @fun323() {
ret i32 323
}
double foo012(double a, float b, double c) { return (a * b - c); }


x86 assembly (clang, -O0):
<foo012>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo012>:
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @foo012(double %0, float %1, double %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca double
store double %0, double* %4
store float %1, float* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = load double, double* %6
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %7, double %9, double %11)
ret double %12
}

LLVM IR (-O2):
define double @foo012(double %0, float %1, double %2) {
%4 = fpext float %1 to double
%5 = fneg double %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %5)
ret double %6
}
void ft_striteri(char *s, void (*f)(unsigned int, char *)) {
  unsigned int i;
  i = 0;
  while (s[i] != '\0') {
    (*f)(i, &(s[i]));
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striteri>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <ft_striteri+0x4c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%ecx
add    %rcx,%rsi
call   *%rax
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <ft_striteri+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striteri>:
push   %r15
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     1133 <ft_striteri+0x33>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   *%r14
add    $0x1,%ebx
lea    (%r15,%rbx,1),%rsi
cmpb   $0x0,(%r15,%rbx,1)
jne    1120 <ft_striteri+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ft_striteri(i8* %0, void (i32, i8*)* %1) {
%3 = alloca i8*
%4 = alloca void (i32, i8*)*
%5 = alloca i32
store i8* %0, i8** %3
store void (i32, i8*)* %1, void (i32, i8*)** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %5
%9 = zext 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 %23
14: ; preds = %6
%15 = load void (i32, i8*)*, void (i32, i8*)** %4
%16 = load i32, i32* %5
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i32, i32* %5
%22 = add i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

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


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

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

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

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

/* Variables and functions */
scalar_t__ strcat(char *, char *);
wchar_t *wcscat(wchar_t *s1, const wchar_t *s2) {
  return (wchar_t *)strcat((char *)s1, (char *)s2);
}


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

x86 assembly (clang, -O2):
<wcscat>:
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
define i32* @wcscat(i32* %0, i32* %1) {
%3 = bitcast i32* %0 to i8*
%4 = bitcast i32* %1 to i8*
%5 = tail call i64 @strcat(i8* %3, i8* %4)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int pthread_equal(pthread_t t1, pthread_t t2) {
  if (t1 == t2)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<pthread_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1126 <pthread_equal+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <pthread_equal+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @pthread_equal(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_double_min_to_all(double *target, double *source, int nreduce,
                                    int PE_start, int logPE_stride, int PE_size,
                                    double *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_double_min_to_all(double* %0, double* %1, i32 %2, i32 %3, i32 %4, i32 %5, double* %6, i64* %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca i64*
store double* %0, double** %9
store double* %1, double** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store double* %6, double** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_double_min_to_all(double* nocapture readnone %0, double* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, double* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ nasm_error(int, char *);
void *nasm_malloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    nasm_error(0x00000002 | 0x00000010, "out of memory");
  return p;
}


x86 assembly (clang, -O0):
<nasm_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <nasm_malloc+0x35>
mov    $0x12,%edi
lea    0xeb0(%rip),%rsi
call   1040 <nasm_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nasm_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <nasm_malloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x12,%edi
call   1040 <nasm_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @nasm_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @nasm_error(i32 18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @nasm_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @nasm_error(i32 18, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int isSafe(int x, int y, int sol[8][8]) {
  if (x >= 0 && x < 8 && y >= 0 && y < 8 && sol[x][y] == -1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSafe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     115f <isSafe+0x5f>
cmpl   $0x8,-0x8(%rbp)
jge    115f <isSafe+0x5f>
cmpl   $0x0,-0xc(%rbp)
jl     115f <isSafe+0x5f>
cmpl   $0x8,-0xc(%rbp)
jge    115f <isSafe+0x5f>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
jne    115f <isSafe+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <isSafe+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSafe>:
mov    %esi,%eax
or     %edi,%eax
cmp    $0x7,%eax
ja     111a <isSafe+0x1a>
mov    %edi,%eax
mov    %esi,%ecx
shl    $0x5,%rax
add    %rax,%rdx
cmpl   $0xffffffff,(%rdx,%rcx,4)
je     111d <isSafe+0x1d>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isSafe(i32 %0, i32 %1, [8 x i32]* nocapture %2) {
%4 = or i32 %1, %0
%5 = icmp ult i32 %4, 8
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = zext i32 %0 to i64
%8 = zext i32 %1 to i64
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 %7, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, -1
br i1 %11, label %13, label %12
12: ; preds = %6, %3
br label %13
13: ; preds = %6, %12
%14 = phi i32 [ 0, %12 ], [ 1, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printLocalVariable();
int /*<<< orphan*/ printStaticLocalVariable();
int main() {
  printLocalVariable();
  printLocalVariable();
  printStaticLocalVariable();
  printStaticLocalVariable();
  printLocalVariable();
  printStaticLocalVariable();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <printLocalVariable@plt>
mov    $0x0,%al
call   1040 <printLocalVariable@plt>
mov    $0x0,%al
call   1030 <printStaticLocalVariable@plt>
mov    $0x0,%al
call   1030 <printStaticLocalVariable@plt>
mov    $0x0,%al
call   1040 <printLocalVariable@plt>
mov    $0x0,%al
call   1030 <printStaticLocalVariable@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <printLocalVariable@plt>
xor    %eax,%eax
call   1040 <printLocalVariable@plt>
xor    %eax,%eax
call   1030 <printStaticLocalVariable@plt>
xor    %eax,%eax
call   1030 <printStaticLocalVariable@plt>
xor    %eax,%eax
call   1040 <printLocalVariable@plt>
xor    %eax,%eax
call   1030 <printStaticLocalVariable@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @printLocalVariable()
%2 = call i32 (...) @printLocalVariable()
%3 = call i32 (...) @printStaticLocalVariable()
%4 = call i32 (...) @printStaticLocalVariable()
%5 = call i32 (...) @printLocalVariable()
%6 = call i32 (...) @printStaticLocalVariable()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printLocalVariable()
%2 = tail call i32 (...) @printLocalVariable()
%3 = tail call i32 (...) @printStaticLocalVariable()
%4 = tail call i32 (...) @printStaticLocalVariable()
%5 = tail call i32 (...) @printLocalVariable()
%6 = tail call i32 (...) @printStaticLocalVariable()
ret i32 0
}
void ble_rsp_system_get_connections(
    const struct ble_msg_system_get_connections_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_system_get_connections_rsp_t = type opaque
define void @ble_rsp_system_get_connections(%struct.ble_msg_system_get_connections_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
wchar_t *wcscpy(wchar_t *restrict dest, const wchar_t *restrict src) {
  size_t i;
  for (i = 0; src[i]; i++) {
    dest[i] = src[i];
  }
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<wcscpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114d <wcscpy+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <wcscpy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @wcscpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 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, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
char *hello(void) { return "hello"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i8* @hello() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void raw() {}


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

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

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

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

/* Variables and functions */
char *format_key(int /*<<< orphan*/, unsigned int, char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ wait_key(int, int /*<<< orphan*/ *, unsigned int *);
void pick_key(int screen) {
  KeyCode kc;
  unsigned int mods;
  char buf[512];
  if (wait_key(screen, &kc, &mods))
    printf("%s\n", format_key(kc, mods, buf));
}


x86 assembly (clang, -O0):
<pick_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <wait_key@plt>
cmp    $0x0,%rax
je     1179 <pick_key+0x49>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x210(%rbp),%rdx
call   1040 <format_key@plt>
mov    %rax,%rsi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pick_key>:
sub    $0x218,%rsp
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <wait_key@plt>
test   %rax,%rax
je     116c <pick_key+0x3c>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
lea    0x10(%rsp),%rdx
call   1040 <format_key@plt>
lea    0xe9c(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
add    $0x218,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @pick_key(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [512 x i8]
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%8 = call i64 @wait_key(i32 %0, i32* %2, i32* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i8* @format_key(i32 %11, i32 %12, i8* %7)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10, %1
ret void
}
int dgeqrf(int M, int N, double *A, int LDA, double *TAU, double *WORK,
           int LWORK) {
  extern void dgeqrf_(int *Mp, int *Np, double *A, int *LDAp, double *TAU,
                      double *WORK, int *LWORKp, int *INFOp);
  int INFO;
  dgeqrf_(&M, &N, A, &LDA, TAU, WORK, &LWORK, &INFO);
  return INFO;
}


x86 assembly (clang, -O0):
<dgeqrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    0x10(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dgeqrf_@plt>
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgeqrf>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0xc(%rsp)
lea    0x8(%rsp),%rax
lea    0x20(%rsp),%r10
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
push   %rax
push   %r10
call   1030 <dgeqrf_@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @dgeqrf(i32 %0, i32 %1, double* %2, i32 %3, double* %4, double* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca double*
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store double* %2, double** %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
store i32 %6, i32* %14
%16 = load double*, double** %10
%17 = load double*, double** %12
%18 = load double*, double** %13
%19 = load i32, i32* %15
ret i32 %19
}

LLVM IR (-O2):
define i32 @dgeqrf(i32 %0, i32 %1, double* %2, i32 %3, double* %4, double* %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %3, i32* %10
store i32 %6, i32* %11
%13 = bitcast i32* %12 to i8*
%14 = load i32, i32* %12
ret i32 %14
}
/* Type definitions */
struct tftpx_packet {
  int dummy;
};

/* Variables and functions */
int send(int, struct tftpx_packet *, int, int /*<<< orphan*/);
int send_ack(int sock, struct tftpx_packet *packet, int size) {
  if (send(sock, packet, size, 0) != size) {
    return -1;
  }
  return size;
}


x86 assembly (clang, -O0):
<send_ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    -0x14(%rbp),%eax
je     1148 <send_ack+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <send_ack+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_ack>:
push   %rbx
mov    %edx,%ebx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    %ebx,%eax
mov    $0xffffffff,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tftpx_packet = type { i32 }
define i32 @send_ack(i32 %0, %struct.tftpx_packet* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tftpx_packet*
%7 = alloca i32
store i32 %0, i32* %5
store %struct.tftpx_packet* %1, %struct.tftpx_packet** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load %struct.tftpx_packet*, %struct.tftpx_packet** %6
%10 = load i32, i32* %7
%11 = call i32 @send(i32 %8, %struct.tftpx_packet* %9, i32 %10, i32 0)
%12 = load i32, i32* %7
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %17
15: ; preds = %3
%16 = load i32, i32* %7
store i32 %16, i32* %4
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
%struct.tftpx_packet = type { i32 }
define i32 @send_ack(i32 %0, %struct.tftpx_packet* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, %struct.tftpx_packet* %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, %2
%6 = select i1 %5, i32 %2, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ frontend_version();
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_string(char *);
void header(void) {
  output_string("; Small C 6809\n;\tCoder (ac0)\n;");
  frontend_version();
  newline();
}


x86 assembly (clang, -O0):
<header>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <output_string@plt>
mov    $0x0,%al
call   1050 <frontend_version@plt>
mov    $0x0,%al
call   1030 <newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<header>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <output_string@plt>
xor    %eax,%eax
call   1050 <frontend_version@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"; Small C 6809\0A;\09Coder (ac0)\0A;\00"
define void @header() {
%1 = call i32 @output_string(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @frontend_version()
%3 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"; Small C 6809\0A;\09Coder (ac0)\0A;\00"
define void @header() {
%1 = tail call i32 @output_string(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @frontend_version()
%3 = tail call i32 (...) @newline()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t pixel_r(uint32_t pixel) { return (pixel >> 16) & 0xff; }


x86 assembly (clang, -O0):
<pixel_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_r>:
shr    $0x10,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @pixel_r(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @pixel_r(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int);
int main() {
  int a[] = {1, 4, 7, 2, 8, 10, 3, 6, 5, 9};
  int n = 10;
  qsort(a, 0, n - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <qsort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <qsort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [10 x i32] [i32 1, i32 4, i32 7, i32 2, i32 8, i32 10, i32 3, i32 6, i32 5, i32 9]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @qsort(i32* %3, i32 0, i32 9)
ret i32 0
}
int getDigit(int i) { return i % 9 + 1; }


x86 assembly (clang, -O0):
<getDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigit>:
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getDigit(i32 %0) {
%2 = srem i32 %0, 9
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
char *roadmap_display_get_id(char *);
int /*<<< orphan*/ roadmap_screen_refresh();
int /*<<< orphan*/ roadmap_trip_set_selection_as(char const *);
void roadmap_start_set_waypoint(void) {
  const char *id = roadmap_display_get_id("Selected Street");
  if (id != NULL) {
    roadmap_trip_set_selection_as(id);
    roadmap_screen_refresh();
  }
}


x86 assembly (clang, -O0):
<roadmap_start_set_waypoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <roadmap_display_get_id@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <roadmap_start_set_waypoint+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <roadmap_trip_set_selection_as@plt>
mov    $0x0,%al
call   1050 <roadmap_screen_refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_start_set_waypoint>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <roadmap_display_get_id@plt>
test   %rax,%rax
je     1152 <roadmap_start_set_waypoint+0x22>
mov    %rax,%rdi
call   1040 <roadmap_trip_set_selection_as@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <roadmap_screen_refresh@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Selected Street\00"
define void @roadmap_start_set_waypoint() {
%1 = alloca i8*
%2 = call i8* @roadmap_display_get_id(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @roadmap_trip_set_selection_as(i8* %6)
%8 = call i32 (...) @roadmap_screen_refresh()
br label %9
9: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Selected Street\00"
define void @roadmap_start_set_waypoint() {
%1 = tail call i8* @roadmap_display_get_id(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @roadmap_trip_set_selection_as(i8* %1)
%5 = tail call i32 (...) @roadmap_screen_refresh()
br label %6
6: ; preds = %3, %0
ret void
}
/* Type definitions */
struct vm_area_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
                     unsigned long end) {
  BUG();
}


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

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

LLVM IR (-O0):
%struct.vm_area_struct = type { i32 }
define void @flush_tlb_range(%struct.vm_area_struct* %0, i64 %1, i64 %2) {
%4 = alloca %struct.vm_area_struct*
%5 = alloca i64
%6 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type { i32 }
define void @flush_tlb_range(%struct.vm_area_struct* nocapture readnone %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @BUG()
ret void
}
void I2CDMATxEventDisable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x94)))) &= ~((0x00000080u));
  (*((volatile unsigned int *)(baseAdd + (0x44)))) = ((0x00000001u));
}


x86 assembly (clang, -O0):
<I2CDMATxEventDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x94,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CDMATxEventDisable>:
lea    0x94(%rdi),%eax
andl   $0xffffff7f,(%rax)
add    $0x44,%edi
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @I2CDMATxEventDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 148
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -129
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add i32 %9, 68
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 1, i32* %12
ret void
}

LLVM IR (-O2):
define void @I2CDMATxEventDisable(i32 %0) {
%2 = add i32 %0, 148
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -129
store volatile i32 %6, i32* %4
%7 = add i32 %0, 68
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 1, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *realloc(char *, scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
char *concatenate(char *a, char *b) {
  a = realloc(a, strlen(a) + strlen(b) + 1);
  strcat(a, b);
  free(b);
  return a;
}


x86 assembly (clang, -O0):
<concatenate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdi
add    %rax,%rsi
add    $0x1,%rsi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenate>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r12,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rsi
add    $0x1,%rsi
mov    %r14,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i8* @realloc(i8* %5, i64 %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = load i8*, i8** %4
%17 = call i32 @free(i8* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @concatenate(i8* nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @realloc(i8* %0, i64 %6)
%8 = tail call i32 @strcat(i8* %7, i8* %1)
%9 = tail call i32 @free(i8* %1)
ret i8* %7
}
float quartic_ease_in_out(float p) {
  float f = 0.0f;
  if (p < 0.5f) {
    f = 8.0f * p * p * p * p;
  } else {
    f = (p - 1.0f);
    f = -8.0f * f * f * f * f + 1.0f;
  }
  return f;
}


x86 assembly (clang, -O0):
<quartic_ease_in_out>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee7(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1149 <quartic_ease_in_out+0x49>
movss  0xee1(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1190 <quartic_ease_in_out+0x90>
movss  -0x4(%rbp),%xmm0
movss  0xeae(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xea1(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe7d(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quartic_ease_in_out>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1129 <quartic_ease_in_out+0x29>
movss  0xefb(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
addss  0xed3(%rip),%xmm0
movss  0xecf(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  0xebb(%rip),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @quartic_ease_in_out(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
store float 0.000000e+00, float* %3
%4 = load float, float* %2
%5 = fcmp olt float %4, 5.000000e-01
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load float, float* %2
%8 = fmul float 8.000000e+00, %7
%9 = load float, float* %2
%10 = fmul float %8, %9
%11 = load float, float* %2
%12 = fmul float %10, %11
%13 = load float, float* %2
%14 = fmul float %12, %13
store float %14, float* %3
br label %26
15: ; preds = %1
%16 = load float, float* %2
%17 = fsub float %16, 1.000000e+00
store float %17, float* %3
%18 = load float, float* %3
%19 = fmul float -8.000000e+00, %18
%20 = load float, float* %3
%21 = fmul float %19, %20
%22 = load float, float* %3
%23 = fmul float %21, %22
%24 = load float, float* %3
%25 = call float @llvm.fmuladd.f32(float %23, float %24, float 1.000000e+00)
store float %25, float* %3
br label %26
26: ; preds = %15, %6
%27 = load float, float* %3
ret float %27
}

LLVM IR (-O2):
define float @quartic_ease_in_out(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fmul float %0, 8.000000e+00
%5 = fmul float %4, %0
%6 = fmul float %5, %0
%7 = fmul float %6, %0
br label %14
8: ; preds = %1
%9 = fadd float %0, -1.000000e+00
%10 = fmul float %9, -8.000000e+00
%11 = fmul float %9, %10
%12 = fmul float %9, %11
%13 = tail call float @llvm.fmuladd.f32(float %12, float %9, float 1.000000e+00)
br label %14
14: ; preds = %8, %3
%15 = phi float [ %7, %3 ], [ %13, %8 ]
ret float %15
}
/* Variables and functions */
int strcmp(void const *, void const *);
int strlen(void const *);
int cmp(const void *a, const void *b) {
  int l1, l2;
  l1 = strlen(a);
  l2 = strlen(b);
  if (l1 == l2) {
    return strcmp(a, b);
  }
  return l1 > l2;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1169 <cmp+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    117a <cmp+0x5a>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jne    114c <cmp+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strcmp@plt>
setg   %al
movzbl %al,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %11
8: ; preds = %2
%9 = icmp sgt i32 %3, %4
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ %7, %6 ], [ %10, %8 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void uninitvar_fgetpos(void) {
  FILE *fp;
  fpos_t pos;
  fpos_t *ppos;
  fgetpos(fp, &pos);
  fp = fopen("filename", "rt");
  fgetpos(fp, ppos);
  fclose(fp);
}


x86 assembly (clang, -O0):
<uninitvar_fgetpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <fgetpos@plt>
lea    0xeb4(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <fgetpos@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_fgetpos>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
call   1040 <fgetpos@plt>
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <fgetpos@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninitvar_fgetpos() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32*
%4 = load i32*, i32** %1
%5 = call i32 @fgetpos(i32* %4, i32* %2)
%6 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = load i32*, i32** %3
%9 = call i32 @fgetpos(i32* %7, i32* %8)
%10 = load i32*, i32** %1
%11 = call i32 @fclose(i32* %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"filename\00"
@.str.1 = [3 x i8] c"rt\00"
define void @uninitvar_fgetpos() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @fgetpos(i32* undef, i32* %1)
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fgetpos(i32* %4, i32* undef)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int top;
  long long x = 8589934592l;
  long long y = 2147483647;
  if (top) {
    x = x - 1;
  }
  long long z = x / y;
  if (z == 4) {
    assert(1);
  }
  assert(z == 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x200000000,%rax
mov    %rax,-0x10(%rbp)
movq   $0x7fffffff,-0x18(%rbp)
7f
cmpl   $0x0,-0x8(%rbp)
je     114b <main+0x3b>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x20(%rbp)
cmpq   $0x4,-0x20(%rbp)
jne    116e <main+0x5e>
mov    $0x1,%edi
call   1030 <assert@plt>
cmpq   $0x4,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 8589934592, i64* %3
store i64 2147483647, i64* %4
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i64, i64* %3
%10 = sub nsw i64 %9, 1
store i64 %10, i64* %3
br label %11
11: ; preds = %8, %0
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = sdiv i64 %12, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = icmp eq i64 %15, 4
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 @assert(i32 1)
br label %19
19: ; preds = %17, %11
%20 = load i64, i64* %5
%21 = icmp eq i64 %20, 4
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("usage: ctail [options][file]\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"usage: ctail [options][file]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"usage: ctail [options][file]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void USB_EndPoint3(uint32_t event) {}


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

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

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

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