#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 libgieditor_add_addresses(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int b1, b2, num;
  int address = 0x2000;
  b1 = b2 = num = 0;
  for (num = 1; num <= 256; num++) {
    b1 = (address & 0xff00) >> 8;
    b2 = address & 0xff;
    printf("                  \"User Live Set (%04u)\",               \"Live "
           "Set\",\n",
           num);
    address = libgieditor_add_addresses(address, 1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2000,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x100,-0x10(%rbp)
jg     11a5 <main+0x85>
mov    -0x14(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
mov    $0x1,%esi
call   1040 <libgieditor_add_addresses@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <main+0x32>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
mov    $0x2000,%ebp
lea    0xecb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1040 <libgieditor_add_addresses@plt>
mov    %eax,%ebp
add    $0x1,%ebx
cmp    $0x101,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [69 x i8] c" \22User Live Set (%04u)\22, \22Live Set\22,\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 8192, i32* %5
store i32 0, i32* %4
store i32 0, i32* %3
store i32 0, i32* %2
store i32 1, i32* %4
br label %6
6: ; preds = %19, %0
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 256
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* %5
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
store i32 %12, i32* %2
%13 = load i32, i32* %5
%14 = and i32 %13, 255
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %5
%18 = call i32 @libgieditor_add_addresses(i32 %17, i32 1)
store i32 %18, i32* %5
br label %19
19: ; preds = %9
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [69 x i8] c" \22User Live Set (%04u)\22, \22Live Set\22,\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 8192, %0 ], [ %5, %1 ]
%3 = phi i32 [ 1, %0 ], [ %6, %1 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @libgieditor_add_addresses(i32 %2, i32 1)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 257
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}