#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*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char *format = "%s, %s, %s, %s\n";
  char *s1 = "this is %d d\n";
  char *s2 = "this is %s sentense.\n";
  char *s3 = "this is sentense won't construe!\n";
  char *s4 = "ok! you are right!\n";
  char *nesting = "shit! %s %d %d, Look this!%d %s\n";
  printf(format, s1, s2, s3, s4);
  printf(s1);
  printf(s2);
  printf(s3);
  printf(s4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xee6(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xefd(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xf06(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0xede(%rip),%rbx
lea    0xee5(%rip),%r14
lea    0xef4(%rip),%rcx
lea    0xf0f(%rip),%r8
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%s, %s, %s, %s\0A\00"
@.str.1 = [14 x i8] c"this is %d d\0A\00"
@.str.2 = [22 x i8] c"this is %s sentense.\0A\00"
@.str.3 = [34 x i8] c"this is sentense won't construe!\0A\00"
@.str.4 = [20 x i8] c"ok! you are right!\0A\00"
@.str.5 = [33 x i8] c"shit! %s %d %d, Look this!%d %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8** %11
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = call i32 (i8*, ...) @printf(i8* %12, i8* %13, i8* %14, i8* %15, i8* %16)
%18 = load i8*, i8** %7
%19 = call i32 (i8*, ...) @printf(i8* %18)
%20 = load i8*, i8** %8
%21 = call i32 (i8*, ...) @printf(i8* %20)
%22 = load i8*, i8** %9
%23 = call i32 (i8*, ...) @printf(i8* %22)
%24 = load i8*, i8** %10
%25 = call i32 (i8*, ...) @printf(i8* %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s, %s, %s, %s\0A\00"
@.str.1 = [14 x i8] c"this is %d d\0A\00"
@.str.2 = [22 x i8] c"this is %s sentense.\0A\00"
@.str.3 = [34 x i8] c"this is sentense won't construe!\0A\00"
@.str.4 = [20 x i8] c"ok! you are right!\0A\00"
@str = [33 x i8] c"this is sentense won't construe!\00"
@str.6 = [19 x i8] c"ok! you are right!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}