#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*/ ComputeDigits(unsigned long);
int /*<<< orphan*/ PrintLed(unsigned long, unsigned long);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, unsigned long *,
                          unsigned long *);
int /*<<< orphan*/ stdin;
int main() {
  unsigned long spacing;
  unsigned long value;
  fscanf(stdin, "%lu %lu\n", &spacing, &value);
  while (spacing > 0) {
    ComputeDigits(value);
    PrintLed(spacing, value);
    fscanf(stdin, "%d %d\n", &spacing, &value);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <fscanf@plt>
cmpq   $0x0,-0x10(%rbp)
jbe    119f <main+0x6f>
mov    -0x18(%rbp),%rdi
call   1030 <ComputeDigits@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <PrintLed@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <fscanf@plt>
jmp    115c <main+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2ea6(%rip),%r12
mov    (%r12),%edi
lea    0xeb3(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <fscanf@plt>
cmpq   $0x0,0x8(%rsp)
je     11b3 <main+0x83>
lea    0xe9e(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x10(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x10(%rsp),%rdi
call   1030 <ComputeDigits@plt>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
call   1050 <PrintLed@plt>
mov    (%r12),%edi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
call   1040 <fscanf@plt>
cmpq   $0x0,0x8(%rsp)
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [9 x i8] c"%lu %lu\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* @stdin
%5 = call i32 @fscanf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
br label %6
6: ; preds = %9, %0
%7 = load i64, i64* %2
%8 = icmp ugt i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = load i64, i64* %3
%11 = call i32 @ComputeDigits(i64 %10)
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = call i32 @PrintLed(i64 %12, i64 %13)
%15 = load i32, i32* @stdin
%16 = call i32 @fscanf(i32 %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
br label %6
17: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [9 x i8] c"%lu %lu\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = load i32, i32* @stdin
%6 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%7 = load i64, i64* %1
%8 = icmp eq i64 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %0, %9
%10 = load i64, i64* %2
%11 = call i32 @ComputeDigits(i64 %10)
%12 = load i64, i64* %1
%13 = load i64, i64* %2
%14 = call i32 @PrintLed(i64 %12, i64 %13)
%15 = load i32, i32* @stdin
%16 = call i32 @fscanf(i32 %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%17 = load i64, i64* %1
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %9
19: ; preds = %9, %0
ret i32 0
}