#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*/ putchar(char);
int main(void) {
  int a;
  int b;
  int c;
  int d;
  int temp;
  for (a = 0; a <= 9; a++) {
    for (b = 0; b <= 9; b++) {
      for (c = a; c <= 9; c++) {
        if (c == a) {
          temp = b + 1;
        } else {
          temp = 0;
        }
        for (d = temp; d <= 9; d++) {
          putchar('0' + a);
          putchar('0' + b);
          putchar(' ');
          putchar('0' + c);
          putchar('0' + d);
          if (!(a == 9 && b == 8 && c == 9 && d == 9)) {
            putchar(',');
            putchar(' ');
          }
        }
      }
    }
  }
  putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jg     124c <main+0x13c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jg     1239 <main+0x129>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jg     1226 <main+0x116>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    116b <main+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x62>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jg     1213 <main+0x103>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpl   $0x9,-0x8(%rbp)
jne    11ec <main+0xdc>
cmpl   $0x8,-0xc(%rbp)
jne    11ec <main+0xdc>
cmpl   $0x9,-0x10(%rbp)
jne    11ec <main+0xdc>
cmpl   $0x9,-0x14(%rbp)
je     1200 <main+0xf0>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1205 <main+0xf5>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1178 <main+0x68>
jmp    1218 <main+0x108>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <main+0x37>
jmp    122b <main+0x11b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    123e <main+0x12e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %ebp,%ebp
jmp    113c <main+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0xa,%ebp
je     121f <main+0x10f>
lea    0x30(%rbp),%r13d
xor    %eax,%eax
mov    %rbp,0x10(%rsp)
jmp    115e <main+0x4e>
nopl   0x0(%rax)
mov    0xc(%rsp),%eax
cmp    $0xa,%eax
mov    0x10(%rsp),%rbp
je     1130 <main+0x20>
mov    %ebp,%ecx
xor    $0x9,%ecx
lea    0x1(%rax),%edx
mov    %edx,0xc(%rsp)
lea    0x30(%rax),%ebx
xor    $0x8,%eax
or     %ecx,%eax
sete   0xb(%rsp)
jmp    1188 <main+0x78>
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0xa,%ebp
je     1150 <main+0x40>
cmp    0x10(%rsp),%ebp
mov    $0x0,%r12d
cmove  0xc(%rsp),%r12d
cmp    $0x9,%r12d
ja     1180 <main+0x70>
lea    0x30(%rbp),%r14d
cmp    $0x9,%ebp
sete   %r15b
and    0xb(%rsp),%r15b
add    $0xfffffff6,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %r13b,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl %r14b,%edi
call   1030 <putchar@plt>
lea    0x3a(%r12),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmp    $0xffffffff,%r12d
sete   %al
test   %al,%r15b
jne    1150 <main+0x40>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
inc    %r12d
jne    11c0 <main+0xb0>
jmp    1180 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %7
7: ; preds = %77, %0
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 9
br i1 %9, label %10, label %80
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %73, %10
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 9
br i1 %13, label %14, label %76
14: ; preds = %11
%15 = load i32, i32* %2
store i32 %15, i32* %4
br label %16
16: ; preds = %69, %14
%17 = load i32, i32* %4
%18 = icmp sle i32 %17, 9
br i1 %18, label %19, label %72
19: ; preds = %16
%20 = load i32, i32* %4
%21 = load i32, i32* %2
%22 = icmp eq i32 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %27
26: ; preds = %19
store i32 0, i32* %6
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %6
store i32 %28, i32* %5
br label %29
29: ; preds = %65, %27
%30 = load i32, i32* %5
%31 = icmp sle i32 %30, 9
br i1 %31, label %32, label %68
32: ; preds = %29
%33 = load i32, i32* %2
%34 = add nsw i32 48, %33
%35 = trunc i32 %34 to i8
%36 = call i32 @putchar(i8 signext %35)
%37 = load i32, i32* %3
%38 = add nsw i32 48, %37
%39 = trunc i32 %38 to i8
%40 = call i32 @putchar(i8 signext %39)
%41 = call i32 @putchar(i8 signext 32)
%42 = load i32, i32* %4
%43 = add nsw i32 48, %42
%44 = trunc i32 %43 to i8
%45 = call i32 @putchar(i8 signext %44)
%46 = load i32, i32* %5
%47 = add nsw i32 48, %46
%48 = trunc i32 %47 to i8
%49 = call i32 @putchar(i8 signext %48)
%50 = load i32, i32* %2
%51 = icmp eq i32 %50, 9
br i1 %51, label %52, label %61
52: ; preds = %32
%53 = load i32, i32* %3
%54 = icmp eq i32 %53, 8
br i1 %54, label %55, label %61
55: ; preds = %52
%56 = load i32, i32* %4
%57 = icmp eq i32 %56, 9
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* %5
%60 = icmp eq i32 %59, 9
br i1 %60, label %64, label %61
61: ; preds = %58, %55, %52, %32
%62 = call i32 @putchar(i8 signext 44)
%63 = call i32 @putchar(i8 signext 32)
br label %64
64: ; preds = %61, %58
br label %65
65: ; preds = %64
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
store i32 %67, i32* %5
br label %29
68: ; preds = %29
br label %69
69: ; preds = %68
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %16
72: ; preds = %16
br label %73
73: ; preds = %72
%74 = load i32, i32* %3
%75 = add nsw i32 %74, 1
store i32 %75, i32* %3
br label %11
76: ; preds = %11
br label %77
77: ; preds = %76
%78 = load i32, i32* %2
%79 = add nsw i32 %78, 1
store i32 %79, i32* %2
br label %7
80: ; preds = %7
%81 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %44
%2 = phi i32 [ 0, %0 ], [ %45, %44 ]
%3 = trunc i32 %2 to i8
%4 = add i8 %3, 48
%5 = icmp eq i32 %2, 9
br label %6
6: ; preds = %42, %1
%7 = phi i32 [ 0, %1 ], [ %8, %42 ]
%8 = add nuw nsw i32 %7, 1
%9 = trunc i32 %7 to i8
%10 = add i8 %9, 48
%11 = icmp eq i32 %7, 8
%12 = select i1 %5, i1 %11, i1 false
br label %13
13: ; preds = %6, %39
%14 = phi i32 [ %2, %6 ], [ %40, %39 ]
%15 = icmp eq i32 %14, %2
%16 = select i1 %15, i32 %8, i32 0
%17 = icmp ult i32 %16, 10
br i1 %17, label %18, label %39
18: ; preds = %13
%19 = trunc i32 %14 to i8
%20 = add i8 %19, 48
%21 = icmp eq i32 %14, 9
%22 = select i1 %12, i1 %21, i1 false
br label %23
23: ; preds = %18, %34
%24 = phi i32 [ %16, %18 ], [ %37, %34 ]
%25 = tail call i32 @putchar(i8 signext %4)
%26 = tail call i32 @putchar(i8 signext %10)
%27 = tail call i32 @putchar(i8 signext 32)
%28 = tail call i32 @putchar(i8 signext %20)
%29 = trunc i32 %24 to i8
%30 = add i8 %29, 48
%31 = tail call i32 @putchar(i8 signext %30)
%32 = icmp eq i32 %24, 9
%33 = select i1 %22, i1 %32, i1 false
br i1 %33, label %42, label %34
34: ; preds = %23
%35 = tail call i32 @putchar(i8 signext 44)
%36 = tail call i32 @putchar(i8 signext 32)
%37 = add nuw i32 %24, 1
%38 = icmp eq i32 %37, 10
br i1 %38, label %39, label %23
39: ; preds = %34, %13
%40 = add nuw nsw i32 %14, 1
%41 = icmp eq i32 %40, 10
br i1 %41, label %42, label %13
42: ; preds = %39, %23
%43 = icmp eq i32 %8, 10
br i1 %43, label %44, label %6
44: ; preds = %42
%45 = add nuw nsw i32 %2, 1
%46 = icmp eq i32 %45, 10
br i1 %46, label %47, label %1
47: ; preds = %44
%48 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}