#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*/ ft_putchar(char);
void ft_print_comb2(void) {
  int i;
  i = 1;
  while (i <= 10000) {
    if ((i / 100) < (i % 100)) {
      ft_putchar(i / 1000 + '0');
      ft_putchar((i / 100) % 10 + '0');
      ft_putchar(' ');
      ft_putchar((i / 10) % 10 + '0');
      ft_putchar(i % 10 + '0');
      if (i < 9899) {
        ft_putchar(',');
        ft_putchar(' ');
      }
    }
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_print_comb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jg     11fc <ft_print_comb2+0xec>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
cmp    %edx,%eax
jge    11ee <ft_print_comb2+0xde>
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
add    $0x30,%eax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%edi
call   1030 <ft_putchar@plt>
cmpl   $0x26ab,-0x4(%rbp)
jge    11e9 <ft_print_comb2+0xd9>
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
jmp    11ee <ft_print_comb2+0xde>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ft_print_comb2+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_comb2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
jmp    112f <ft_print_comb2+0x1f>
xchg   %ax,%ax
add    $0x1,%ebx
cmp    $0x2711,%ebx
je     1205 <ft_print_comb2+0xf5>
movzwl %bx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
imul   $0x147b,%ecx,%ebp
shr    $0x11,%ebp
imul   $0xffffff9c,%ebp,%ecx
add    %ebx,%ecx
cmp    %cx,%bp
jae    1120 <ft_print_comb2+0x10>
imul   $0xcccd,%eax,%eax
shr    $0x12,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
movzbl %al,%r14d
movzwl %bx,%r15d
mov    %r15d,%eax
shr    $0x3,%eax
imul   $0x20c5,%eax,%eax
shr    $0x14,%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzwl %bp,%eax
movzbl %al,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
or     $0x30,%bpl
movzbl %bpl,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
imul   $0xcccd,%r15d,%eax
shr    $0x13,%eax
imul   $0xcccd,%eax,%ecx
shr    $0x12,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
or     $0x30,%al
movzbl %al,%edi
call   1030 <ft_putchar@plt>
add    %ebx,%r14d
or     $0x30,%r14b
movsbl %r14b,%edi
call   1030 <ft_putchar@plt>
cmp    $0x26aa,%ebx
ja     1120 <ft_print_comb2+0x10>
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
jmp    1120 <ft_print_comb2+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @ft_print_comb2() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %41, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 10000
br i1 %4, label %5, label %44
5: ; preds = %2
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 100
%8 = load i32, i32* %1
%9 = srem i32 %8, 100
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %41
11: ; preds = %5
%12 = load i32, i32* %1
%13 = sdiv i32 %12, 1000
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
%16 = call i32 @ft_putchar(i8 signext %15)
%17 = load i32, i32* %1
%18 = sdiv i32 %17, 100
%19 = srem i32 %18, 10
%20 = add nsw i32 %19, 48
%21 = trunc i32 %20 to i8
%22 = call i32 @ft_putchar(i8 signext %21)
%23 = call i32 @ft_putchar(i8 signext 32)
%24 = load i32, i32* %1
%25 = sdiv i32 %24, 10
%26 = srem i32 %25, 10
%27 = add nsw i32 %26, 48
%28 = trunc i32 %27 to i8
%29 = call i32 @ft_putchar(i8 signext %28)
%30 = load i32, i32* %1
%31 = srem i32 %30, 10
%32 = add nsw i32 %31, 48
%33 = trunc i32 %32 to i8
%34 = call i32 @ft_putchar(i8 signext %33)
%35 = load i32, i32* %1
%36 = icmp slt i32 %35, 9899
br i1 %36, label %37, label %40
37: ; preds = %11
%38 = call i32 @ft_putchar(i8 signext 44)
%39 = call i32 @ft_putchar(i8 signext 32)
br label %40
40: ; preds = %37, %11
br label %41
41: ; preds = %40, %5
%42 = load i32, i32* %1
%43 = add nsw i32 %42, 1
store i32 %43, i32* %1
br label %2
44: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @ft_print_comb2() {
br label %1
1: ; preds = %0, %30
%2 = phi i32 [ 1, %0 ], [ %31, %30 ]
%3 = trunc i32 %2 to i16
%4 = udiv i16 %3, 100
%5 = urem i16 %3, 100
%6 = icmp ult i16 %4, %5
br i1 %6, label %7, label %30
7: ; preds = %1
%8 = udiv i16 %3, 1000
%9 = trunc i16 %8 to i8
%10 = add nuw nsw i8 %9, 48
%11 = tail call i32 @ft_putchar(i8 signext %10)
%12 = trunc i16 %4 to i8
%13 = urem i8 %12, 10
%14 = or i8 %13, 48
%15 = tail call i32 @ft_putchar(i8 signext %14)
%16 = tail call i32 @ft_putchar(i8 signext 32)
%17 = udiv i16 %3, 10
%18 = urem i16 %17, 10
%19 = trunc i16 %18 to i8
%20 = or i8 %19, 48
%21 = tail call i32 @ft_putchar(i8 signext %20)
%22 = urem i16 %3, 10
%23 = trunc i16 %22 to i8
%24 = or i8 %23, 48
%25 = tail call i32 @ft_putchar(i8 signext %24)
%26 = icmp ult i32 %2, 9899
br i1 %26, label %27, label %30
27: ; preds = %7
%28 = tail call i32 @ft_putchar(i8 signext 44)
%29 = tail call i32 @ft_putchar(i8 signext 32)
br label %30
30: ; preds = %7, %27, %1
%31 = add nuw nsw i32 %2, 1
%32 = icmp eq i32 %31, 10001
br i1 %32, label %33, label %1
33: ; preds = %30
ret void
}