#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 int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, ...);
void show_histo(const int32_t *map) {
  int histo[32], i, j;
  for (i = 0; i < 32; i++)
    histo[i] = 0;
  for (i = 3600 * 1800; i; i--, map++) {
    int32_t tval = *map;
    for (j = 0; tval; j++)
      tval >>= 1;
    assert(j < 32);
    histo[j]++;
  }
  for (i = 0; i < 32; i++)
    printf("%d ", histo[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<show_histo>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    116c <show_histo+0x4c>
movslq -0x94(%rbp),%rax
movl   $0x0,-0x90(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1139 <show_histo+0x19>
movl   $0x62e080,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
je     1215 <show_histo+0xf5>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x9c(%rbp)
movl   $0x0,-0x98(%rbp)
cmpl   $0x0,-0x9c(%rbp)
je     11c9 <show_histo+0xa9>
mov    -0x9c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x9c(%rbp)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1199 <show_histo+0x79>
cmpl   $0x20,-0x98(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movslq -0x98(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x94(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x94(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <show_histo+0x56>
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    125c <show_histo+0x13c>
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%esi
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    121f <show_histo+0xff>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_histo>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    $0x62e080,%r14d
jmp    118e <show_histo+0x5e>
xor    %edi,%edi
cmp    $0x20,%ebp
setb   %dil
call   1050 <assert@plt>
mov    %ebp,%eax
addl   $0x1,(%rsp,%rax,4)
add    $0x4,%rbx
add    $0xffffffff,%r14d
je     11ae <show_histo+0x7e>
mov    (%rbx),%eax
xor    %ebp,%ebp
test   %eax,%eax
je     1170 <show_histo+0x40>
mov    %eax,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%ebp
cmp    $0x1,%eax
mov    %ecx,%eax
ja     11a0 <show_histo+0x70>
jmp    1170 <show_histo+0x40>
mov    (%rsp),%esi
lea    0xe48(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x44(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x54(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x58(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x5c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x60(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x64(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x68(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x6c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x70(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x74(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x78(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x7c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @show_histo(i32* %0) {
%2 = alloca i32*
%3 = alloca [32 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %7
7: ; preds = %14, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %12
store i32 0, i32* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %7
17: ; preds = %7
store i32 6480000, i32* %4
br label %18
18: ; preds = %43, %17
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %48
21: ; preds = %18
%22 = load i32*, i32** %2
%23 = load i32, i32* %22
store i32 %23, i32* %6
store i32 0, i32* %5
br label %24
24: ; preds = %30, %21
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %6
%29 = ashr i32 %28, 1
store i32 %29, i32* %6
br label %30
30: ; preds = %27
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %24
33: ; preds = %24
%34 = load i32, i32* %5
%35 = icmp slt i32 %34, 32
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %39
%41 = load i32, i32* %40
%42 = add nsw i32 %41, 1
store i32 %42, i32* %40
br label %43
43: ; preds = %33
%44 = load i32, i32* %4
%45 = add nsw i32 %44, -1
store i32 %45, i32* %4
%46 = load i32*, i32** %2
%47 = getelementptr inbounds i32, i32* %46, i32 1
store i32* %47, i32** %2
br label %18
48: ; preds = %18
store i32 0, i32* %4
br label %49
49: ; preds = %58, %48
%50 = load i32, i32* %4
%51 = icmp slt i32 %50, 32
br i1 %51, label %52, label %61
52: ; preds = %49
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %52
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %49
61: ; preds = %49
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @show_histo(i32* nocapture %0) {
%2 = alloca [32 x i32]
%3 = bitcast [32 x i32]* %2 to i8*
br label %4
4: ; preds = %1, %15
%5 = phi i32 [ %24, %15 ], [ 6480000, %1 ]
%6 = phi i32* [ %25, %15 ], [ %0, %1 ]
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %4, %9
%10 = phi i32 [ %12, %9 ], [ %7, %4 ]
%11 = phi i32 [ %13, %9 ], [ 0, %4 ]
%12 = ashr i32 %10, 1
%13 = add nuw nsw i32 %11, 1
%14 = icmp ult i32 %10, 2
br i1 %14, label %15, label %9
15: ; preds = %9, %4
%16 = phi i32 [ 0, %4 ], [ %13, %9 ]
%17 = icmp ult i32 %16, 32
%18 = zext i1 %17 to i32
%19 = tail call i32 @assert(i32 %18)
%20 = zext i32 %16 to i64
%21 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = add nsw i32 %22, 1
store i32 %23, i32* %21
%24 = add nsw i32 %5, -1
%25 = getelementptr inbounds i32, i32* %6, i64 1
%26 = icmp eq i32 %24, 0
br i1 %26, label %27, label %4
27: ; preds = %15
%28 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 0
%29 = load i32, i32* %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 1
%32 = load i32, i32* %31
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 2
%35 = load i32, i32* %34
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 3
%38 = load i32, i32* %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 4
%41 = load i32, i32* %40
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 5
%44 = load i32, i32* %43
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 6
%47 = load i32, i32* %46
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 7
%50 = load i32, i32* %49
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 8
%53 = load i32, i32* %52
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 9
%56 = load i32, i32* %55
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 10
%59 = load i32, i32* %58
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 11
%62 = load i32, i32* %61
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %62)
%64 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 12
%65 = load i32, i32* %64
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %65)
%67 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 13
%68 = load i32, i32* %67
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %68)
%70 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 14
%71 = load i32, i32* %70
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %71)
%73 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 15
%74 = load i32, i32* %73
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %74)
%76 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 16
%77 = load i32, i32* %76
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %77)
%79 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 17
%80 = load i32, i32* %79
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %80)
%82 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 18
%83 = load i32, i32* %82
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %83)
%85 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 19
%86 = load i32, i32* %85
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %86)
%88 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 20
%89 = load i32, i32* %88
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %89)
%91 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 21
%92 = load i32, i32* %91
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %92)
%94 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 22
%95 = load i32, i32* %94
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %95)
%97 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 23
%98 = load i32, i32* %97
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %98)
%100 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 24
%101 = load i32, i32* %100
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %101)
%103 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 25
%104 = load i32, i32* %103
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %104)
%106 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 26
%107 = load i32, i32* %106
%108 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %107)
%109 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 27
%110 = load i32, i32* %109
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %110)
%112 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 28
%113 = load i32, i32* %112
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %113)
%115 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 29
%116 = load i32, i32* %115
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %116)
%118 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 30
%119 = load i32, i32* %118
%120 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %119)
%121 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 31
%122 = load i32, i32* %121
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %122)
%124 = tail call i32 @putchar(i32 10)
ret void
}