#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);
int main(int argc, char const *argv[]) {
  int b = -5;
  int a;
  while ((a = b++)) {
    printf("IN a:[%d], b:[%d]\n", a, b);
  }
  printf("OUT a:[%d], b:[%d]\n", a, b);
  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)
movl   $0xfffffffb,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     115b <main+0x4b>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    112d <main+0x1d>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeab(%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),%rbx
mov    %rbx,%rdi
mov    $0xfffffffb,%esi
mov    $0xfffffffc,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffc,%esi
mov    $0xfffffffd,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffd,%esi
mov    $0xfffffffe,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xfffffffe,%esi
mov    $0xffffffff,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
xor    %edx,%edx
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"IN a:[%d], b:[%d]\0A\00"
@.str.1 = [20 x i8] c"OUT a:[%d], b:[%d]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -5, i32 -4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -4, i32 -3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -3, i32 -2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -2, i32 -1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -1, i32 0)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}