#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*/ printf(char *, int);
int main() {
  int i, j;
  for (i = 0, j = 100; 3 * i < j; i++, j -= 10) {
    printf("I: %d\n", i);
    printf("J: %d\n", j);
  }
  printf("I: %d\n", i);
  printf("J: %d\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x64,-0xc(%rbp)
imul   $0x3,-0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116f <main+0x5f>
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebp,%ebp
mov    $0x64,%ebx
mov    $0x3,%r12d
lea    0xed4(%rip),%r14
lea    0xed4(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0xfffffff6,%ebx
lea    0x3(%r12),%eax
cmp    %ebx,%r12d
mov    %eax,%r12d
jl     1140 <main+0x30>
lea    0xe92(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xe8b(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"I: %d\0A\00"
@.str.1 = [7 x i8] c"J: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 100, i32* %3
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = mul nsw i32 3, %5
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
%17 = load i32, i32* %3
%18 = sub nsw i32 %17, 10
store i32 %18, i32* %3
br label %4
19: ; preds = %4
%20 = load i32, i32* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"I: %d\0A\00"
@.str.1 = [7 x i8] c"J: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 100, %0 ], [ %7, %1 ]
%3 = phi i32 [ 0, %0 ], [ %6, %1 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%6 = add nuw nsw i32 %3, 1
%7 = add nsw i32 %2, -10
%8 = mul nsw i32 %6, 3
%9 = icmp slt i32 %8, %7
br i1 %9, label %1, label %10
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}