#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 */
typedef int *charmat;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_some_vals(char *charmat) {
  (void)printf("row 1, shall be \'d\': %c\n", (*((charmat) + ((0) * 7) + (3))));
  (void)printf("row 2, shall be \'l\': %c\n", (*((charmat) + ((1) * 7) + (4))));
  (void)printf("row 3, shall be \'t\': %c\n", (*((charmat) + ((2) * 7) + (5))));
  (void)printf("row 4, shall be \'1\': %c\n", (*((charmat) + ((3) * 7) + (6))));
  (void)printf("row 5, shall be \'2\': %c\n", (*((charmat) + ((4) * 7) + (0))));
}


x86 assembly (clang, -O0):
<print_some_vals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl 0xb(%rax),%esi
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl 0x13(%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl 0x1b(%rax),%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl 0x1c(%rax),%esi
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_some_vals>:
push   %rbx
mov    %rdi,%rbx
movsbl 0x3(%rdi),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movsbl 0xb(%rbx),%esi
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
movsbl 0x13(%rbx),%esi
lea    0xef3(%rip),%rdi
call   1030 <printf@plt>
movsbl 0x1b(%rbx),%esi
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
movsbl 0x1c(%rbx),%esi
lea    0xf05(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"row 1, shall be 'd': %c\0A\00"
@.str.1 = [25 x i8] c"row 2, shall be 'l': %c\0A\00"
@.str.2 = [25 x i8] c"row 3, shall be 't': %c\0A\00"
@.str.3 = [25 x i8] c"row 4, shall be '1': %c\0A\00"
@.str.4 = [25 x i8] c"row 5, shall be '2': %c\0A\00"
define void @print_some_vals(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 7
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 14
%17 = getelementptr inbounds i8, i8* %16, i64 5
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 21
%23 = getelementptr inbounds i8, i8* %22, i64 6
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 28
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %31)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"row 1, shall be 'd': %c\0A\00"
@.str.1 = [25 x i8] c"row 2, shall be 'l': %c\0A\00"
@.str.2 = [25 x i8] c"row 3, shall be 't': %c\0A\00"
@.str.3 = [25 x i8] c"row 4, shall be '1': %c\0A\00"
@.str.4 = [25 x i8] c"row 5, shall be '2': %c\0A\00"
define void @print_some_vals(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 11
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i8, i8* %0, i64 19
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds i8, i8* %0, i64 27
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds i8, i8* %0, i64 28
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %20)
ret void
}