#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*/ miniprintf(char *, ...);
int main(int argc, char **argv) {
  miniprintf("test case 1: d and int: %d\n", 1234);
  miniprintf("test case 2: h and short: %h\n", 1234);
  miniprintf("test case 3: c and char: %c\n", 'a');
  miniprintf("test case 4: o and int: %o\n", 1234);
  miniprintf("test caes 5: x and int: 0x%x\n", 1234);
  miniprintf("test case 55: g and double: %g\n", 1234.03);
  miniprintf("test case 6: s and str: %s\n", "girl and sex");
  miniprintf("test case 7: all %d %h %c %o %x %s\n", 1234, 1234, 'a', 1234,
             1234, "over");
  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)
lea    0xedb(%rip),%rdi
mov    $0x4d2,%esi
mov    $0x0,%al
call   1030 <miniprintf@plt>
lea    0xee4(%rip),%rdi
mov    $0x4d2,%esi
mov    $0x0,%al
call   1030 <miniprintf@plt>
lea    0xeef(%rip),%rdi
mov    $0x61,%esi
mov    $0x0,%al
call   1030 <miniprintf@plt>
lea    0xef9(%rip),%rdi
mov    $0x4d2,%esi
mov    $0x0,%al
call   1030 <miniprintf@plt>
lea    0xf02(%rip),%rdi
mov    $0x4d2,%esi
mov    $0x0,%al
call   1030 <miniprintf@plt>
lea    0xf0d(%rip),%rdi
movsd  0xe6c(%rip),%xmm0
mov    $0x1,%al
call   1030 <miniprintf@plt>
lea    0xf17(%rip),%rdi
lea    0xf2c(%rip),%rsi
mov    $0x0,%al
call   1030 <miniprintf@plt>
lea    0xf2b(%rip),%rdi
mov    $0x4d2,%r9d
mov    $0x61,%ecx
lea    0xf3d(%rip),%rax
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%r8d
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <miniprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
mov    $0x4d2,%esi
xor    %eax,%eax
call   1030 <miniprintf@plt>
lea    0xef9(%rip),%rdi
mov    $0x4d2,%esi
xor    %eax,%eax
call   1030 <miniprintf@plt>
lea    0xf04(%rip),%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1030 <miniprintf@plt>
lea    0xf0e(%rip),%rdi
mov    $0x4d2,%esi
xor    %eax,%eax
call   1030 <miniprintf@plt>
lea    0xf17(%rip),%rdi
mov    $0x4d2,%esi
xor    %eax,%eax
call   1030 <miniprintf@plt>
lea    0xf22(%rip),%rdi
movsd  0xe81(%rip),%xmm0
mov    $0x1,%al
call   1030 <miniprintf@plt>
lea    0xf2c(%rip),%rdi
lea    0xf41(%rip),%rsi
xor    %eax,%eax
call   1030 <miniprintf@plt>
lea    0xf64(%rip),%rax
mov    %rax,(%rsp)
lea    0xf35(%rip),%rdi
mov    $0x4d2,%esi
mov    $0x4d2,%edx
mov    $0x61,%ecx
mov    $0x4d2,%r8d
mov    $0x4d2,%r9d
xor    %eax,%eax
call   1030 <miniprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"test case 1: d and int: %d\0A\00"
@.str.1 = [30 x i8] c"test case 2: h and short: %h\0A\00"
@.str.2 = [29 x i8] c"test case 3: c and char: %c\0A\00"
@.str.3 = [28 x i8] c"test case 4: o and int: %o\0A\00"
@.str.4 = [30 x i8] c"test caes 5: x and int: 0x%x\0A\00"
@.str.5 = [32 x i8] c"test case 55: g and double: %g\0A\00"
@.str.6 = [28 x i8] c"test case 6: s and str: %s\0A\00"
@.str.7 = [13 x i8] c"girl and sex\00"
@.str.8 = [36 x i8] c"test case 7: all %d %h %c %o %x %s\0A\00"
@.str.9 = [5 x i8] c"over\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 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1234)
%7 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 1234)
%8 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 97)
%9 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1234)
%10 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 1234)
%11 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double 1.234030e+03)
%12 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 1234, i32 1234, i32 97, i32 1234, i32 1234, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"test case 1: d and int: %d\0A\00"
@.str.1 = [30 x i8] c"test case 2: h and short: %h\0A\00"
@.str.2 = [29 x i8] c"test case 3: c and char: %c\0A\00"
@.str.3 = [28 x i8] c"test case 4: o and int: %o\0A\00"
@.str.4 = [30 x i8] c"test caes 5: x and int: 0x%x\0A\00"
@.str.5 = [32 x i8] c"test case 55: g and double: %g\0A\00"
@.str.6 = [28 x i8] c"test case 6: s and str: %s\0A\00"
@.str.7 = [13 x i8] c"girl and sex\00"
@.str.8 = [36 x i8] c"test case 7: all %d %h %c %o %x %s\0A\00"
@.str.9 = [5 x i8] c"over\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 1234)
%4 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 1234)
%5 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 97)
%6 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 1234)
%7 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 1234)
%8 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), double 1.234030e+03)
%9 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @miniprintf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 1234, i32 1234, i32 97, i32 1234, i32 1234, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
ret i32 0
}