#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int display_this_line(uint8_t address, uint8_t cmd, uint8_t block_length,
                      uint8_t *block) {
  printf("(%d, %d, [", address, cmd);
  for (int i = 0; i < block_length; i++) {
    if (i > 0) {
      printf(", ");
    }
    printf("%d", block[i]);
  }
  printf("])\n");
  return (0);
}


x86 assembly (clang, -O0):
<display_this_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118b <display_this_line+0x7b>
cmpl   $0x0,-0x1c(%rbp)
jle    1164 <display_this_line+0x54>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1140 <display_this_line+0x30>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_this_line>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r12
mov    %edx,%ebp
mov    %esi,%edx
mov    %edi,%esi
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    1191 <display_this_line+0x71>
mov    (%r12),%esi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
je     1191 <display_this_line+0x71>
mov    %ebp,%ebp
mov    $0x1,%ebx
lea    0xea3(%rip),%r14
lea    0xe9f(%rip),%r15
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r12,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1170 <display_this_line+0x50>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"(%d, %d, [\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"])\0A\00"
define i32 @display_this_line(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
store i32 0, i32* %9
br label %13
13: ; preds = %29, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %32
17: ; preds = %13
%18 = load i32, i32* %9
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = load i32*, i32** %8
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %22
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %13
32: ; preds = %13
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"(%d, %d, [\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [3 x i8] c"])\00"
define i32 @display_this_line(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = icmp sgt i32 %2, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = zext i32 %2 to i64
%9 = load i32, i32* %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = icmp eq i32 %2, 1
br i1 %11, label %12, label %14
12: ; preds = %14, %7, %4
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
14: ; preds = %7, %14
%15 = phi i64 [ %20, %14 ], [ 1, %7 ]
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds i32, i32* %3, i64 %15
%18 = load i32, i32* %17
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = add nuw nsw i64 %15, 1
%21 = icmp eq i64 %20, %8
br i1 %21, label %12, label %14
}