#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 maxContinuousOnes(unsigned int, int *);
int /*<<< orphan*/ printBits(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
void test5() {
  unsigned int a = 0x6FE45F92;
  unsigned int b = 0x7F67FF89;
  int pos, count;
  printf("a:\n");
  printBits(a);
  count = maxContinuousOnes(a, &pos);
  printf("maxContinuousOnes(a, &pos)=%d pos=%d\n", count, pos);
  printf("b:\n");
  printBits(b);
  count = maxContinuousOnes(b, &pos);
  printf("maxContinuousOnes(b, &pos)=%d pos=%d\n", count, pos);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6fe45f92,-0x4(%rbp)
movl   $0x7f67ff89,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <printBits@plt>
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <maxContinuousOnes@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <printBits@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1030 <maxContinuousOnes@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rbx
sub    $0x10,%rsp
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
mov    $0x6fe45f92,%edi
call   1050 <printBits@plt>
lea    0xc(%rsp),%rbx
mov    $0x6fe45f92,%edi
mov    %rbx,%rsi
call   1040 <maxContinuousOnes@plt>
mov    0xc(%rsp),%edx
lea    0xe88(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7f67ff89,%edi
call   1050 <printBits@plt>
mov    $0x7f67ff89,%edi
mov    %rbx,%rsi
call   1040 <maxContinuousOnes@plt>
mov    0xc(%rsp),%edx
lea    0xe77(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"a:\0A\00"
@.str.1 = [38 x i8] c"maxContinuousOnes(a, &pos)=%d pos=%d\0A\00"
@.str.2 = [4 x i8] c"b:\0A\00"
@.str.3 = [38 x i8] c"maxContinuousOnes(b, &pos)=%d pos=%d\0A\00"
define void @test5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1877237650, i32* %1
store i32 2137522057, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @printBits(i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @maxContinuousOnes(i32 %8, i32* %3)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* %2
%15 = call i32 @printBits(i32 %14)
%16 = load i32, i32* %2
%17 = call i32 @maxContinuousOnes(i32 %16, i32* %3)
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"maxContinuousOnes(a, &pos)=%d pos=%d\0A\00"
@.str.3 = [38 x i8] c"maxContinuousOnes(b, &pos)=%d pos=%d\0A\00"
@str = [3 x i8] c"a:\00"
@str.4 = [3 x i8] c"b:\00"
define void @test5() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printBits(i32 1877237650)
%5 = call i32 @maxContinuousOnes(i32 1877237650, i32* %1)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.4, i64 0, i64 0))
%9 = call i32 @printBits(i32 2137522057)
%10 = call i32 @maxContinuousOnes(i32 2137522057, i32* %1)
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %11)
ret void
}