void GoLGrid_print_life_history_symbol(char symbol, int count,
                                       int *line_length) {
  if (!line_length)
    return (void)ffsc(__func__);
  if (count == 0)
    return;
  else if (count == 1) {
    printf("%c", symbol);
    (*line_length)++;
  } else if (count > 1) {
    printf("%d%c", count, symbol);
    (*line_length) += (1 + digits_in_number(count));
  }
  if (*line_length > 68) {
    printf("\n");
    (*line_length) = 0;
  }
}


x86 assembly (clang, -O0):
<GoLGrid_print_life_history_symbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <GoLGrid_print_life_history_symbol+0x33>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1050 <ffsc@plt>
jmp    1203 <GoLGrid_print_life_history_symbol+0xd3>
cmpl   $0x0,-0x8(%rbp)
jne    1172 <GoLGrid_print_life_history_symbol+0x42>
jmp    1203 <GoLGrid_print_life_history_symbol+0xd3>
cmpl   $0x1,-0x8(%rbp)
jne    119e <GoLGrid_print_life_history_symbol+0x6e>
movsbl -0x1(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    11d9 <GoLGrid_print_life_history_symbol+0xa9>
cmpl   $0x1,-0x8(%rbp)
jle    11d4 <GoLGrid_print_life_history_symbol+0xa4>
mov    -0x8(%rbp),%esi
movsbl -0x1(%rbp),%edx
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <digits_in_number@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
jmp    11d9 <GoLGrid_print_life_history_symbol+0xa9>
jmp    11de <GoLGrid_print_life_history_symbol+0xae>
mov    -0x10(%rbp),%rax
cmpl   $0x44,(%rax)
jle    1203 <GoLGrid_print_life_history_symbol+0xd3>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GoLGrid_print_life_history_symbol>:
test   %rdx,%rdx
je     1166 <GoLGrid_print_life_history_symbol+0x26>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
test   %esi,%esi
je     11b1 <GoLGrid_print_life_history_symbol+0x71>
mov    %rdx,%rbx
cmp    $0x1,%ebp
jne    1174 <GoLGrid_print_life_history_symbol+0x34>
movsbl %dil,%edi
call   1030 <putchar@plt>
mov    (%rbx),%eax
add    $0x1,%eax
jmp    119a <GoLGrid_print_life_history_symbol+0x5a>
lea    0xe93(%rip),%rdi
xor    %eax,%eax
jmp    1060 <ffsc@plt>
jle    11b8 <GoLGrid_print_life_history_symbol+0x78>
movsbl %dil,%edx
lea    0xea1(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1050 <digits_in_number@plt>
mov    (%rbx),%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,(%rbx)
cmp    $0x45,%eax
jl     11b1 <GoLGrid_print_life_history_symbol+0x71>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    (%rbx),%eax
cmp    $0x45,%eax
jl     11b1 <GoLGrid_print_life_history_symbol+0x71>
jmp    11a1 <GoLGrid_print_life_history_symbol+0x61>

LLVM IR (-O0):
@__func__.GoLGrid_print_life_history_symbol = [34 x i8] c"GoLGrid_print_life_history_symbol\00"
@.str = [3 x i8] c"%c\00"
@.str.1 = [5 x i8] c"%d%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @GoLGrid_print_life_history_symbol(i8 signext %0, i32 %1, i32* %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32*
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = icmp ne i32* %7, null
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @ffsc to i32 (i8*, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.GoLGrid_print_life_history_symbol, i64 0, i64 0))
br label %48
11: ; preds = %3
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
br label %48
15: ; preds = %11
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i8, i8* %4
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
store i32 %24, i32* %22
br label %40
25: ; preds = %15
%26 = load i32, i32* %5
%27 = icmp sgt i32 %26, 1
br i1 %27, label %28, label %39
28: ; preds = %25
%29 = load i32, i32* %5
%30 = load i8, i8* %4
%31 = sext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %31)
%33 = load i32, i32* %5
%34 = call i32 (i32, ...) bitcast (i32 (...)* @digits_in_number to i32 (i32, ...)*)(i32 %33)
%35 = add nsw i32 1, %34
%36 = load i32*, i32** %6
%37 = load i32, i32* %36
%38 = add nsw i32 %37, %35
store i32 %38, i32* %36
br label %39
39: ; preds = %28, %25
br label %40
40: ; preds = %39, %18
br label %41
41: ; preds = %40
%42 = load i32*, i32** %6
%43 = load i32, i32* %42
%44 = icmp sgt i32 %43, 68
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%47 = load i32*, i32** %6
store i32 0, i32* %47
br label %48
48: ; preds = %9, %14, %45, %41
ret void
}

LLVM IR (-O2):
@__func__.GoLGrid_print_life_history_symbol = [34 x i8] c"GoLGrid_print_life_history_symbol\00"
@.str.1 = [5 x i8] c"%d%c\00"
define void @GoLGrid_print_life_history_symbol(i8 signext %0, i32 %1, i32* %2) {
%4 = icmp eq i32* %2, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ffsc to i32 (i8*, ...)*)(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @__func__.GoLGrid_print_life_history_symbol, i64 0, i64 0))
br label %29
7: ; preds = %3
switch i32 %1, label %13 [
i32 0, label %29
i32 1, label %8
]
8: ; preds = %7
%9 = sext i8 %0 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %24
13: ; preds = %7
%14 = icmp sgt i32 %1, 1
br i1 %14, label %15, label %22
15: ; preds = %13
%16 = sext i8 %0 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %16)
%18 = tail call i32 (i32, ...) bitcast (i32 (...)* @digits_in_number to i32 (i32, ...)*)(i32 %1)
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %2
%21 = add nsw i32 %19, %20
store i32 %21, i32* %2
br label %24
22: ; preds = %13
%23 = load i32, i32* %2
br label %24
24: ; preds = %22, %8, %15
%25 = phi i32 [ %23, %22 ], [ %12, %8 ], [ %21, %15 ]
%26 = icmp sgt i32 %25, 68
br i1 %26, label %27, label %29
27: ; preds = %24
%28 = tail call i32 @putchar(i32 10)
store i32 0, i32* %2
br label %29
29: ; preds = %7, %5, %27, %24
ret void
}