#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*/ tprintf(char *, char *);
void send32(int row, int upper) {
  int col;
  char buffer[33];
  for (col = 0; col <= 31; col++) {
    buffer[col] = (char)(row * 32 + upper + col);
  }
  buffer[32] = 0;
  tprintf("%s", buffer);
}


x86 assembly (clang, -O0):
<send32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f,-0xc(%rbp)
jg     1153 <send32+0x43>
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %al,%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <send32+0x15>
movb   $0x0,-0x10(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <tprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send32>:
sub    $0x28,%rsp
shl    $0x5,%edi
add    %esi,%edi
mov    %dil,(%rsp)
movd   %edi,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddb  0xec9(%rip),%xmm0
movdqu %xmm0,0x1(%rsp)
lea    0x11(%rdi),%eax
mov    %al,0x11(%rsp)
lea    0x12(%rdi),%eax
mov    %al,0x12(%rsp)
lea    0x13(%rdi),%eax
mov    %al,0x13(%rsp)
lea    0x14(%rdi),%eax
mov    %al,0x14(%rsp)
lea    0x15(%rdi),%eax
mov    %al,0x15(%rsp)
lea    0x16(%rdi),%eax
mov    %al,0x16(%rsp)
lea    0x17(%rdi),%eax
mov    %al,0x17(%rsp)
lea    0x18(%rdi),%eax
mov    %al,0x18(%rsp)
lea    0x19(%rdi),%eax
mov    %al,0x19(%rsp)
lea    0x1a(%rdi),%eax
mov    %al,0x1a(%rsp)
lea    0x1b(%rdi),%eax
mov    %al,0x1b(%rsp)
lea    0x1c(%rdi),%eax
mov    %al,0x1c(%rsp)
lea    0x1d(%rdi),%eax
mov    %al,0x1d(%rsp)
lea    0x1e(%rdi),%eax
mov    %al,0x1e(%rsp)
lea    0x1f(%rdi),%eax
mov    %al,0x1f(%rsp)
movb   $0x0,0x20(%rsp)
lea    0xe5e(%rip),%rdi
mov    %rsp,%rsi
call   1030 <tprintf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @send32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [33 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 31
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 32
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = trunc i32 %16 to i8
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [33 x i8], [33 x i8]* %6, i64 0, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
%25 = getelementptr inbounds [33 x i8], [33 x i8]* %6, i64 0, i64 32
store i8 0, i8* %25
%26 = getelementptr inbounds [33 x i8], [33 x i8]* %6, i64 0, i64 0
%27 = call i32 @tprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %26)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @send32(i32 %0, i32 %1) {
%3 = alloca [33 x i8]
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%5 = shl nsw i32 %0, 5
%6 = add nsw i32 %5, %1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %4
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 1
%9 = trunc i32 %6 to i8
%10 = insertelement <16 x i8> undef, i8 %9, i64 0
%11 = shufflevector <16 x i8> %10, <16 x i8> poison, <16 x i32> zeroinitializer
%12 = add <16 x i8> %11, <i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16>
%13 = bitcast i8* %8 to <16 x i8>*
store <16 x i8> %12, <16 x i8>* %13
%14 = trunc i32 %6 to i8
%15 = add i8 %14, 17
%16 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 17
store i8 %15, i8* %16
%17 = trunc i32 %6 to i8
%18 = add i8 %17, 18
%19 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 18
store i8 %18, i8* %19
%20 = trunc i32 %6 to i8
%21 = add i8 %20, 19
%22 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 19
store i8 %21, i8* %22
%23 = trunc i32 %6 to i8
%24 = add i8 %23, 20
%25 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 20
store i8 %24, i8* %25
%26 = trunc i32 %6 to i8
%27 = add i8 %26, 21
%28 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 21
store i8 %27, i8* %28
%29 = trunc i32 %6 to i8
%30 = add i8 %29, 22
%31 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 22
store i8 %30, i8* %31
%32 = trunc i32 %6 to i8
%33 = add i8 %32, 23
%34 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 23
store i8 %33, i8* %34
%35 = trunc i32 %6 to i8
%36 = add i8 %35, 24
%37 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 24
store i8 %36, i8* %37
%38 = trunc i32 %6 to i8
%39 = add i8 %38, 25
%40 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 25
store i8 %39, i8* %40
%41 = trunc i32 %6 to i8
%42 = add i8 %41, 26
%43 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 26
store i8 %42, i8* %43
%44 = trunc i32 %6 to i8
%45 = add i8 %44, 27
%46 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 27
store i8 %45, i8* %46
%47 = trunc i32 %6 to i8
%48 = add i8 %47, 28
%49 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 28
store i8 %48, i8* %49
%50 = trunc i32 %6 to i8
%51 = add i8 %50, 29
%52 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 29
store i8 %51, i8* %52
%53 = trunc i32 %6 to i8
%54 = add i8 %53, 30
%55 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 30
store i8 %54, i8* %55
%56 = trunc i32 %6 to i8
%57 = add i8 %56, 31
%58 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 31
store i8 %57, i8* %58
%59 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 32
store i8 0, i8* %59
%60 = call i32 @tprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}