#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*/ _exit(int /*<<< orphan*/);
char atoi(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ write(char, char *, int);
int main(int argc, char *argv[]) {
  char texto[13] = {' ', ':', ' ', 'B', 'o', 'm',
                    ' ', 'd', 'i', 'a', '!', '\0'};
  texto[0] = 'A' + atoi(argv[2]) - 1;
  write(atoi(argv[1]), texto, 13);
  printf("oi");
  _exit(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)
mov    0xea3(%rip),%rax
mov    %rax,-0x1d(%rbp)
mov    0xea1(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xe9c(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
movsbl %al,%eax
add    $0x41,%eax
sub    $0x1,%eax
mov    %al,-0x1d(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
lea    -0x1d(%rbp),%rsi
mov    $0xd,%edx
movsbl %al,%edi
call   1040 <write@plt>
lea    0xe5c(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movabs $0x21616964206d,%rax
mov    %rax,0x5(%rsp)
movabs $0x64206d6f42203a20,%rax
6d 20 64
mov    %rax,(%rsp)
mov    0x10(%rsi),%rdi
call   1060 <atoi@plt>
add    $0x40,%al
mov    %al,(%rsp)
mov    0x8(%rbx),%rdi
call   1060 <atoi@plt>
movsbl %al,%edi
mov    %rsp,%rsi
mov    $0xd,%edx
call   1040 <write@plt>
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@__const.main.texto = [13 x i8] c" : Bom dia!\00\00"
@.str = [3 x i8] c"oi\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [13 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [13 x i8]* %6 to i8*
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = call signext i8 @atoi(i8* %10)
%12 = sext i8 %11 to i32
%13 = add nsw i32 65, %12
%14 = sub nsw i32 %13, 1
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
store i8 %15, i8* %16
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call signext i8 @atoi(i8* %19)
%21 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%22 = call i32 @write(i8 signext %20, i8* %21, i32 13)
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.texto = [13 x i8] c" : Bom dia!\00\00"
@.str = [3 x i8] c"oi\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [13 x i8]
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call signext i8 @atoi(i8* %6)
%8 = add i8 %7, 64
store i8 %8, i8* %4
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call signext i8 @atoi(i8* %10)
%12 = call i32 @write(i8 signext %11, i8* %4, i32 13)
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @_exit(i32 0)
unreachable
}