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

/* Variables and functions */
int m5_initparam();
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int /*<<< orphan*/ usage();
void do_sw99param(int argc, char *argv[]) {
  if (argc != 0)
    usage();
  uint64_t param = m5_initparam();
  printf("%d %d %d %d %d", (param >> 48) & 0xfff, (param >> 36) & 0xfff,
         (param >> 24) & 0xfff, (param >> 12) & 0xfff, (param >> 0) & 0xfff);
}


x86 assembly (clang, -O0):
<do_sw99param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <do_sw99param+0x20>
mov    $0x0,%al
call   1050 <usage@plt>
mov    $0x0,%al
call   1030 <m5_initparam@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x30,%ecx
sar    %cl,%esi
and    $0xfff,%esi
mov    -0x14(%rbp),%edx
mov    $0x24,%ecx
sar    %cl,%edx
and    $0xfff,%edx
mov    -0x14(%rbp),%ecx
sar    $0x18,%ecx
and    $0xfff,%ecx
mov    -0x14(%rbp),%r8d
sar    $0xc,%r8d
and    $0xfff,%r8d
mov    -0x14(%rbp),%r9d
sar    $0x0,%r9d
and    $0xfff,%r9d
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_sw99param>:
push   %rax
test   %edi,%edi
je     113c <do_sw99param+0xc>
xor    %eax,%eax
call   1050 <usage@plt>
xor    %eax,%eax
call   1030 <m5_initparam@plt>
mov    %eax,%ecx
sar    $0x18,%ecx
and    $0xfff,%ecx
mov    %eax,%r8d
shr    $0xc,%r8d
and    $0xfff,%r8d
and    $0xfff,%eax
lea    0xe98(%rip),%rdi
mov    %eax,%r9d
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%d %d %d %d %d\00"
define void @do_sw99param(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = call i32 (...) @m5_initparam()
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = ashr i32 %12, 48
%14 = and i32 %13, 4095
%15 = load i32, i32* %5
%16 = ashr i32 %15, 36
%17 = and i32 %16, 4095
%18 = load i32, i32* %5
%19 = ashr i32 %18, 24
%20 = and i32 %19, 4095
%21 = load i32, i32* %5
%22 = ashr i32 %21, 12
%23 = and i32 %22, 4095
%24 = load i32, i32* %5
%25 = ashr i32 %24, 0
%26 = and i32 %25, 4095
%27 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17, i32 %20, i32 %23, i32 %26)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d %d %d %d %d\00"
define void @do_sw99param(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = tail call i32 (...) @m5_initparam()
%8 = ashr i32 %7, 24
%9 = and i32 %8, 4095
%10 = lshr i32 %7, 12
%11 = and i32 %10, 4095
%12 = and i32 %7, 4095
%13 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 poison, i32 poison, i32 %9, i32 %11, i32 %12)
ret void
}