#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 INT_MIN;
int add_asm(int, int);
int /*<<< orphan*/ printBits(int, int *);
int /*<<< orphan*/ printf(char *, int);
int rot_l_asm(int, int);
int rot_r_asm(int, int);
int /*<<< orphan*/ set(int *, int);
int main(int argc, char const *argv[]) {
  int x = 843267973;
  int i;
  for (i = 0; i < 20; ++i) {
    printBits(sizeof(int), &x);
    x = rot_r_asm(x, 2);
  }
  for (i = 0; i < 20; ++i) {
    printBits(sizeof(int), &x);
    x = rot_l_asm(x, 2);
  }
  printf("%d\n", add_asm(234, 235));
  int test[5] = {0};
  set(test, 0);
  set(test, 1);
  set(test, 3);
  set(test, 32);
  set(test, 33);
  set(test, 76);
  printBits(sizeof(int) * 5, test);
  x = INT_MIN;
  printf("%d\n", (x > 0) || (x - 1 < 0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x32433f85,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x14,-0x18(%rbp)
jge    11ca <main+0x5a>
mov    $0x4,%edi
lea    -0x14(%rbp),%rsi
call   1040 <printBits@plt>
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1070 <rot_r_asm@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1194 <main+0x24>
movl   $0x0,-0x18(%rbp)
cmpl   $0x14,-0x18(%rbp)
jge    1207 <main+0x97>
mov    $0x4,%edi
lea    -0x14(%rbp),%rsi
call   1040 <printBits@plt>
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1080 <rot_l_asm@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d1 <main+0x61>
mov    $0xea,%edi
mov    $0xeb,%esi
call   1030 <add_asm@plt>
mov    %eax,%esi
lea    0xde1(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1060 <memset@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
call   1090 <set@plt>
lea    -0x30(%rbp),%rdi
mov    $0x1,%esi
call   1090 <set@plt>
lea    -0x30(%rbp),%rdi
mov    $0x3,%esi
call   1090 <set@plt>
lea    -0x30(%rbp),%rdi
mov    $0x20,%esi
call   1090 <set@plt>
lea    -0x30(%rbp),%rdi
mov    $0x21,%esi
call   1090 <set@plt>
lea    -0x30(%rbp),%rdi
mov    $0x4c,%esi
call   1090 <set@plt>
lea    -0x30(%rbp),%rsi
mov    $0x14,%edi
call   1040 <printBits@plt>
mov    0x2d4e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x31(%rbp)
jg     12bd <main+0x14d>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
setl   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xd34(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
movl   $0x32433f85,0xc(%rsp)
32
mov    $0x14,%ebp
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <printBits@plt>
mov    0xc(%rsp),%edi
mov    $0x2,%esi
call   1060 <rot_r_asm@plt>
mov    %eax,0xc(%rsp)
add    $0xffffffff,%ebp
jne    1180 <main+0x20>
mov    $0x14,%ebp
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <printBits@plt>
mov    0xc(%rsp),%edi
mov    $0x2,%esi
call   1070 <rot_l_asm@plt>
mov    %eax,0xc(%rsp)
add    $0xffffffff,%ebp
jne    11b0 <main+0x50>
mov    $0xea,%edi
mov    $0xeb,%esi
call   1030 <add_asm@plt>
lea    0xe16(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1080 <set@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1080 <set@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1080 <set@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1080 <set@plt>
mov    %rbx,%rdi
mov    $0x21,%esi
call   1080 <set@plt>
mov    %rbx,%rdi
mov    $0x4c,%esi
call   1080 <set@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
call   1040 <printBits@plt>
mov    0x2d80(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    %r14,%rdi
mov    $0x1,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [5 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 843267973, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 20
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = call i32 @printBits(i32 4, i32* %6)
%14 = load i32, i32* %6
%15 = call i32 @rot_r_asm(i32 %14, i32 2)
store i32 %15, i32* %6
br label %16
16: ; preds = %12
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %9
19: ; preds = %9
store i32 0, i32* %7
br label %20
20: ; preds = %27, %19
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 20
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = call i32 @printBits(i32 4, i32* %6)
%25 = load i32, i32* %6
%26 = call i32 @rot_l_asm(i32 %25, i32 2)
store i32 %26, i32* %6
br label %27
27: ; preds = %23
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %20
30: ; preds = %20
%31 = call i32 @add_asm(i32 234, i32 235)
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %31)
%33 = bitcast [5 x i32]* %8 to i8*
%34 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%35 = call i32 @set(i32* %34, i32 0)
%36 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%37 = call i32 @set(i32* %36, i32 1)
%38 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%39 = call i32 @set(i32* %38, i32 3)
%40 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%41 = call i32 @set(i32* %40, i32 32)
%42 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%43 = call i32 @set(i32* %42, i32 33)
%44 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%45 = call i32 @set(i32* %44, i32 76)
%46 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%47 = call i32 @printBits(i32 20, i32* %46)
%48 = load i32, i32* @INT_MIN
store i32 %48, i32* %6
%49 = load i32, i32* %6
%50 = icmp sgt i32 %49, 0
br i1 %50, label %55, label %51
51: ; preds = %30
%52 = load i32, i32* %6
%53 = sub nsw i32 %52, 1
%54 = icmp slt i32 %53, 0
br label %55
55: ; preds = %51, %30
%56 = phi i1 [ true, %30 ], [ %54, %51 ]
%57 = zext i1 %56 to i32
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %57)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@INT_MIN = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = bitcast i32* %3 to i8*
store i32 843267973, i32* %3
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %11, %6 ]
%8 = call i32 @printBits(i32 4, i32* %3)
%9 = load i32, i32* %3
%10 = call i32 @rot_r_asm(i32 %9, i32 2)
store i32 %10, i32* %3
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, 20
br i1 %12, label %13, label %6
13: ; preds = %6, %13
%14 = phi i32 [ %18, %13 ], [ 0, %6 ]
%15 = call i32 @printBits(i32 4, i32* %3)
%16 = load i32, i32* %3
%17 = call i32 @rot_l_asm(i32 %16, i32 2)
store i32 %17, i32* %3
%18 = add nuw nsw i32 %14, 1
%19 = icmp eq i32 %18, 20
br i1 %19, label %20, label %13
20: ; preds = %13
%21 = call i32 @add_asm(i32 234, i32 235)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = bitcast [5 x i32]* %4 to i8*
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%25 = call i32 @set(i32* %24, i32 0)
%26 = call i32 @set(i32* %24, i32 1)
%27 = call i32 @set(i32* %24, i32 3)
%28 = call i32 @set(i32* %24, i32 32)
%29 = call i32 @set(i32* %24, i32 33)
%30 = call i32 @set(i32* %24, i32 76)
%31 = call i32 @printBits(i32 20, i32* %24)
%32 = load i32, i32* @INT_MIN
store i32 %32, i32* %3
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}