#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*/ printbin(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int setbits(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int /*<<< orphan*/ strtoll(char *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  if (argc < 5)
    return 1;
  unsigned int x =
      setbits(strtoll(argv[1], NULL, 10), strtoul(argv[2], NULL, 10),
              strtoul(argv[3], NULL, 10), strtoll(argv[4], NULL, 10));
  printbin(x);
  printf("%u\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    117c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    120e <main+0xbe>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoul@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1070 <strtoul@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
call   1060 <setbits@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <printbin@plt>
mov    -0x14(%rbp),%esi
lea    0xdfe(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%r14d
cmp    $0x5,%edi
jl     11d7 <main+0x87>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
xor    %r14d,%r14d
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %eax,%r15d
mov    0x10(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoul@plt>
mov    %eax,%r12d
mov    0x18(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1070 <strtoul@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoll@plt>
mov    %r15d,%edi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1060 <setbits@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <printbin@plt>
lea    0xe30(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 5
br i1 %3, label %20, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtoll(i8* nocapture %6, i32* null, i32 10)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @strtoul(i8* nocapture %9, i32* null, i32 10)
%11 = getelementptr inbounds i8*, i8** %1, i64 3
%12 = load i8*, i8** %11
%13 = tail call i32 @strtoul(i8* nocapture %12, i32* null, i32 10)
%14 = getelementptr inbounds i8*, i8** %1, i64 4
%15 = load i8*, i8** %14
%16 = tail call i32 @strtoll(i8* nocapture %15, i32* null, i32 10)
%17 = tail call i32 @setbits(i32 %7, i32 %10, i32 %13, i32 %16)
%18 = tail call i32 @printbin(i32 %17)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %20
20: ; preds = %2, %4
%21 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %21
}