#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int xor128(int *);
int main(void) {
  uint32_t s1[] = {1, 0, 0, 0};
  for (int i = 0; i < 10; i++) {
    uint32_t v = xor128(s1);
    for (int i = 31; i >= 0; i--) {
      printf("%u", (v >> i) & 1);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    11b6 <main+0x96>
lea    -0x20(%rbp),%rdi
call   1040 <xor128@plt>
mov    %eax,-0x28(%rbp)
movl   $0x1f,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jl     119a <main+0x7a>
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%ecx
sar    %cl,%esi
and    $0x1,%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    1169 <main+0x49>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xeb7(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xe78(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     11a0 <main+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xe38(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     11e0 <main+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xdf8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     1220 <main+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xdb8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     1260 <main+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xd78(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     12a0 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xd38(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     12e0 <main+0x1b0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xcf8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     1320 <main+0x1f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xcb8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     1360 <main+0x230>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
call   1050 <xor128@plt>
mov    %eax,%ebx
mov    $0x1f,%ebp
lea    0xc78(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%esi
mov    %ebp,%ecx
shr    %cl,%esi
and    $0x1,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jb     13a0 <main+0x270>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.s1 = [4 x i32] [i32 1, i32 0, i32 0, i32 0]
@.str = [3 x i8] c"%u\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [4 x i32]* %2 to i8*
store i32 0, i32* %3
br label %7
7: ; preds = %27, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %30
10: ; preds = %7
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%12 = call i32 @xor128(i32* %11)
store i32 %12, i32* %4
store i32 31, i32* %5
br label %13
13: ; preds = %22, %10
%14 = load i32, i32* %5
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = ashr i32 %17, %18
%20 = and i32 %19, 1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %16
%23 = load i32, i32* %5
%24 = add nsw i32 %23, -1
store i32 %24, i32* %5
br label %13
25: ; preds = %13
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %7
30: ; preds = %7
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@__const.main.s1 = [4 x i32] [i32 1, i32 0, i32 0, i32 0]
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @xor128(i32* %3)
br label %97
5: ; preds = %97
%6 = call i32 @putchar(i32 10)
%7 = call i32 @xor128(i32* %3)
br label %8
8: ; preds = %8, %5
%9 = phi i32 [ 31, %5 ], [ %13, %8 ]
%10 = lshr i32 %7, %9
%11 = and i32 %10, 1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %9, 0
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = call i32 @putchar(i32 10)
%17 = call i32 @xor128(i32* %3)
br label %18
18: ; preds = %18, %15
%19 = phi i32 [ 31, %15 ], [ %23, %18 ]
%20 = lshr i32 %17, %19
%21 = and i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = add nsw i32 %19, -1
%24 = icmp eq i32 %19, 0
br i1 %24, label %25, label %18
25: ; preds = %18
%26 = call i32 @putchar(i32 10)
%27 = call i32 @xor128(i32* %3)
br label %28
28: ; preds = %28, %25
%29 = phi i32 [ 31, %25 ], [ %33, %28 ]
%30 = lshr i32 %27, %29
%31 = and i32 %30, 1
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = add nsw i32 %29, -1
%34 = icmp eq i32 %29, 0
br i1 %34, label %35, label %28
35: ; preds = %28
%36 = call i32 @putchar(i32 10)
%37 = call i32 @xor128(i32* %3)
br label %38
38: ; preds = %38, %35
%39 = phi i32 [ 31, %35 ], [ %43, %38 ]
%40 = lshr i32 %37, %39
%41 = and i32 %40, 1
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = add nsw i32 %39, -1
%44 = icmp eq i32 %39, 0
br i1 %44, label %45, label %38
45: ; preds = %38
%46 = call i32 @putchar(i32 10)
%47 = call i32 @xor128(i32* %3)
br label %48
48: ; preds = %48, %45
%49 = phi i32 [ 31, %45 ], [ %53, %48 ]
%50 = lshr i32 %47, %49
%51 = and i32 %50, 1
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = add nsw i32 %49, -1
%54 = icmp eq i32 %49, 0
br i1 %54, label %55, label %48
55: ; preds = %48
%56 = call i32 @putchar(i32 10)
%57 = call i32 @xor128(i32* %3)
br label %58
58: ; preds = %58, %55
%59 = phi i32 [ 31, %55 ], [ %63, %58 ]
%60 = lshr i32 %57, %59
%61 = and i32 %60, 1
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = add nsw i32 %59, -1
%64 = icmp eq i32 %59, 0
br i1 %64, label %65, label %58
65: ; preds = %58
%66 = call i32 @putchar(i32 10)
%67 = call i32 @xor128(i32* %3)
br label %68
68: ; preds = %68, %65
%69 = phi i32 [ 31, %65 ], [ %73, %68 ]
%70 = lshr i32 %67, %69
%71 = and i32 %70, 1
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %71)
%73 = add nsw i32 %69, -1
%74 = icmp eq i32 %69, 0
br i1 %74, label %75, label %68
75: ; preds = %68
%76 = call i32 @putchar(i32 10)
%77 = call i32 @xor128(i32* %3)
br label %78
78: ; preds = %78, %75
%79 = phi i32 [ 31, %75 ], [ %83, %78 ]
%80 = lshr i32 %77, %79
%81 = and i32 %80, 1
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %81)
%83 = add nsw i32 %79, -1
%84 = icmp eq i32 %79, 0
br i1 %84, label %85, label %78
85: ; preds = %78
%86 = call i32 @putchar(i32 10)
%87 = call i32 @xor128(i32* %3)
br label %88
88: ; preds = %88, %85
%89 = phi i32 [ 31, %85 ], [ %93, %88 ]
%90 = lshr i32 %87, %89
%91 = and i32 %90, 1
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %91)
%93 = add nsw i32 %89, -1
%94 = icmp eq i32 %89, 0
br i1 %94, label %95, label %88
95: ; preds = %88
%96 = call i32 @putchar(i32 10)
ret i32 0
97: ; preds = %0, %97
%98 = phi i32 [ 31, %0 ], [ %102, %97 ]
%99 = lshr i32 %4, %98
%100 = and i32 %99, 1
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %100)
%102 = add nsw i32 %98, -1
%103 = icmp eq i32 %98, 0
br i1 %103, label %5, label %97
}