#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 f2(char *, char *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main4() {
  char matricola[7] = "123456";
  int cont = 0, val = 0;
  printf("%s - ", matricola);
  val = f2(matricola, matricola + 5, &cont);
  printf(" - %d - %d", cont, val);
  return 0;
}


x86 assembly (clang, -O0):
<main4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0x7(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x7(%rbp),%rdi
lea    -0x7(%rbp),%rsi
add    $0x5,%rsi
lea    -0xc(%rbp),%rdx
call   1030 <f2@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main4>:
push   %rbx
sub    $0x10,%rsp
movl   $0x363534,0xb(%rsp)
movl   $0x34333231,0x8(%rsp)
34
movl   $0x0,0x4(%rsp)
lea    0xec3(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1030 <f2@plt>
mov    0x4(%rsp),%esi
lea    0xe9d(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main4.matricola = [7 x i8] c"123456\00"
@.str = [6 x i8] c"%s - \00"
@.str.1 = [11 x i8] c" - %d - %d\00"
define i32 @main4() {
%1 = alloca [7 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [7 x i8]* %1 to i8*
store i32 0, i32* %2
store i32 0, i32* %3
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds i8, i8* %8, i64 5
%10 = call i32 @f2(i8* %7, i8* %9, i32* %2)
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main4.matricola = [7 x i8] c"123456\00"
@.str = [6 x i8] c"%s - \00"
@.str.1 = [11 x i8] c" - %d - %d\00"
define i32 @main4() {
%1 = alloca [7 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 5
%7 = call i32 @f2(i8* %3, i8* %6, i32* %2)
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %7)
ret i32 0
}