#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*/ setled(unsigned char, unsigned char, int);
setcursor(unsigned char row, unsigned char col) {
  unsigned char i;
  row *= 11;
  col *= 11;
  for (i = 0; i < 10; i++) {
    setled(row, col + i, 3);
    setled(row + i, col + 9, 3);
    setled(row + 9, col + i, 3);
    setled(row + i, col, 3);
  }
}


x86 assembly (clang, -O0):
<setcursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
imul   $0xb,%eax,%eax
mov    %al,-0x5(%rbp)
movzbl -0x6(%rbp),%eax
imul   $0xb,%eax,%eax
mov    %al,-0x6(%rbp)
movb   $0x0,-0x7(%rbp)
movzbl -0x7(%rbp),%eax
cmp    $0xa,%eax
jge    11d4 <setcursor+0xc4>
mov    -0x5(%rbp),%cl
movzbl -0x6(%rbp),%eax
movzbl -0x7(%rbp),%edx
add    %edx,%eax
mov    $0x3,%edx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <setled@plt>
movzbl -0x5(%rbp),%eax
movzbl -0x7(%rbp),%ecx
add    %ecx,%eax
mov    %al,%cl
movzbl -0x6(%rbp),%eax
add    $0x9,%eax
mov    $0x3,%edx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <setled@plt>
movzbl -0x5(%rbp),%eax
add    $0x9,%eax
mov    %al,%cl
movzbl -0x6(%rbp),%eax
movzbl -0x7(%rbp),%edx
add    %edx,%eax
mov    $0x3,%edx
movzbl %cl,%edi
movzbl %al,%esi
call   1030 <setled@plt>
movzbl -0x5(%rbp),%eax
movzbl -0x7(%rbp),%ecx
add    %ecx,%eax
mov    $0x3,%edx
movzbl %al,%edi
movzbl -0x6(%rbp),%esi
call   1030 <setled@plt>
mov    -0x7(%rbp),%al
add    $0x1,%al
mov    %al,-0x7(%rbp)
jmp    113c <setcursor+0x2c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setcursor>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%eax
lea    (%rsi,%rsi,4),%ecx
lea    (%rsi,%rcx,2),%ecx
lea    0x9(%rcx),%edx
xor    %r14d,%r14d
movzbl %al,%r12d
add    $0x9,%al
movzbl %dl,%edx
mov    %edx,0x4(%rsp)
movzbl %al,%r15d
movzbl %cl,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r14,%r13,1),%eax
movzbl %al,%ebx
mov    %r12d,%edi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <setled@plt>
lea    (%r12,%r14,1),%eax
movzbl %al,%ebp
mov    %ebp,%edi
mov    0x4(%rsp),%esi
mov    $0x3,%edx
call   1030 <setled@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    $0x3,%edx
call   1030 <setled@plt>
mov    %ebp,%edi
mov    %r13d,%esi
mov    $0x3,%edx
call   1030 <setled@plt>
add    $0x1,%r14b
cmp    $0xa,%r14b
jne    1150 <setcursor+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @setcursor(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = mul nsw i32 %8, 11
%10 = trunc i32 %9 to i8
store i8 %10, i8* %4
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = mul nsw i32 %12, 11
%14 = trunc i32 %13 to i8
store i8 %14, i8* %5
store i8 0, i8* %6
br label %15
15: ; preds = %58, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 10
br i1 %18, label %19, label %61
19: ; preds = %15
%20 = load i8, i8* %4
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = add nsw i32 %22, %24
%26 = trunc i32 %25 to i8
%27 = call i32 @setled(i8 zeroext %20, i8 zeroext %26, i32 3)
%28 = load i8, i8* %4
%29 = zext i8 %28 to i32
%30 = load i8, i8* %6
%31 = zext i8 %30 to i32
%32 = add nsw i32 %29, %31
%33 = trunc i32 %32 to i8
%34 = load i8, i8* %5
%35 = zext i8 %34 to i32
%36 = add nsw i32 %35, 9
%37 = trunc i32 %36 to i8
%38 = call i32 @setled(i8 zeroext %33, i8 zeroext %37, i32 3)
%39 = load i8, i8* %4
%40 = zext i8 %39 to i32
%41 = add nsw i32 %40, 9
%42 = trunc i32 %41 to i8
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = load i8, i8* %6
%46 = zext i8 %45 to i32
%47 = add nsw i32 %44, %46
%48 = trunc i32 %47 to i8
%49 = call i32 @setled(i8 zeroext %42, i8 zeroext %48, i32 3)
%50 = load i8, i8* %4
%51 = zext i8 %50 to i32
%52 = load i8, i8* %6
%53 = zext i8 %52 to i32
%54 = add nsw i32 %51, %53
%55 = trunc i32 %54 to i8
%56 = load i8, i8* %5
%57 = call i32 @setled(i8 zeroext %55, i8 zeroext %56, i32 3)
br label %58
58: ; preds = %19
%59 = load i8, i8* %6
%60 = add i8 %59, 1
store i8 %60, i8* %6
br label %15
61: ; preds = %15
%62 = load i32, i32* %3
ret i32 %62
}

LLVM IR (-O2):
define i32 @setcursor(i8 zeroext %0, i8 zeroext %1) {
%3 = mul i8 %0, 11
%4 = mul i8 %1, 11
%5 = add i8 %4, 9
%6 = add i8 %3, 9
br label %7
7: ; preds = %2, %7
%8 = phi i8 [ 0, %2 ], [ %15, %7 ]
%9 = add i8 %8, %4
%10 = tail call i32 @setled(i8 zeroext %3, i8 zeroext %9, i32 3)
%11 = add i8 %8, %3
%12 = tail call i32 @setled(i8 zeroext %11, i8 zeroext %5, i32 3)
%13 = tail call i32 @setled(i8 zeroext %6, i8 zeroext %9, i32 3)
%14 = tail call i32 @setled(i8 zeroext %11, i8 zeroext %4, i32 3)
%15 = add nuw nsw i8 %8, 1
%16 = icmp eq i8 %15, 10
br i1 %16, label %17, label %7
17: ; preds = %7
ret i32 undef
}