#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 /*<<< orphan*/ sprintf(char *, char *, int, char *);
int /*<<< orphan*/ sscanf(char *, char *, char **, char **, int *, char **,
                          char **);
main() {
  char outline[50];
  char one[7], two[7], four[7], five[7];
  int three;
  sprintf(outline, "this is %d times %s \n", 10, "charlie");
  printf("%s", outline);
  sscanf(outline, "%s %s %d %s %s", &one, &two, &three, &four, &five);
  printf("%s", one);
  printf("%s", two);
  printf("%d", three);
  printf("%s", four);
  printf("%s", five);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0xa,%edx
lea    0xec7(%rip),%rcx
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x47(%rbp),%rdx
lea    -0x4e(%rbp),%rcx
lea    -0x55(%rbp),%r9
lea    -0x5c(%rbp),%rax
lea    0xe9d(%rip),%rsi
lea    -0x60(%rbp),%r8
mov    %rax,(%rsp)
call   1040 <sscanf@plt>
lea    -0x47(%rbp),%rsi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x4e(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x60(%rbp),%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x55(%rbp),%rsi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x5c(%rbp),%rsi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xebb(%rip),%rsi
lea    0xeca(%rip),%rcx
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%edx
call   1050 <sprintf@plt>
lea    0xec5(%rip),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%r14
mov    %r14,(%rsp)
lea    0xe9c(%rip),%rsi
lea    0x29(%rsp),%r13
lea    0x22(%rsp),%rbp
lea    0x10(%rsp),%r8
lea    0x1b(%rsp),%r15
mov    %rbx,%rdi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r15,%r9
call   1040 <sscanf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xe61(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"this is %d times %s \0A\00"
@.str.1 = [8 x i8] c"charlie\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [15 x i8] c"%s %s %d %s %s\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [7 x i8]
%3 = alloca [7 x i8]
%4 = alloca [7 x i8]
%5 = alloca [7 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%12 = bitcast [7 x i8]* %2 to i8**
%13 = bitcast [7 x i8]* %3 to i8**
%14 = bitcast [7 x i8]* %4 to i8**
%15 = bitcast [7 x i8]* %5 to i8**
%16 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %12, i8** %13, i32* %6, i8** %14, i8** %15)
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = load i32, i32* %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"this is %d times %s \0A\00"
@.str.1 = [8 x i8] c"charlie\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [15 x i8] c"%s %s %d %s %s\00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [7 x i8]
%3 = alloca [7 x i8]
%4 = alloca [7 x i8]
%5 = alloca [7 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%12 = bitcast i32* %6 to i8*
%13 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%15 = bitcast [7 x i8]* %2 to i8**
%16 = bitcast [7 x i8]* %3 to i8**
%17 = bitcast [7 x i8]* %4 to i8**
%18 = bitcast [7 x i8]* %5 to i8**
%19 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** %15, i8** %16, i32* %6, i8** %17, i8** %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}