xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ malloc(int);
char *CuStrAlloc(int size) {
  char *newStr = (char *)malloc(sizeof(char) * (unsigned)size);
  return newStr;
}


x86 assembly (clang, -O0):
<CuStrAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CuStrAlloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @CuStrAlloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define i8* @CuStrAlloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int remove(char const *);
int deleteEntry(const char *fpath, const struct stat *sb, int typeflag,
                struct FTW *ftw) {
  return remove(fpath);
}


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

x86 assembly (clang, -O2):
<deleteEntry>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @deleteEntry(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%9 = load i8*, i8** %5
%10 = call i32 @remove(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @deleteEntry(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i32 @remove(i8* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
void FetchFolderName(char *tSrc, char *tDst) {
  strcpy(tDst, tSrc);
  char *pos = strrchr(tDst, '/');
  if (pos == NULL) {
    strcpy(tDst, ".");
  } else {
    *(pos + 1) = '\0';
  }
}


x86 assembly (clang, -O0):
<FetchFolderName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <FetchFolderName+0x4f>
mov    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1177 <FetchFolderName+0x57>
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FetchFolderName>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1147 <FetchFolderName+0x27>
movb   $0x0,0x1(%rax)
pop    %rbx
ret
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define void @FetchFolderName(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %1, i8* %0)
%4 = tail call i8* @strrchr(i8* dereferenceable(1) %1, i8 signext 47)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %9
br label %10
10: ; preds = %8, %6
ret void
}
void list_parse(patp, lowp, highp) char **patp;
char *lowp;
char *highp;
{
  *lowp = nextch(patp);
  if (**patp == '-') {
    (*patp)++;
    *highp = nextch(patp);
  } else {
    *highp = *lowp;
  }
}


x86 assembly (clang, -O0):
<list_parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <nextch@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1170 <list_parse+0x60>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <nextch@plt>
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    117c <list_parse+0x6c>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_parse>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <nextch@plt>
mov    %al,(%r15)
mov    (%rbx),%rcx
cmpb   $0x2d,(%rcx)
jne    1141 <list_parse+0x31>
add    $0x1,%rcx
mov    %rcx,(%rbx)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <nextch@plt>
mov    %al,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @list_parse(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = call i32 (i8**, ...) bitcast (i32 (...)* @nextch to i32 (i8**, ...)*)(i8** %7)
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
store i8 %9, i8* %10
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 45
br i1 %15, label %16, label %24
16: ; preds = %3
%17 = load i8**, i8*** %4
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
%20 = load i8**, i8*** %4
%21 = call i32 (i8**, ...) bitcast (i32 (...)* @nextch to i32 (i8**, ...)*)(i8** %20)
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %6
store i8 %22, i8* %23
br label %28
24: ; preds = %3
%25 = load i8*, i8** %5
%26 = load i8, i8* %25
%27 = load i8*, i8** %6
store i8 %26, i8* %27
br label %28
28: ; preds = %24, %16
ret void
}

LLVM IR (-O2):
define void @list_parse(i8** %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = tail call i32 (i8**, ...) bitcast (i32 (...)* @nextch to i32 (i8**, ...)*)(i8** %0)
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = load i8*, i8** %0
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 45
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %10, i8** %0
%11 = tail call i32 (i8**, ...) bitcast (i32 (...)* @nextch to i32 (i8**, ...)*)(i8** %0)
%12 = trunc i32 %11 to i8
br label %13
13: ; preds = %3, %9
%14 = phi i8 [ %12, %9 ], [ %5, %3 ]
store i8 %14, i8* %2
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ lstat(char const *, struct stat *);
int file_non_directory_p(const char *path) {
  struct stat buf;
  if (lstat(path, &buf) != 0)
    return 0;
  return S_ISDIR(buf.st_mode) ? 0 : 1;
}


x86 assembly (clang, -O0):
<file_non_directory_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
je     114f <file_non_directory_p+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    116b <file_non_directory_p+0x4b>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_non_directory_p>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <file_non_directory_p+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_non_directory_p(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %16
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i64 @S_ISDIR(i32 %11)
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
store i32 %15, i32* %2
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_non_directory_p(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISDIR(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %6
%13 = phi i32 [ %11, %6 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ show_mouse_tracking(char const *, char *);
int test_mouse_any_event(const char *the_title) {
  show_mouse_tracking(the_title, "?1003");
  return 1;
}


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

x86 assembly (clang, -O2):
<test_mouse_any_event>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <show_mouse_tracking@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"?1003\00"
define i32 @test_mouse_any_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @show_mouse_tracking(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"?1003\00"
define i32 @test_mouse_any_event(i8* %0) {
%2 = tail call i32 @show_mouse_tracking(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
unsigned long EPIWriteFIFOCountGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000204))));
}


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

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

LLVM IR (-O0):
define i64 @EPIWriteFIFOCountGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 516
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @EPIWriteFIFOCountGet(i64 %0) {
%2 = add i64 %0, 516
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
double avg_of_two(int c, int d) {
  double sum;
  sum = c + d;
  return (c + d) / 2.0;
}


x86 assembly (clang, -O0):
<avg_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<avg_of_two>:
add    %esi,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef2(%rip),%xmm0
ret

LLVM IR (-O0):
define double @avg_of_two(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = sitofp i32 %8 to double
store double %9, double* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 2.000000e+00
ret double %14
}

LLVM IR (-O2):
define double @avg_of_two(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 5.000000e-01
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello, github!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"hello, github!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"hello, github!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned allocation_lc(unsigned lc, unsigned unit) {
  if (lc == 0)
    return (0);
  else
    return (((lc - 1) / unit + 1) * unit);
}


x86 assembly (clang, -O0):
<allocation_lc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1120 <allocation_lc+0x20>
movl   $0x0,-0x4(%rbp)
jmp    1135 <allocation_lc+0x35>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
add    $0x1,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocation_lc>:
test   %edi,%edi
je     1114 <allocation_lc+0x14>
add    $0xffffffff,%edi
mov    %edi,%eax
xor    %edx,%edx
div    %esi
add    $0x1,%eax
imul   %esi,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @allocation_lc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %17
9: ; preds = %2
%10 = load i32, i32* %4
%11 = sub i32 %10, 1
%12 = load i32, i32* %5
%13 = udiv i32 %11, %12
%14 = add i32 %13, 1
%15 = load i32, i32* %5
%16 = mul i32 %14, %15
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @allocation_lc(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = add i32 %0, -1
%6 = udiv i32 %5, %1
%7 = add nuw i32 %6, 1
%8 = mul i32 %7, %1
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
void UDNList_Add(char *UDN) {}


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

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

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

LLVM IR (-O2):
define void @UDNList_Add(i8* nocapture %0) {
ret void
}
void testClosureFLLFrV(void (*closure)(float, long long, float), float a1,
                       long long a2, float a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureFLLFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm1,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
movss  -0x1c(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFLLFrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureFLLFrV(void (float, i64, float)* %0, float %1, i64 %2, float %3) {
%5 = alloca void (float, i64, float)*
%6 = alloca float
%7 = alloca i64
%8 = alloca float
store void (float, i64, float)* %0, void (float, i64, float)** %5
store float %1, float* %6
store i64 %2, i64* %7
store float %3, float* %8
%9 = load void (float, i64, float)*, void (float, i64, float)** %5
%10 = load float, float* %6
%11 = load i64, i64* %7
%12 = load float, float* %8
ret void
}

LLVM IR (-O2):
define void @testClosureFLLFrV(void (float, i64, float)* nocapture %0, float %1, i64 %2, float %3) {
tail call void %0(float %1, i64 %2, float %3)
ret void
}
/* Variables and functions */
scalar_t__ LZ4HC_literalsPrice(int);
__attribute__((always_)) int LZ4HC_sequencePrice(int litlen, int mlen) {
  int price = 1 + 2;
  price += LZ4HC_literalsPrice(litlen);
  if (mlen >= (int)(((1U << 4) - 1) + 4))
    price += 1 + (mlen - (((1U << 4) - 1) + 4)) / 255;
  return price;
}


x86 assembly (clang, -O0):
<LZ4HC_sequencePrice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <LZ4HC_literalsPrice@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x13,-0x8(%rbp)
jl     115c <LZ4HC_sequencePrice+0x4c>
mov    -0x8(%rbp),%eax
sub    $0x13,%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
add    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4HC_sequencePrice>:
push   %rbx
mov    %esi,%ebx
call   1030 <LZ4HC_literalsPrice@plt>
add    $0x3,%eax
cmp    $0x13,%ebx
jl     1135 <LZ4HC_sequencePrice+0x25>
add    $0xffffffed,%ebx
mov    $0x80808081,%ecx
imul   %rbx,%rcx
shr    $0x27,%rcx
add    %ecx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @LZ4HC_sequencePrice(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 3, i32* %5
%6 = load i32, i32* %3
%7 = call i64 @LZ4HC_literalsPrice(i32 %6)
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = add nsw i64 %9, %7
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 19
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32, i32* %4
%16 = sub i32 %15, 19
%17 = udiv i32 %16, 255
%18 = add i32 1, %17
%19 = load i32, i32* %5
%20 = add i32 %19, %18
store i32 %20, i32* %5
br label %21
21: ; preds = %14, %2
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @LZ4HC_sequencePrice(i32 %0, i32 %1) {
%3 = tail call i64 @LZ4HC_literalsPrice(i32 %0)
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 3
%6 = icmp sgt i32 %1, 18
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = add nsw i32 %1, -19
%9 = udiv i32 %8, 255
%10 = add nuw nsw i32 %9, 1
%11 = add i32 %10, %5
br label %12
12: ; preds = %7, %2
%13 = phi i32 [ %11, %7 ], [ %5, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ puthex4(unsigned int);
puthex8(unsigned x) {
  x &= 0xFF;
  puthex4(x >> 4);
  puthex4(x & 0xF);
}


x86 assembly (clang, -O0):
<puthex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shr    $0x4,%edi
call   1030 <puthex4@plt>
mov    -0x8(%rbp),%edi
and    $0xf,%edi
call   1030 <puthex4@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puthex8>:
push   %rbx
mov    %edi,%ebx
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <puthex4@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <puthex4@plt>

LLVM IR (-O0):
define i32 @puthex8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 255
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = lshr i32 %6, 4
%8 = call i32 @puthex4(i32 %7)
%9 = load i32, i32* %3
%10 = and i32 %9, 15
%11 = call i32 @puthex4(i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @puthex8(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = tail call i32 @puthex4(i32 %3)
%5 = and i32 %0, 15
%6 = tail call i32 @puthex4(i32 %5)
ret i32 undef
}
/* Type definitions */
struct itimerval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int setitimer(int which, const struct itimerval *value,
              struct itimerval *ovalue) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<setitimer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setitimer>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.itimerval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setitimer(i32 %0, %struct.itimerval* %1, %struct.itimerval* %2) {
%4 = alloca i32
%5 = alloca %struct.itimerval*
%6 = alloca %struct.itimerval*
store i32 %0, i32* %4
store %struct.itimerval* %1, %struct.itimerval** %5
store %struct.itimerval* %2, %struct.itimerval** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.itimerval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setitimer(i32 %0, %struct.itimerval* nocapture readnone %1, %struct.itimerval* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ EVP_PKEY;

/* Variables and functions */
int /*<<< orphan*/ *X509_get_pubkey(int /*<<< orphan*/ *);
EVP_PKEY *extract_pubkey_from_cert(X509 *cert) {
  EVP_PKEY *pubkey = X509_get_pubkey(cert);
  return pubkey;
}


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

x86 assembly (clang, -O2):
<extract_pubkey_from_cert>:
jmp    1030 <X509_get_pubkey@plt>

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

LLVM IR (-O2):
define i32* @extract_pubkey_from_cert(i32* %0) {
%2 = tail call i32* @X509_get_pubkey(i32* %0)
ret i32* %2
}
void f2(void) {
  short a;
  short b = 1;
  int c = 3;
#pragma omp atomic capture
  a = b = c + b;
  if (b != 4 || a != 4)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x1,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
mov    %ax,-0x2(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x4,%eax
jne    1150 <f2+0x40>
movswl -0x2(%rbp),%eax
cmp    $0x4,%eax
je     1155 <f2+0x45>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
Usage() {
  printf("usage: symstrip <full> <remove> <dest>\r\n");
  printf("\t<dest> = <full> - <remove>\r\n");
  printf("\tboth <full> and <remove> MUST be sorted\r\n");
  printf("\tremoval is case sensitive\r\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"usage: symstrip <full> <remove> <dest>\0D\0A\00"
@.str.1 = [30 x i8] c"\09<dest> = <full> - <remove>\0D\0A\00"
@.str.2 = [43 x i8] c"\09both <full> and <remove> MUST be sorted\0D\0A\00"
@.str.3 = [29 x i8] c"\09removal is case sensitive\0D\0A\00"
define i32 @Usage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@str = [40 x i8] c"usage: symstrip <full> <remove> <dest>\0D\00"
@str.4 = [29 x i8] c"\09<dest> = <full> - <remove>\0D\00"
@str.5 = [42 x i8] c"\09both <full> and <remove> MUST be sorted\0D\00"
@str.6 = [28 x i8] c"\09removal is case sensitive\0D\00"
define i32 @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.6, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct string_buffer {
  int dummy;
};

/* Variables and functions */
int strbuf_append_data(struct string_buffer *, char const *,
                       int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int strbuf_append(struct string_buffer *strbuf, const char *str) {
  return strbuf_append_data(strbuf, str, strlen(str));
}


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

x86 assembly (clang, -O2):
<strbuf_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strbuf_append_data@plt>

LLVM IR (-O0):
%struct.string_buffer = type { i32 }
define i32 @strbuf_append(%struct.string_buffer* %0, i8* %1) {
%3 = alloca %struct.string_buffer*
%4 = alloca i8*
store %struct.string_buffer* %0, %struct.string_buffer** %3
store i8* %1, i8** %4
%5 = load %struct.string_buffer*, %struct.string_buffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strbuf_append_data(%struct.string_buffer* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.string_buffer = type { i32 }
define i32 @strbuf_append(%struct.string_buffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strbuf_append_data(%struct.string_buffer* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
struct timer_drv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(struct timer_drv *);
void timer_drv_uninit(struct timer_drv *timer_drv) { assert(timer_drv); }


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

x86 assembly (clang, -O2):
<timer_drv_uninit>:
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
%struct.timer_drv = type { i32 }
define void @timer_drv_uninit(%struct.timer_drv* %0) {
%2 = tail call i32 @assert(%struct.timer_drv* %0)
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ writei(int);
int /*<<< orphan*/ writes(char *);
void _printString_bin(char *s) {
  int l = strlen(s);
  writei(l);
  writes(s);
}


x86 assembly (clang, -O0):
<_printString_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <writei@plt>
mov    -0x8(%rbp),%rdi
call   1040 <writes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_printString_bin>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%edi
call   1050 <writei@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <writes@plt>

LLVM IR (-O0):
define void @_printString_bin(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @writei(i32 %6)
%8 = load i8*, i8** %2
%9 = call i32 @writes(i8* %8)
ret void
}

LLVM IR (-O2):
define void @_printString_bin(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @writei(i32 %2)
%4 = tail call i32 @writes(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASPI_End();
int /*<<< orphan*/ FILE_End();
void End_CD_Driver(void) {
  ASPI_End();
  FILE_End();
}


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

x86 assembly (clang, -O2):
<End_CD_Driver>:
push   %rax
xor    %eax,%eax
call   1030 <ASPI_End@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <FILE_End@plt>

LLVM IR (-O0):
define void @End_CD_Driver() {
%1 = call i32 (...) @ASPI_End()
%2 = call i32 (...) @FILE_End()
ret void
}

LLVM IR (-O2):
define void @End_CD_Driver() {
%1 = tail call i32 (...) @ASPI_End()
%2 = tail call i32 (...) @FILE_End()
ret void
}
void CreateFile(char *filename, int *errorcode) {}


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

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

LLVM IR (-O0):
define void @CreateFile(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
define void @CreateFile(i8* nocapture %0, i32* nocapture %1) {
ret void
}
void mbed_trace_free(void) {}


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

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

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

LLVM IR (-O2):
define void @mbed_trace_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putstr(char *);
void reset() {
  my_putstr("\033[2J");
  my_putstr("\e[0m");
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @reset() {
%1 = call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @reset() {
%1 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void dbgprintf(const char *msg, ...) {}


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

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

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

LLVM IR (-O2):
define void @dbgprintf(i8* nocapture %0, ...) {
ret void
}
int starts_with(const char *str, const char *prefix) {
  for (;; str++, prefix++)
    if (!*prefix)
      return 1;
    else if (*str != *prefix)
      return 0;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1125 <starts_with+0x25>
movl   $0x1,-0x4(%rbp)
jmp    116e <starts_with+0x6e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1147 <starts_with+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <starts_with+0x6e>
jmp    114c <starts_with+0x4c>
jmp    1151 <starts_with+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <starts_with+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
mov    (%rsi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1122 <starts_with+0x22>
xor    %edx,%edx
nopl   (%rax)
cmp    %cl,(%rdi,%rdx,1)
jne    1123 <starts_with+0x23>
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <starts_with+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %6
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %11, %5, %2
%17 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %11 ]
ret i32 %17
}
/* Variables and functions */
void *__memcpy(void *, void const *, size_t);
void *memcpy(void *to, const void *from, size_t n) {
  return __memcpy(to, from, n);
}


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

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <__memcpy@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @__memcpy(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
double fmin(double x, double y) {
  if (x < y) {
    return x;
  }
  return y;
}


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmin+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <fmin+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int write_i2c_reg(int, int, int /*<<< orphan*/);
int piups_set_vauxoconv(int file_i2c, uint16_t vaoconv) {
  return write_i2c_reg(file_i2c, 0x5A, vaoconv);
}


x86 assembly (clang, -O0):
<piups_set_vauxoconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x5a,%esi
call   1030 <write_i2c_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piups_set_vauxoconv>:
mov    %esi,%edx
mov    $0x5a,%esi
jmp    1030 <write_i2c_reg@plt>

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

LLVM IR (-O2):
define i32 @piups_set_vauxoconv(i32 %0, i32 %1) {
%3 = tail call i32 @write_i2c_reg(i32 %0, i32 90, i32 %1)
ret i32 %3
}
OP(ed, de) { illegal_2(); }


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 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <illegal_2@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 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void free(unsigned int *p) {}


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

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

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

LLVM IR (-O2):
define void @free(i32* nocapture %0) {
ret void
}
/* Variables and functions */
char *setlocale(int n, const char *loc) { return (char *)NULL; }


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @setlocale(i32 %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char const *, char const *);
int toupper(char const);
char *setmfile(char *buf, const char *userid, const char *filename) {
  sprintf(buf, "mail/%c/%s/%s", toupper(userid[0]), userid, filename);
  return buf;
}


x86 assembly (clang, -O0):
<setmfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xea3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setmfile>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movsbl (%rsi),%edi
call   1030 <toupper@plt>
lea    0xec3(%rip),%rsi
mov    %r15,%rdi
mov    %eax,%edx
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <sprintf@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"mail/%c/%s/%s\00"
define i8* @setmfile(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = call i32 @toupper(i8 signext %10)
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
@.str = [14 x i8] c"mail/%c/%s/%s\00"
define i8* @setmfile(i8* returned writeonly %0, i8* %1, i8* %2) {
%4 = load i8, i8* %1
%5 = tail call i32 @toupper(i8 signext %4)
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %1, i8* %2)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ d;
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void main() {
  int a;
  char b[] = "Jessica Cristina Cacau Patricio";
  float c;
  double d;
  printf("Tamanho do int: %d\n"
         "Tamanho da string: %d\n"
         "Tamanho do float: %d\n"
         "Tamanho do double: %d\n"
         "Produto: %d\n",
         sizeof(a), sizeof(b), sizeof(c), sizeof(d),
         sizeof(a) * sizeof(b) * sizeof(c) * sizeof(d));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x4,%ecx
mov    $0x20,%edx
mov    $0x8,%r8d
mov    $0x1000,%r9d
mov    %ecx,%esi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x4,%esi
mov    $0x20,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x1000,%r9d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.main.b = [32 x i8] c"Jessica Cristina Cacau Patricio\00"
@.str = [97 x i8] c"Tamanho do int: %d\0ATamanho da string: %d\0ATamanho do float: %d\0ATamanho do double: %d\0AProduto: %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca float
%4 = alloca double
%5 = bitcast [32 x i8]* %2 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i32 4, i32 32, i32 4, i32 8, i32 4096)
ret void
}

LLVM IR (-O2):
@.str = [97 x i8] c"Tamanho do int: %d\0ATamanho da string: %d\0ATamanho do float: %d\0ATamanho do double: %d\0AProduto: %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0), i32 4, i32 32, i32 4, i32 8, i32 4096)
ret void
}
/* Variables and functions */
int chmod(char *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ umask(int);
int main() {
  umask(0000);
  int rt = chmod("hello", 0777);
  if (rt == 0) {
    printf("succes%d\n", rt);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <umask@plt>
lea    0xeb3(%rip),%rdi
mov    $0x1ff,%esi
call   1050 <chmod@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1173 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <umask@plt>
lea    0xec1(%rip),%rdi
mov    $0x1ff,%esi
call   1050 <chmod@plt>
test   %eax,%eax
jne    115b <main+0x2b>
lea    0xeb2(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [10 x i8] c"succes%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @umask(i32 0)
%4 = call i32 @chmod(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 511)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [10 x i8] c"succes%d\0A\00"
define i32 @main() {
%1 = tail call i32 @umask(i32 0)
%2 = tail call i32 @chmod(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 511)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %6
6: ; preds = %4, %0
ret i32 0
}