xunge/DecIR huggingface dataset:
int hexval(int c) {
  if (c >= '0' && c <= '9')
    return (c - '0');
  if (c >= 'A' && c <= 'F')
    return (c - 'A' + 10);
  if (c >= 'a' && c <= 'f')
    return (c - 'a' + 10);
  return (-1);
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <hexval+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <hexval+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexval+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     114e <hexval+0x4e>
cmpl   $0x46,-0x8(%rbp)
jg     114e <hexval+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexval+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     1173 <hexval+0x73>
cmpl   $0x66,-0x8(%rbp)
jg     1173 <hexval+0x73>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hexval+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hexval+0x27>
lea    -0x41(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hexval+0x16>
add    $0xffffffc9,%edi
mov    %edi,%eax
ret
lea    -0x61(%rdi),%eax
add    $0xffffffa9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hexval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 102
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hexval(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -65
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -55
br label %14
9: ; preds = %4
%10 = add i32 %0, -97
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -87
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t fmt_u64_dec(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print(char *, size_t);
void print_u64_dec(uint64_t val) {
  char buf[20];
  size_t len = fmt_u64_dec(buf, val);
  print(buf, len);
}


x86 assembly (clang, -O0):
<print_u64_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <fmt_u64_dec@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_u64_dec>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%esi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <fmt_u64_dec@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <print@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @print_u64_dec(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca i64
store i32 %0, i32* %2
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i64 @fmt_u64_dec(i8* %5, i32 %6)
store i64 %7, i64* %4
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = load i64, i64* %4
%10 = call i32 @print(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @print_u64_dec(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i64 @fmt_u64_dec(i8* %3, i32 %0)
%5 = call i32 @print(i8* %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *erealloc(void *ptr, size_t size) {
  void *r;
  if (!(r = realloc(ptr, size)))
    do {
      perror("realloc failed");
      exit(EXIT_FAILURE);
    } while (0);
  return r;
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117a <erealloc+0x4a>
jmp    1160 <erealloc+0x30>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <erealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"realloc failed\00"
@EXIT_FAILURE = global i32 0
define i8* @erealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %16, label %10
10: ; preds = %2
br label %11
11: ; preds = %10
%12 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; No predecessors!
br label %16
16: ; preds = %15, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"realloc failed\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
int get_word(const char *data) {
  return (data[0] & 0xFF) + ((data[1] & 0xFF) << 8);
}


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_word(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
const char *deviceLedGetName(void) { return "LED"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"LED\00"
define i8* @deviceLedGetName() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bswap24(uint32_t u32) {
  return (((u32 & 0xff) << 16) | ((u32 & 0xff00)) | ((u32 & 0xff0000) >> 16));
}


x86 assembly (clang, -O0):
<bswap24>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap24>:
movzbl %dil,%eax
shl    $0x10,%eax
mov    %edi,%ecx
and    $0xff00,%ecx
or     %eax,%ecx
shr    $0x10,%edi
movzbl %dil,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bswap24(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = or i32 %5, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 16711680
%11 = ashr i32 %10, 16
%12 = or i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @bswap24(i32 %0) {
%2 = shl i32 %0, 16
%3 = and i32 %2, 16711680
%4 = and i32 %0, 65280
%5 = or i32 %3, %4
%6 = lshr i32 %0, 16
%7 = and i32 %6, 255
%8 = or i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int /*<<< orphan*/ F_OK;
int faccessat(int /*<<< orphan*/, char *, int /*<<< orphan*/,
              int /*<<< orphan*/);
int main(void) {
  return faccessat(AT_FDCWD, "dummytestfile", F_OK, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ecx
lea    0xebf(%rip),%rsi
call   1030 <faccessat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    0x2eb7(%rip),%rax
mov    (%rax),%ecx
lea    0xece(%rip),%rsi
jmp    1030 <faccessat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@.str = [14 x i8] c"dummytestfile\00"
@F_OK = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AT_FDCWD
%3 = load i32, i32* @F_OK
%4 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%5 = call i32 @faccessat(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@.str = [14 x i8] c"dummytestfile\00"
@F_OK = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @main() {
%1 = load i32, i32* @AT_FDCWD
%2 = load i32, i32* @F_OK
%3 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%4 = tail call i32 @faccessat(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int inputint(char *c) {
  int num;
  printf("Inserisci %s\n", c);
  scanf("%d", &num);
  return num;
}


x86 assembly (clang, -O0):
<inputint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputint>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Inserisci %s\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputint(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"Inserisci %s\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputint(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
void restore_NMI_vector(unsigned short *high, unsigned short *low) {}


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

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

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

LLVM IR (-O2):
define void @restore_NMI_vector(i16* nocapture %0, i16* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CODESET;
char *nl_langinfo(int /*<<< orphan*/);
const char *get_charset(void) {
  const char *codeset = nl_langinfo(CODESET);
  return codeset;
}


x86 assembly (clang, -O0):
<get_charset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_charset>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@CODESET = global i32 0
define i8* @get_charset() {
%1 = alloca i8*
%2 = load i32, i32* @CODESET
%3 = call i8* @nl_langinfo(i32 %2)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
@CODESET = global i32 0
define i8* @get_charset() {
%1 = load i32, i32* @CODESET
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *realpath_s(char *);
int main(int argc, char **argv) {
  if (argc > 1)
    printf("%s\n", realpath_s(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    115c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <realpath_s@plt>
mov    %rax,%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1142 <main+0x22>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <realpath_s@plt>
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i8* @realpath_s(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ comment();
int /*<<< orphan*/ nl();
int /*<<< orphan*/ outstr(char *);
trailer() {
  nl();
  comment();
  outstr(" --- End of Compilation ---");
  nl();
}


x86 assembly (clang, -O0):
<trailer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <nl@plt>
mov    $0x0,%al
call   1050 <comment@plt>
lea    0xeb3(%rip),%rdi
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailer>:
push   %rax
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1050 <comment@plt>
lea    0xeba(%rip),%rdi
call   1040 <outstr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [28 x i8] c" --- End of Compilation ---\00"
define i32 @trailer() {
%1 = alloca i32
%2 = call i32 (...) @nl()
%3 = call i32 (...) @comment()
%4 = call i32 @outstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @nl()
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [28 x i8] c" --- End of Compilation ---\00"
define i32 @trailer() {
%1 = tail call i32 (...) @nl()
%2 = tail call i32 (...) @comment()
%3 = tail call i32 @outstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @nl()
ret i32 undef
}
void bnxt_enable_poll(struct bnxt_napi *bnapi) {}


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

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

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

LLVM IR (-O2):
%struct.bnxt_napi = type opaque
define void @bnxt_enable_poll(%struct.bnxt_napi* nocapture %0) {
ret void
}
double dblAnd(double a, double b) { return ((long)a) & ((long)b); }


x86 assembly (clang, -O0):
<dblAnd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvttsd2si -0x10(%rbp),%rcx
and    %rcx,%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblAnd>:
cvttsd2si %xmm0,%rax
cvttsd2si %xmm1,%rcx
and    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
ret

LLVM IR (-O0):
define double @dblAnd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fptosi double %5 to i64
%7 = load double, double* %4
%8 = fptosi double %7 to i64
%9 = and i64 %6, %8
%10 = sitofp i64 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @dblAnd(double %0, double %1) {
%3 = fptosi double %0 to i64
%4 = fptosi double %1 to i64
%5 = and i64 %4, %3
%6 = sitofp i64 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void runSelected(int ask) {
  switch (ask) {
  case 1:
    system("date");
    break;
  case 2:
    system("cal");
    break;
  case 3:
    system("ls -l");
    break;
  }
}


x86 assembly (clang, -O0):
<runSelected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1151 <runSelected+0x41>
jmp    112f <runSelected+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1162 <runSelected+0x52>
jmp    1140 <runSelected+0x30>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1173 <runSelected+0x63>
jmp    117f <runSelected+0x6f>
lea    0xea8(%rip),%rdi
call   1030 <system@plt>
jmp    117f <runSelected+0x6f>
lea    0xe9c(%rip),%rdi
call   1030 <system@plt>
jmp    117f <runSelected+0x6f>
lea    0xe8f(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runSelected>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     112e <runSelected+0x1e>
movslq %edi,%rax
lea    0xeee(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <system@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"date\00"
@.str.1 = [4 x i8] c"cal\00"
@.str.2 = [6 x i8] c"ls -l\00"
define void @runSelected(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %1
%5 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %1, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"date\00"
@.str.1 = [4 x i8] c"cal\00"
@.str.2 = [6 x i8] c"ls -l\00"
@reltable.runSelected = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.runSelected to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.runSelected to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.runSelected to i64)) to i32)]
define void @runSelected(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.runSelected to i8*), i64 %6)
%8 = tail call i32 @system(i8* %7)
br label %9
9: ; preds = %1, %4
ret void
}
void test2() {
  printf("%s:%d %s()\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/"
         "clang/attribute/weak_fun/libfun2.c",
         21, __func__);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x15,%edx
lea    0xf82(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf8b(%rip),%rcx
mov    $0x15,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s:%d %s()\0A\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/attribute/weak_fun/libfun2.c\00"
@__func__.test2 = [6 x i8] c"test2\00"
define void @test2() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s:%d %s()\0A\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fengbohello/practice/refs/heads/master/clang/attribute/weak_fun/libfun2.c\00"
@__func__.test2 = [6 x i8] c"test2\00"
define void @test2() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i32 21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.test2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  typedef int dpl_integer_t;
  dpl_integer_t v;
  v = 6;
  printf("%d\n", v);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usart_write_char(int);
void usart_endln(void) { usart_write_char(0x03); }


x86 assembly (clang, -O0):
<usart_endln>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <usart_write_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_endln>:
mov    $0x3,%edi
jmp    1030 <usart_write_char@plt>

LLVM IR (-O0):
define void @usart_endln() {
%1 = call i32 @usart_write_char(i32 3)
ret void
}

LLVM IR (-O2):
define void @usart_endln() {
%1 = tail call i32 @usart_write_char(i32 3)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int /*<<< orphan*/ strncat(char *, char *, int);
void remember_author(char *s, char *au) {
  char *p = strchr(s, '(');
  *au = '\0';
  if (p != NULL) {
    int n = p - s;
    strncat(au, s, n - 1);
  }
}


x86 assembly (clang, -O0):
<remember_author>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x28,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1175 <remember_author+0x55>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remember_author>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x28,%esi
call   1030 <strchr@plt>
movb   $0x0,(%r14)
test   %rax,%rax
je     1155 <remember_author+0x35>
mov    %ebx,%edx
not    %edx
add    %eax,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strncat@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @remember_author(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i8* @strchr(i8* %7, i8 signext 40)
store i8* %8, i8** %5
%9 = load i8*, i8** %4
store i8 0, i8* %9
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %24
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %6
%19 = load i8*, i8** %4
%20 = load i8*, i8** %3
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
%23 = call i32 @strncat(i8* %19, i8* %20, i32 %22)
br label %24
24: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @remember_author(i8* %0, i8* %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 40)
store i8 0, i8* %1
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = ptrtoint i8* %3 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %9, -1
%11 = tail call i32 @strncat(i8* %1, i8* %0, i32 %10)
br label %12
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exclamacoes(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N;
  printf("Insira N: ");
  scanf("%d", &N);
  exclamacoes(N);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <exclamacoes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exclamacoes@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Insira N: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @exclamacoes(i32 %5)
ret i32 0
}
/* Type definitions */
struct _mgmt_templogin_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _mgmt_templogin_rsp *);
void mgmt_templogin_rsp_free(struct _mgmt_templogin_rsp *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
%struct._mgmt_templogin_rsp = type { i32 }
define void @mgmt_templogin_rsp_free(%struct._mgmt_templogin_rsp* nocapture %0) {
%2 = tail call i32 @free(%struct._mgmt_templogin_rsp* %0)
ret void
}
__attribute__((unused)) void ularith_submod_ul_ul(unsigned long *r,
                                                  const unsigned long a,
                                                  const unsigned long b,
                                                  const unsigned long m) {
  ;
  {
    unsigned long t = 0UL, tr;
    if ((tr = a - b) > a)
      t = m;
    r[0] = tr + t;
  };
}


x86 assembly (clang, -O0):
<ularith_submod_ul_ul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmp    -0x10(%rbp),%rax
jbe    113a <ularith_submod_ul_ul+0x3a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rcx
add    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ularith_submod_ul_ul>:
xor    %eax,%eax
sub    %rdx,%rsi
cmovb  %rcx,%rax
add    %rsi,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @ularith_submod_ul_ul(i64* nocapture writeonly %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp ult i64 %1, %2
%6 = select i1 %5, i64 %3, i64 0
%7 = sub i64 %1, %2
%8 = add i64 %7, %6
store i64 %8, i64* %0
ret void
}
void diff_vector_f(float *p1, float *p2, float *v1) {
  v1[0] = p2[0] - p1[0];
  v1[1] = p2[1] - p1[1];
  v1[2] = p2[2] - p1[2];
}


x86 assembly (clang, -O0):
<diff_vector_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_vector_f>:
movss  (%rsi),%xmm0
subss  (%rdi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rsi),%xmm0
subss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @diff_vector_f(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %4
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %4
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @diff_vector_f(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %1
%5 = load float, float* %0
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %0, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %0, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
int do_nothing() {
  unsigned int i = 0;
  int k = 100;
  int j = k + 1;
  return j;
}


x86 assembly (clang, -O0):
<do_nothing>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @do_nothing() {
ret i32 101
}
int anc_max14744_dev_register(struct anc_hs_dev *dev, void *codec_data) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.anc_hs_dev = type opaque
define i32 @anc_max14744_dev_register(%struct.anc_hs_dev* %0, i8* %1) {
%3 = alloca %struct.anc_hs_dev*
%4 = alloca i8*
store %struct.anc_hs_dev* %0, %struct.anc_hs_dev** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.anc_hs_dev = type opaque
define i32 @anc_max14744_dev_register(%struct.anc_hs_dev* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
char *convert_backslash_to_slash(char *cesta) {
  int i = 0;
  while (cesta[i]) {
    if (cesta[i] == '\\')
      cesta[i] = '/';
    i++;
  }
  return cesta;
}


x86 assembly (clang, -O0):
<convert_backslash_to_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1150 <convert_backslash_to_slash+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1142 <convert_backslash_to_slash+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <convert_backslash_to_slash+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_backslash_to_slash>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    1117 <convert_backslash_to_slash+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x2f,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x5c,%dl
je     1110 <convert_backslash_to_slash+0x10>
test   %dl,%dl
jne    1113 <convert_backslash_to_slash+0x13>
ret

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

LLVM IR (-O2):
define i8* @convert_backslash_to_slash(i8* returned %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 92, label %6
]
6: ; preds = %2
store i8 47, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
void *pvGetFrameEvent(char byBoardNum) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvGetFrameEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i8* @pvGetFrameEvent(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define noalias i8* @pvGetFrameEvent(i8 signext %0) {
%2 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void PECIIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulBase == 0x400B0000);
  (*((volatile unsigned long *)(ulBase + 0x0000008C))) = ulIntFlags;
}


x86 assembly (clang, -O0):
<PECIIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8c(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIIntClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400b0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x8c(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @PECIIntClear(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 = icmp eq i64 %5, 1074462720
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = add i64 %10, 140
%12 = inttoptr i64 %11 to i64*
store volatile i64 %9, i64* %12
ret void
}

LLVM IR (-O2):
define void @PECIIntClear(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074462720
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 140
%7 = inttoptr i64 %6 to i64*
store volatile i64 %1, i64* %7
ret void
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int *write_1_svc(char **msg, struct svc_req *req) {
  static int result;
  printf("%s", *msg);
  result = 1;
  return (&result);
}


x86 assembly (clang, -O0):
<write_1_svc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,0x2eef(%rip)
lea    0x2ee8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_1_svc>:
push   %rax
mov    (%rdi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,0x2f02(%rip)
lea    0x2efb(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.svc_req = type { i32 }
@write_1_svc.result = internal global i32 0
@.str = [3 x i8] c"%s\00"
define i32* @write_1_svc(i8** %0, %struct.svc_req* %1) {
%3 = alloca i8**
%4 = alloca %struct.svc_req*
store i8** %0, i8*** %3
store %struct.svc_req* %1, %struct.svc_req** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 1, i32* @write_1_svc.result
ret i32* @write_1_svc.result
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
@write_1_svc.result = internal global i32 0
@.str = [3 x i8] c"%s\00"
define i32* @write_1_svc(i8** nocapture %0, %struct.svc_req* nocapture readnone %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
store i32 1, i32* @write_1_svc.result
ret i32* @write_1_svc.result
}
/* Variables and functions */
double sqrt(double);
double vabs(double *r) { return sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]); }


x86 assembly (clang, -O0):
<vabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vabs>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <vabs+0x31>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @vabs(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
%24 = call double @sqrt(double %23)
ret double %24
}

LLVM IR (-O2):
define double @vabs(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
%10 = tail call double @sqrt(double %9)
ret double %10
}
int fun788() { return 788; }


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

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

LLVM IR (-O0):
define i32 @fun788() {
ret i32 788
}

LLVM IR (-O2):
define i32 @fun788() {
ret i32 788
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_broadcast(pthread_cond_t *__cond) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_cond_broadcast(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, cross-compilation world !\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 = [34 x i8] c"Hello, cross-compilation world !\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"Hello, cross-compilation world !\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}