#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*/ minprintf(char *, char *, int, int, int, unsigned int, char,
                             double, double, double, void *);
int main(void) {
  minprintf(
      "This has to %.12s:\n                \tsome decimal number: %5d,\n       "
      "         \tan octal: %-5o,\n                \ta hexadecimal: %X,\n      "
      "          \tunsigned decimal: %u,\n                \tsome char: %c,\n   "
      "             \ta double: %f,\n                \tanother double (with "
      "exp): %e,\n                \tone more double: %g,\n                \ta "
      "pointer: %p,\n                \tsomething unknown: %123k,\n             "
      "   \tsomething long and malformed: %12.3.45678912_34567890i,\n          "
      "      \tand a simple %%.\n",
      "pretty printtt", (int)81, (int)81, (int)81, (unsigned)81, (char)81,
      (double)81, (double)81, (double)81, (void *)81);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    0x10d1(%rip),%rsi
mov    $0x51,%r9d
movsd  0xec5(%rip),%xmm2
mov    $0x51,%eax
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x51,(%rsp)
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
mov    %rax,0x8(%rsp)
call   1030 <minprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
lea    0x10df(%rip),%rsi
movsd  0xed9(%rip),%xmm0
mov    $0x51,%edx
mov    $0x51,%ecx
mov    $0x51,%r8d
mov    $0x51,%r9d
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
push   $0x51
push   $0x51
call   1030 <minprintf@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [502 x i8] c"This has to %.12s:\0A \09some decimal number: %5d,\0A \09an octal: %-5o,\0A \09a hexadecimal: %X,\0A \09unsigned decimal: %u,\0A \09some char: %c,\0A \09a double: %f,\0A \09another double (with exp): %e,\0A \09one more double: %g,\0A \09a pointer: %p,\0A \09something unknown: %123k,\0A \09something long and malformed: %12.3.45678912_34567890i,\0A \09and a simple %%.\0A\00"
@.str.1 = [15 x i8] c"pretty printtt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @minprintf(i8* getelementptr inbounds ([502 x i8], [502 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 81, i32 81, i32 81, i32 81, i8 signext 81, double 8.100000e+01, double 8.100000e+01, double 8.100000e+01, i8* inttoptr (i64 81 to i8*))
ret i32 0
}

LLVM IR (-O2):
@.str = [502 x i8] c"This has to %.12s:\0A \09some decimal number: %5d,\0A \09an octal: %-5o,\0A \09a hexadecimal: %X,\0A \09unsigned decimal: %u,\0A \09some char: %c,\0A \09a double: %f,\0A \09another double (with exp): %e,\0A \09one more double: %g,\0A \09a pointer: %p,\0A \09something unknown: %123k,\0A \09something long and malformed: %12.3.45678912_34567890i,\0A \09and a simple %%.\0A\00"
@.str.1 = [15 x i8] c"pretty printtt\00"
define i32 @main() {
%1 = tail call i32 @minprintf(i8* getelementptr inbounds ([502 x i8], [502 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 81, i32 81, i32 81, i32 81, i8 signext 81, double 8.100000e+01, double 8.100000e+01, double 8.100000e+01, i8* inttoptr (i64 81 to i8*))
ret i32 0
}