#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*/ printf(char *, char *, ...);
int setbits(int, int, int, int);
int main() {
  printf("%s\t\t\t\t\t%s\t%s\n", "Test", "Expected", "Actual");
  printf("%s\t\t\t\t\t%s\t%s\n", "----", "--------", "------");
  printf("%s\t%d\t%d\n", "setbits(0x12ff5678, 23, 8, 0x34)", 0x12345678,
         setbits(0x12ff5678, 23, 8, 0x34));
  printf("%s\t\t%d\t\t%d\n", "setbits(0xedcc, 3, 4, 0xb)", 0xedcb,
         setbits(0xedcc, 3, 4, 0xb));
  printf("%s\t\t%d\t\t%d\n", "setbits(0x7c0, 10, 11, 0x7e3)", 0x7e3,
         setbits(0x7c0, 10, 11, 0x7e3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xed1(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    0xec7(%rip),%rsi
lea    0xebc(%rip),%rdx
lea    0xeb7(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x12ff5678,%edi
mov    $0x17,%esi
mov    $0x8,%edx
mov    $0x34,%ecx
call   1040 <setbits@plt>
mov    %eax,%ecx
lea    0xe95(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    $0x12345678,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xedcc,%edi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0xb,%ecx
call   1040 <setbits@plt>
mov    %eax,%ecx
lea    0xe8b(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0xedcb,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x7c0,%edi
mov    $0xa,%esi
mov    $0xb,%edx
mov    $0x7e3,%ecx
call   1040 <setbits@plt>
mov    %eax,%ecx
lea    0xe56(%rip),%rdi
lea    0xe76(%rip),%rsi
mov    $0x7e3,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xedf(%rip),%rsi
lea    0xedd(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rsi
lea    0xece(%rip),%rdx
lea    0xec9(%rip),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x12ff5678,%edi
mov    $0x17,%esi
mov    $0x8,%edx
mov    $0x34,%ecx
call   1040 <setbits@plt>
lea    0xea6(%rip),%rdi
lea    0xea9(%rip),%rsi
mov    $0x12345678,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xedcc,%edi
mov    $0x3,%esi
mov    $0x4,%edx
mov    $0xb,%ecx
call   1040 <setbits@plt>
lea    0xe9c(%rip),%rbx
lea    0xea1(%rip),%rsi
mov    %rbx,%rdi
mov    $0xedcb,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x7c0,%edi
mov    $0xa,%esi
mov    $0xb,%edx
mov    $0x7e3,%ecx
call   1040 <setbits@plt>
lea    0xe8b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7e3,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s\09\09\09\09\09%s\09%s\0A\00"
@.str.1 = [5 x i8] c"Test\00"
@.str.2 = [9 x i8] c"Expected\00"
@.str.3 = [7 x i8] c"Actual\00"
@.str.4 = [5 x i8] c"----\00"
@.str.5 = [9 x i8] c"--------\00"
@.str.6 = [7 x i8] c"------\00"
@.str.7 = [10 x i8] c"%s\09%d\09%d\0A\00"
@.str.8 = [33 x i8] c"setbits(0x12ff5678, 23, 8, 0x34)\00"
@.str.9 = [12 x i8] c"%s\09\09%d\09\09%d\0A\00"
@.str.10 = [27 x i8] c"setbits(0xedcc, 3, 4, 0xb)\00"
@.str.11 = [30 x i8] c"setbits(0x7c0, 10, 11, 0x7e3)\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%4 = call i32 @setbits(i32 318723704, i32 23, i32 8, i32 52)
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 305419896, i32 %4)
%6 = call i32 @setbits(i32 60876, i32 3, i32 4, i32 11)
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 60875, i32 %6)
%8 = call i32 @setbits(i32 1984, i32 10, i32 11, i32 2019)
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i32 2019, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s\09\09\09\09\09%s\09%s\0A\00"
@.str.1 = [5 x i8] c"Test\00"
@.str.2 = [9 x i8] c"Expected\00"
@.str.3 = [7 x i8] c"Actual\00"
@.str.4 = [5 x i8] c"----\00"
@.str.5 = [9 x i8] c"--------\00"
@.str.6 = [7 x i8] c"------\00"
@.str.7 = [10 x i8] c"%s\09%d\09%d\0A\00"
@.str.8 = [33 x i8] c"setbits(0x12ff5678, 23, 8, 0x34)\00"
@.str.9 = [12 x i8] c"%s\09\09%d\09\09%d\0A\00"
@.str.10 = [27 x i8] c"setbits(0xedcc, 3, 4, 0xb)\00"
@.str.11 = [30 x i8] c"setbits(0x7c0, 10, 11, 0x7e3)\00"
define i32 @main() {
%1 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%3 = tail call i32 @setbits(i32 318723704, i32 23, i32 8, i32 52)
%4 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), i32 305419896, i32 %3)
%5 = tail call i32 @setbits(i32 60876, i32 3, i32 4, i32 11)
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i32 60875, i32 %5)
%7 = tail call i32 @setbits(i32 1984, i32 10, i32 11, i32 2019)
%8 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i32 2019, i32 %7)
ret i32 0
}