xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ pthread_self();
int gettid(void) { return (int)pthread_self(); }


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

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

LLVM IR (-O0):
define i32 @gettid() {
%1 = call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @gettid() {
%1 = tail call i64 (...) @pthread_self()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ num;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int mywav_fwi08(FILE *fd, int num) {
  if (fputc((num)&0xff, fd) < 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<mywav_fwi08>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
cmp    $0x0,%rax
jge    1147 <mywav_fwi08+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <mywav_fwi08+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywav_fwi08>:
push   %rax
mov    %rdi,%rax
movzbl %sil,%edi
mov    %rax,%rsi
call   1030 <fputc@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mywav_fwi08(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* %5
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = call i64 @fputc(i32 %7, i32* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @mywav_fwi08(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i64 @fputc(i32 %3, i32* %0)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ add_mime_type(char *, char *);
void c_add_type(char *v1, char *v2, void *t) { add_mime_type(v2, v1); }


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

x86 assembly (clang, -O2):
<c_add_type>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <add_mime_type@plt>

LLVM IR (-O0):
define void @c_add_type(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** %5
%8 = load i8*, i8** %4
%9 = call i32 @add_mime_type(i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @c_add_type(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @add_mime_type(i8* %1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
char *malloc(unsigned int);
char *scxmalloc(unsigned n) {
  register char *ptr;
  if ((ptr = malloc(n + sizeof(double))) == NULL)
    fatal("scxmalloc: no memory");
  *((double *)ptr) = (double)1234567890.12344;
  return (ptr + sizeof(double));
}


x86 assembly (clang, -O0):
<scxmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <scxmalloc+0x33>
lea    0xeba(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scxmalloc>:
push   %rbx
add    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <scxmalloc+0x1d>
lea    0xec8(%rip),%rdi
call   1040 <fatal@plt>
movabs $0x41d26580b487e671,%rax
65 d2 41
mov    %rax,(%rbx)
add    $0x8,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"scxmalloc: no memory\00"
define i8* @scxmalloc(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 = add i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @fatal(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to double*
store double 0x41D26580B487E671, double* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 8
ret i8* %16
}

LLVM IR (-O2):
@.str = [21 x i8] c"scxmalloc: no memory\00"
define noalias i8* @scxmalloc(i32 %0) {
%2 = add i32 %0, 8
%3 = tail call i8* @malloc(i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = bitcast i8* %3 to double*
store double 0x41D26580B487E671, double* %8
%9 = getelementptr inbounds i8, i8* %3, i64 8
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *f(char *);
main() {
  char *p = "";
  if (f(p) != p + 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <f@plt>
mov    -0x10(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
je     116b <main+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <f@plt>
lea    0xebd(%rip),%rcx
cmp    %rcx,%rax
jne    1150 <main+0x20>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @f(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = icmp ne i8* %4, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i8* @f(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 1, i64 0)
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double __ocml_tanh_f64(double);
double tanh(double x) { return __ocml_tanh_f64(x); }


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

x86 assembly (clang, -O2):
<tanh>:
jmp    1030 <__ocml_tanh_f64@plt>

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__ocml_tanh_f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double @__ocml_tanh_f64(double %0)
ret double %2
}
void spi_delay() {
  int i;
  for (i = 0; i < 0; i++) {
  }
}


x86 assembly (clang, -O0):
<spi_delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1128 <spi_delay+0x28>
jmp    111a <spi_delay+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <spi_delay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @spi_delay() {
ret void
}
int main(void) {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
wchar_t *wmemcpy(wchar_t *restrict s1, wchar_t const *restrict s2, size_t n) {
  wchar_t *i1 = s1;
  wchar_t const *i2 = s2;
  while (n--)
    *i1++ = *i2++;
  return s1;
}


x86 assembly (clang, -O0):
<wmemcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1160 <wmemcpy+0x60>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
jmp    1120 <wmemcpy+0x20>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmemcpy>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1125 <wmemcpy+0x15>
shl    $0x2,%rdx
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @wmemcpy(i32* noalias returned writeonly %0, i32* noalias nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %0 to i8*
%8 = shl nuw i64 %2, 2
br label %9
9: ; preds = %5, %3
ret i32* %0
}
int default_cmp(int *a, int *b) { return (*a > *b) ? 1 : ((*a < *b) ? -1 : 0); }


x86 assembly (clang, -O0):
<default_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    112b <default_cmp+0x2b>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <default_cmp+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @default_cmp(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = icmp slt i32 %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 0
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ 1, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @default_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Type definitions */
struct yenta_socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ o2micro_override(struct yenta_socket *);
void o2micro_restore_state(struct yenta_socket *socket) {
  o2micro_override(socket);
}


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

x86 assembly (clang, -O2):
<o2micro_restore_state>:
jmp    1030 <o2micro_override@plt>

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

LLVM IR (-O2):
%struct.yenta_socket = type { i32 }
define void @o2micro_restore_state(%struct.yenta_socket* %0) {
%2 = tail call i32 @o2micro_override(%struct.yenta_socket* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __aeabi_memcpy(void *dest, const void *src, size_t n) {
  memcpy(dest, src, n);
}


x86 assembly (clang, -O0):
<__aeabi_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):
<__aeabi_memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @__aeabi_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 i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @__aeabi_memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printFloat(float);
int main() {
  float f = 1.1;
  printFloat(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <printFloat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
call   1030 <printFloat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x3FF19999A0000000, float* %2
%3 = load float, float* %2
%4 = call i32 @printFloat(float %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printFloat(float 0x3FF19999A0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ display_args(int, char **);
int /*<<< orphan*/ printf(char *);
void foo_fnt(int argc, char **argv) {
  printf("foo command called\n");
  display_args(argc, argv);
}


x86 assembly (clang, -O0):
<foo_fnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <display_args@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_fnt>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <display_args@plt>

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

LLVM IR (-O2):
@str = [19 x i8] c"foo command called\00"
define void @foo_fnt(i32 %0, i8** %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @display_args(i32 %0, i8** %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void write_uint16(uint16_t i) {
  uint8_t le = i & 0x00FF;
  uint8_t be = i >> 8;
  fwrite(&le, sizeof(uint8_t), 1, stdout);
  fwrite(&be, sizeof(uint8_t), 1, stdout);
}


x86 assembly (clang, -O0):
<write_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%ecx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint16>:
push   %rbx
sub    $0x10,%rsp
movzbl %dil,%eax
mov    %eax,0xc(%rsp)
sar    $0x8,%edi
mov    %edi,0x8(%rsp)
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%ecx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
mov    (%rbx),%ecx
lea    0x8(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @write_uint16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
store i32 %8, i32* %4
%9 = load i32, i32* @stdout
%10 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32 %11)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @write_uint16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = and i32 %0, 255
store i32 %5, i32* %2
%6 = bitcast i32* %3 to i8*
%7 = ashr i32 %0, 8
store i32 %7, i32* %3
%8 = load i32, i32* @stdout
%9 = call i32 @fwrite(i32* %2, i32 4, i32 1, i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x48() {
  Assert_real((isbdigit(72) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              365, ("isbdigit should be 0 for H"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x16d,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x48>:
push   %rax
mov    $0x48,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x16d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for H\00"
define void @t_isbdigit_0x48() {
%1 = call i64 @isbdigit(i32 72)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for H\00"
define void @t_isbdigit_0x48() {
%1 = tail call i64 @isbdigit(i32 72)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void sme_state_changed(struct wpa_supplicant *wpa_s) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @sme_state_changed(%struct.wpa_supplicant* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
unsigned int strlen(char *);
void copy_string_to_buffer(char **target, char *source, void *buffer,
                           unsigned int *offset) {
  unsigned int length = strlen(source);
  *target = (char *)buffer + *offset;
  memcpy(*target, source, length + 1);
  *offset += length + 1;
}


x86 assembly (clang, -O0):
<copy_string_to_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string_to_buffer>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    (%r15),%edi
add    %r14,%rdi
mov    %rdi,(%r12)
add    $0x1,%ebp
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
add    %ebp,(%r15)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @copy_string_to_buffer(i8** %0, i8* %1, i8* %2, i32* %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %9
%12 = load i8*, i8** %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %13
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8**, i8*** %5
store i8* %16, i8** %17
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = load i8*, i8** %6
%21 = load i32, i32* %9
%22 = add i32 %21, 1
%23 = call i32 @memcpy(i8* %19, i8* %20, i32 %22)
%24 = load i32, i32* %9
%25 = add i32 %24, 1
%26 = load i32*, i32** %8
%27 = load i32, i32* %26
%28 = add i32 %27, %25
store i32 %28, i32* %26
ret void
}

LLVM IR (-O2):
define void @copy_string_to_buffer(i8** nocapture writeonly %0, i8* %1, i8* %2, i32* nocapture %3) {
%5 = tail call i32 @strlen(i8* %1)
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
store i8* %8, i8** %0
%9 = add i32 %5, 1
%10 = tail call i32 @memcpy(i8* %8, i8* %1, i32 %9)
%11 = load i32, i32* %3
%12 = add i32 %11, %9
store i32 %12, i32* %3
ret void
}
/* Variables and functions */
int mus_read_any_1(int, int, int, int, int **, int *, int /*<<< orphan*/ *);
int mus_file_read_any(int tfd, int beg, int chans, int nints, int **bufs,
                      int *cm) {
  return (mus_read_any_1(tfd, beg, chans, nints, bufs, cm, NULL));
}


x86 assembly (clang, -O0):
<mus_file_read_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %eax,%eax
movq   $0x0,(%rsp)
call   1030 <mus_read_any_1@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_file_read_any>:
push   %rax
movq   $0x0,(%rsp)
call   1030 <mus_read_any_1@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mus_file_read_any(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i32* %5) {
%7 = tail call i32 @mus_read_any_1(i32 %0, i32 %1, i32 %2, i32 %3, i32** %4, i32* %5, i32* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clientf(char *);
int /*<<< orphan*/ clientfr(char *);
void do_area_help(const char *arg) {
  clientfr("Module: IMapper. Area commands:");
  clientf(" area list   - List all areas.\r\n"
          " area check  - Check for problems in the current areas.\r\n"
          " area switch - Switch the area of the current room.\r\n"
          " area update - Update current area's name.\r\n"
          " area off    - Disable pathfinding in the current area.\r\n"
          " area orig   - Check the originality of the area.\r\n");
}


x86 assembly (clang, -O0):
<do_area_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <clientfr@plt>
lea    0xee1(%rip),%rdi
call   1030 <clientf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_area_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <clientfr@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <clientf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Module: IMapper. Area commands:\00"
@.str.1 = [295 x i8] c" area list - List all areas.\0D\0A area check - Check for problems in the current areas.\0D\0A area switch - Switch the area of the current room.\0D\0A area update - Update current area's name.\0D\0A area off - Disable pathfinding in the current area.\0D\0A area orig - Check the originality of the area.\0D\0A\00"
define void @do_area_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @clientfr(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @clientf(i8* getelementptr inbounds ([295 x i8], [295 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Module: IMapper. Area commands:\00"
@.str.1 = [295 x i8] c" area list - List all areas.\0D\0A area check - Check for problems in the current areas.\0D\0A area switch - Switch the area of the current room.\0D\0A area update - Update current area's name.\0D\0A area off - Disable pathfinding in the current area.\0D\0A area orig - Check the originality of the area.\0D\0A\00"
define void @do_area_help(i8* nocapture readnone %0) {
%2 = tail call i32 @clientfr(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @clientf(i8* getelementptr inbounds ([295 x i8], [295 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int append_line(char *, char *);
int add_to_history(char *word, char *history_file) {
  int errnum = append_line(word, history_file);
  return errnum;
}


x86 assembly (clang, -O0):
<add_to_history>:
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 <append_line@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_to_history>:
jmp    1030 <append_line@plt>

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

LLVM IR (-O2):
define i32 @add_to_history(i8* %0, i8* %1) {
%3 = tail call i32 @append_line(i8* %0, i8* %1)
ret i32 %3
}
void never_reset_module_internal_pins(void) {}


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

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

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

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

/* Variables and functions */
int isspace(int /*<<< orphan*/);
int iswspace(wint_t wc) { return isspace(wc); }


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

x86 assembly (clang, -O2):
<iswspace>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @iswspace(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
ret i32 %2
}
char *ckcvtdate(p, t)
char *p;
int t;
{
  char *s;
  if (!(s = cmcvtdate(p, t)))
    return ("<BAD_DATE_OR_TIME>");
  else
    return (s);
}


x86 assembly (clang, -O0):
<ckcvtdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x0,%al
call   1030 <cmcvtdate@plt>
cltq
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    114d <ckcvtdate+0x3d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <ckcvtdate+0x45>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckcvtdate>:
push   %rax
xor    %eax,%eax
call   1030 <cmcvtdate@plt>
test   %eax,%eax
movslq %eax,%rcx
lea    0xedc(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"<BAD_DATE_OR_TIME>\00"
define i8* @ckcvtdate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @cmcvtdate to i32 (i8*, i32, ...)*)(i8* %7, i32 %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %2
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %3
br label %16
14: ; preds = %2
%15 = load i8*, i8** %6
store i8* %15, i8** %3
br label %16
16: ; preds = %14, %13
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [19 x i8] c"<BAD_DATE_OR_TIME>\00"
define i8* @ckcvtdate(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @cmcvtdate to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
%4 = icmp eq i32 %3, 0
%5 = sext i32 %3 to i64
%6 = inttoptr i64 %5 to i8*
%7 = select i1 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
void on_state_switch(union ui_state *state) {}


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

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

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

LLVM IR (-O2):
%union.ui_state = type opaque
define void @on_state_switch(%union.ui_state* nocapture %0) {
ret void
}
void gtk_expander_get_label_widget() {}


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

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

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

LLVM IR (-O2):
define void @gtk_expander_get_label_widget() {
ret void
}
/* Variables and functions */
void foo_defined_in_subtarget1() {
  int *s = NULL;
  *s = 42;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo_defined_in_subtarget1() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 42, i32* %2
ret void
}

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

LLVM IR (-O2):
@str = [14 x i8] c"Haaaalllloooo\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ puts(char *);
float lettura_file(FILE *dati) {
  float consumi;
  int indice_array;
  if (dati == NULL) {
    puts("Attenzione puntatore a file nullo!");
  } else {
    fscanf(dati, "%f", &consumi);
  }
  return (consumi);
}


x86 assembly (clang, -O0):
<lettura_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <lettura_file+0x28>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
jmp    115c <lettura_file+0x3c>
mov    -0x8(%rbp),%rdi
lea    0xed0(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lettura_file>:
push   %rax
test   %rdi,%rdi
je     113f <lettura_file+0x1f>
lea    0xef6(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <fscanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Attenzione puntatore a file nullo!\00"
@.str.1 = [3 x i8] c"%f\00"
define float @lettura_file(i32* %0) {
%2 = alloca i32*
%3 = alloca float
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
br label %12
12: ; preds = %9, %7
%13 = load float, float* %3
ret float %13
}

LLVM IR (-O2):
@.str = [35 x i8] c"Attenzione puntatore a file nullo!\00"
@.str.1 = [3 x i8] c"%f\00"
define float @lettura_file(i32* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = icmp eq i32* %0, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = load float, float* %2
br label %10
10: ; preds = %7, %5
%11 = phi float [ %9, %7 ], [ undef, %5 ]
ret float %11
}
/* Type definitions */
struct cm_object_interface {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct cm_object_interface *);
void cm_object_interface_destroy(struct cm_object_interface *object_interface) {
  free(object_interface);
}


x86 assembly (clang, -O0):
<cm_object_interface_destroy>:
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):
<cm_object_interface_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.cm_object_interface = type { i32 }
define void @cm_object_interface_destroy(%struct.cm_object_interface* nocapture %0) {
%2 = tail call i32 @free(%struct.cm_object_interface* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usb_board_connect();
void usb_connect(void) { usb_board_connect(); }


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

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

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

LLVM IR (-O2):
define void @usb_connect() {
%1 = tail call i32 (...) @usb_board_connect()
ret void
}
int do_021() { return 21; }


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

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

LLVM IR (-O0):
define i32 @do_021() {
ret i32 21
}

LLVM IR (-O2):
define i32 @do_021() {
ret i32 21
}
/* Variables and functions */
int /*<<< orphan*/ append_channel_flags(char *, unsigned short);
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
void irc_channel_set(char *channel, unsigned short int flags) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), "%s %s +", "MODE", channel);
  append_channel_flags(msg, flags);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_channel_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    $0x1fd,%esi
lea    0xea3(%rip),%rdx
lea    0xea4(%rip),%rcx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
movzwl -0xa(%rbp),%esi
call   1050 <append_channel_flags@plt>
lea    -0x210(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_channel_set>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %esi,%ebp
mov    %rdi,%r8
lea    0xebb(%rip),%rdx
lea    0xebc(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <append_channel_flags@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%s %s +\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_channel_set(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca [509 x i8]
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @snprintf(i8* %6, i32 509, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%10 = load i16, i16* %4
%11 = call i32 @append_channel_flags(i8* %9, i16 zeroext %10)
%12 = getelementptr inbounds [509 x i8], [509 x i8]* %5, i64 0, i64 0
%13 = call i32 @net_send(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s %s +\00"
@.str.1 = [5 x i8] c"MODE\00"
define void @irc_channel_set(i8* %0, i16 zeroext %1) {
%3 = alloca [509 x i8]
%4 = getelementptr inbounds [509 x i8], [509 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 509, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = call i32 @append_channel_flags(i8* %4, i16 zeroext %1)
%7 = call i32 @net_send(i8* %4)
ret void
}
void *rt_allocate_reqbuf(signed int count) { return ((void *)0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @rt_allocate_reqbuf(i32 %0) {
ret i8* null
}
int invalidate_partition(struct gendisk *x, int y) {
  int a;
  return a;
}


x86 assembly (clang, -O0):
<invalidate_partition>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.gendisk = type opaque
define i32 @invalidate_partition(%struct.gendisk* %0, i32 %1) {
%3 = alloca %struct.gendisk*
%4 = alloca i32
%5 = alloca i32
store %struct.gendisk* %0, %struct.gendisk** %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.gendisk = type opaque
define i32 @invalidate_partition(%struct.gendisk* nocapture readnone %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ doit(int, int, char *);
int main(void) {
  doit(1, 1, "\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%esi
lea    0xed5(%rip),%rdx
mov    %esi,%edi
call   1030 <doit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @doit(i32 1, i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void MJC_putc_char(char c) { printf("%c", c); }


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

x86 assembly (clang, -O2):
<MJC_putc_char>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @MJC_putc_char(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
void ap_char(i) int i;
{
  char buf[2];
  char c = (char)i;
  buf[0] = c;
  buf[1] = '\0';
  ap_str(buf);
}


x86 assembly (clang, -O0):
<ap_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x6(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0x6(%rbp),%rdi
mov    $0x0,%al
call   1030 <ap_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_char>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
xor    %eax,%eax
call   1030 <ap_str@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @ap_char(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
%4 = alloca i8
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %7, i8* %8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %9
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @ap_str to i32 (i8*, ...)*)(i8* %10)
ret void
}

LLVM IR (-O2):
define void @ap_char(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ap_str to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M207_f(char *s) {
  debug("M207_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M207_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M207_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M207_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M207_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M207_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M207_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}