#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);
void ft_print_comb2(void) {
  for (int i = 0; i < 100; i++) {
    char c1 = (i / 10) + '0';
    char c2 = (i - ((i / 10) * 10)) + '0';
    for (int y = 0; y < 100; y++) {
      char c3 = (y / 10) + '0';
      char c4 = (y - ((y / 10) * 10)) + '0';
      if (i != y) {
        putchar(c1);
        putchar(c2);
        putchar(' ');
        putchar(c3);
        putchar(c4);
        if (i != 99 || y != 98) {
          putchar(',');
          putchar(' ');
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<ft_print_comb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    122b <ft_print_comb2+0x11b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   $0xa,%ecx,%ecx
sub    %ecx,%eax
add    $0x30,%eax
mov    %al,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1218 <ft_print_comb2+0x108>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   $0xa,%ecx,%ecx
sub    %ecx,%eax
add    $0x30,%eax
mov    %al,-0xe(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1205 <ft_print_comb2+0xf5>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0x6(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movsbl -0xd(%rbp),%edi
call   1030 <putchar@plt>
movsbl -0xe(%rbp),%edi
call   1030 <putchar@plt>
cmpl   $0x63,-0x4(%rbp)
jne    11ec <ft_print_comb2+0xdc>
cmpl   $0x62,-0xc(%rbp)
je     1200 <ft_print_comb2+0xf0>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1205 <ft_print_comb2+0xf5>
jmp    120a <ft_print_comb2+0xfa>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <ft_print_comb2+0x52>
jmp    121d <ft_print_comb2+0x10d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ft_print_comb2+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_comb2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r13d,%r13d
jmp    112e <ft_print_comb2+0x1e>
add    $0x1,%r13d
cmp    $0x64,%r13d
je     11f3 <ft_print_comb2+0xe3>
movzbl %r13b,%eax
imul   $0xcd,%eax,%eax
shr    $0xb,%eax
lea    0x30(%rax),%r15d
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %r13d,%r12d
sub    %eax,%r12d
add    $0x30,%r12b
xor    %ebp,%ebp
jmp    117c <ft_print_comb2+0x6c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
je     1120 <ft_print_comb2+0x10>
cmp    %ebp,%r13d
je     1174 <ft_print_comb2+0x64>
mov    %ebp,%eax
mov    $0xcccccccd,%ecx
imul   %rcx,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
movsbl %al,%ebx
add    $0x30,%ebx
movzbl %bpl,%eax
imul   $0xcd,%eax,%r14d
shr    $0xb,%r14d
add    %ebp,%ebx
add    $0x30,%r14b
movzbl %r15b,%edi
call   1030 <putchar@plt>
movsbl %r12b,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
movzbl %r14b,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
cmp    $0x63,%r13d
jne    1160 <ft_print_comb2+0x50>
cmp    $0x62,%ebp
je     1174 <ft_print_comb2+0x64>
jmp    1160 <ft_print_comb2+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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