#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 int);
int /*<<< orphan*/ test(int, int);
int main(void) {
  unsigned int tmp = 0x55;
  for (unsigned int i = 0; i < 17; i++) {
    tmp ^= (i % 0xff);
    tmp &= 0xff;
    printf("tmp %x\n", tmp);
  }
  test(1, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x55,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x11,-0xc(%rbp)
jae    1181 <main+0x61>
mov    -0xc(%rbp),%eax
mov    $0xff,%ecx
xor    %edx,%edx
div    %ecx
xor    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x55,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x54,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x56,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x51,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x54,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x52,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5d,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x54,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5e,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x59,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x54,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5a,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x55,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x45,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <test@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"tmp %x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 85)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 84)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 86)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 85)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 81)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 84)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 82)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 85)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 93)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 84)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 94)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 85)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 89)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 84)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 90)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 85)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 69)
%18 = tail call i32 @test(i32 1, i32 2)
ret i32 0
}