#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ delayPrint(unsigned int, char *, ...);
int main(void) {
  char *strExample = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
                     " Ut et fermentum mi, et mattis libero. Nam egestas nibh "
                     "dolor, id blandit odio imperdiet nec. In sit amet augue "
                     "ut dolor pellentesque mattis at et augue. Quisque eleife"
                     "nd quam lacus, in scelerisque purus imperdiet ut. Mauris"
                     " consectetur accumsan neque eget porttitor. Donec et neq"
                     "ue orci. Fusce vel adipiscing enim, non placerat libero."
                     " Pellentesque aliquet libero magna, vitae ornare felis a"
                     "uctor at. Duis tempus bibendum purus, id eleifend nunc b";
  unsigned int delay = 10000;
  delayPrint(delay, strExample);
  delayPrint(delay,
             "\nThis is going to test how well %son of this works here I will "
             "insert numbers: %i, %i, %i",
             "the variatic functi", 100, 10000, 20000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x2710,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <delayPrint@plt>
mov    -0x14(%rbp),%edi
lea    0x10b0(%rip),%rsi
lea    0x1103(%rip),%rdx
mov    $0x64,%ecx
mov    $0x2710,%r8d
mov    $0x4e20,%r9d
mov    $0x0,%al
call   1030 <delayPrint@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x2710,%edi
xor    %eax,%eax
call   1030 <delayPrint@plt>
lea    0x10ce(%rip),%rsi
lea    0x1121(%rip),%rdx
mov    $0x2710,%edi
mov    $0x64,%ecx
mov    $0x2710,%r8d
mov    $0x4e20,%r9d
xor    %eax,%eax
call   1030 <delayPrint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [505 x i8] c"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et fermentum mi, et mattis libero. Nam egestas nibh dolor, id blandit odio imperdiet nec. In sit amet augue ut dolor pellentesque mattis at et augue. Quisque eleifend quam lacus, in scelerisque purus imperdiet ut. Mauris consectetur accumsan neque eget porttitor. Donec et neque orci. Fusce vel adipiscing enim, non placerat libero. Pellentesque aliquet libero magna, vitae ornare felis auctor at. Duis tempus bibendum purus, id eleifend nunc b\00"
@.str.1 = [90 x i8] c"\0AThis is going to test how well %son of this works here I will insert numbers: %i, %i, %i\00"
@.str.2 = [20 x i8] c"the variatic functi\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 10000, i32* %3
%4 = load i32, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 (i32, i8*, ...) @delayPrint(i32 %4, i8* %5)
%7 = load i32, i32* %3
%8 = call i32 (i32, i8*, ...) @delayPrint(i32 %7, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 10000, i32 20000)
ret i32 0
}

LLVM IR (-O2):
@.str = [505 x i8] c"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut et fermentum mi, et mattis libero. Nam egestas nibh dolor, id blandit odio imperdiet nec. In sit amet augue ut dolor pellentesque mattis at et augue. Quisque eleifend quam lacus, in scelerisque purus imperdiet ut. Mauris consectetur accumsan neque eget porttitor. Donec et neque orci. Fusce vel adipiscing enim, non placerat libero. Pellentesque aliquet libero magna, vitae ornare felis auctor at. Duis tempus bibendum purus, id eleifend nunc b\00"
@.str.1 = [90 x i8] c"\0AThis is going to test how well %son of this works here I will insert numbers: %i, %i, %i\00"
@.str.2 = [20 x i8] c"the variatic functi\00"
define i32 @main() {
%1 = tail call i32 (i32, i8*, ...) @delayPrint(i32 10000, i8* getelementptr inbounds ([505 x i8], [505 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i32, i8*, ...) @delayPrint(i32 10000, i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 100, i32 10000, i32 20000)
ret i32 0
}