#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 *, unsigned long);
int main(int argc, char *argv[]) {
  unsigned long l = 1;
  unsigned int i;
  for (i = 1; i > 0; i++) {
    l++;
  }
  printf("i %u\n", i);
  printf("i-1 %u\n", i - 1);
  printf("l %lu\n", l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jbe    1159 <main+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1135 <main+0x25>
mov    -0x1c(%rbp),%eax
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,%eax
mov    %eax,%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
mov    $0xffffffff,%ebx
mov    $0xffffffff,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"i %u\0A\00"
@.str.1 = [8 x i8] c"i-1 %u\0A\00"
@.str.2 = [7 x i8] c"l %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 4294967295)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i64 4294967296)
ret i32 0
}