#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 *, char, char, char);
void print_grade(char b[9]) {
  printf("|%c|%c|%c|\n", b[0], b[1], b[2]);
  printf("|%c|%c|%c|\n", b[3], b[4], b[5]);
  printf("|%c|%c|%c|\n", b[6], b[7], b[8]);
}


x86 assembly (clang, -O0):
<print_grade>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xecc(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl 0x2(%rax),%ecx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xea4(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl 0x5(%rax),%ecx
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x6(%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x7(%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xe7c(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl 0x8(%rax),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_grade>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%esi
movsbl 0x1(%rdi),%edx
movsbl 0x2(%rdi),%ecx
lea    0xed7(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x3(%rbx),%esi
movsbl 0x4(%rbx),%edx
movsbl 0x5(%rbx),%ecx
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl 0x6(%rbx),%esi
movsbl 0x7(%rbx),%edx
movsbl 0x8(%rbx),%ecx
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"|%c|%c|%c|\0A\00"
define void @print_grade(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %4, i8 signext %6)
%8 = getelementptr inbounds i8, i8* %0, i64 3
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 5
%13 = load i8, i8* %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %9, i8 signext %11, i8 signext %13)
%15 = getelementptr inbounds i8, i8* %0, i64 6
%16 = load i8, i8* %15
%17 = getelementptr inbounds i8, i8* %0, i64 7
%18 = load i8, i8* %17
%19 = getelementptr inbounds i8, i8* %0, i64 8
%20 = load i8, i8* %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %16, i8 signext %18, i8 signext %20)
ret void
}