#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 madd33(int, int, int, int, int, int);
int /*<<< orphan*/ out_hex(int);
int main() {
  int i = 0;
  int a = 10;
  int b = 15;
  int c = 20;
  int m = 1;
  int n = 2;
  int p = 3;
  int rslt = 0;
  rslt = madd33(a, m, b, n, c, p);
  for (i = 0; i < 8; i++) {
    out_hex((rslt >> (28 - (4 * i))) & 0x0F);
  }
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
movl   $0xf,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x3,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1040 <madd33@plt>
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11bc <main+0x9c>
mov    -0x24(%rbp),%edi
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    $0x1c,%ecx
sub    %eax,%ecx
sar    %cl,%edi
and    $0xf,%edi
call   1030 <out_hex@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118a <main+0x6a>
jmp    11c1 <main+0xa1>
jmp    11c1 <main+0xa1>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
mov    $0x1,%esi
mov    $0xf,%edx
mov    $0x2,%ecx
mov    $0x14,%r8d
mov    $0x3,%r9d
call   1040 <madd33@plt>
mov    %eax,%ebx
mov    %eax,%edi
shr    $0x1c,%edi
call   1030 <out_hex@plt>
mov    %ebx,%edi
shr    $0x18,%edi
and    $0xf,%edi
call   1030 <out_hex@plt>
mov    %ebx,%edi
shr    $0x14,%edi
and    $0xf,%edi
call   1030 <out_hex@plt>
mov    %ebx,%edi
shr    $0x10,%edi
and    $0xf,%edi
call   1030 <out_hex@plt>
mov    %ebx,%edi
shr    $0xc,%edi
and    $0xf,%edi
call   1030 <out_hex@plt>
mov    %ebx,%edi
shr    $0x8,%edi
and    $0xf,%edi
call   1030 <out_hex@plt>
mov    %ebx,%edi
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <out_hex@plt>
and    $0xf,%ebx
mov    %ebx,%edi
call   1030 <out_hex@plt>
nopw   0x0(%rax,%rax,1)
jmp    11b0 <main+0x90>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 10, i32* %3
store i32 15, i32* %4
store i32 20, i32* %5
store i32 1, i32* %6
store i32 2, i32* %7
store i32 3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %3
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = load i32, i32* %8
%16 = call i32 @madd33(i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
store i32 %16, i32* %9
store i32 0, i32* %2
br label %17
17: ; preds = %28, %0
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 8
br i1 %19, label %20, label %31
20: ; preds = %17
%21 = load i32, i32* %9
%22 = load i32, i32* %2
%23 = mul nsw i32 4, %22
%24 = sub nsw i32 28, %23
%25 = ashr i32 %21, %24
%26 = and i32 %25, 15
%27 = call i32 @out_hex(i32 %26)
br label %28
28: ; preds = %20
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %17
31: ; preds = %17
br label %32
32: ; preds = %31, %32
br label %32
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @madd33(i32 10, i32 1, i32 15, i32 2, i32 20, i32 3)
%2 = lshr i32 %1, 28
%3 = tail call i32 @out_hex(i32 %2)
%4 = lshr i32 %1, 24
%5 = and i32 %4, 15
%6 = tail call i32 @out_hex(i32 %5)
%7 = lshr i32 %1, 20
%8 = and i32 %7, 15
%9 = tail call i32 @out_hex(i32 %8)
%10 = lshr i32 %1, 16
%11 = and i32 %10, 15
%12 = tail call i32 @out_hex(i32 %11)
%13 = lshr i32 %1, 12
%14 = and i32 %13, 15
%15 = tail call i32 @out_hex(i32 %14)
%16 = lshr i32 %1, 8
%17 = and i32 %16, 15
%18 = tail call i32 @out_hex(i32 %17)
%19 = lshr i32 %1, 4
%20 = and i32 %19, 15
%21 = tail call i32 @out_hex(i32 %20)
%22 = and i32 %1, 15
%23 = tail call i32 @out_hex(i32 %22)
br label %24
24: ; preds = %0, %24
br label %24
}