#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 /*<<< orphan*/ newmessage;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void channgemessage(char *message1, int size) {
  char newmessage[] = "hare rama";
  if (size > sizeof(newmessage)) {
    for (int i = 0; i < sizeof(newmessage); i++) {
      message1[i] = newmessage[i];
    }
  } else {
    printf("hari bol\n");
  }
}


x86 assembly (clang, -O0):
<channgemessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x16(%rbp)
mov    0xed7(%rip),%ax
mov    %ax,-0xe(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0xa,%rax
jbe    117e <channgemessage+0x6e>
movl   $0x0,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0xa,%rax
jae    1179 <channgemessage+0x69>
movslq -0x1c(%rbp),%rax
mov    -0x16(%rbp,%rax,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114a <channgemessage+0x3a>
jmp    118a <channgemessage+0x7a>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<channgemessage>:
cmp    $0xb,%esi
jb     1129 <channgemessage+0x19>
movabs $0x6d61722065726168,%rax
72 61 6d
mov    %rax,(%rdi)
movw   $0x61,0x8(%rdi)
ret
lea    0xeda(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@__const.channgemessage.newmessage = [10 x i8] c"hare rama\00"
@.str = [10 x i8] c"hari bol\0A\00"
define void @channgemessage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [10 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast [10 x i8]* %5 to i8*
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = icmp ugt i64 %9, 10
br i1 %10, label %11, label %29
11: ; preds = %2
store i32 0, i32* %6
br label %12
12: ; preds = %25, %11
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = icmp ult i64 %14, 10
br i1 %15, label %16, label %28
16: ; preds = %12
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %3
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 %20, i8* %24
br label %25
25: ; preds = %16
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %12
28: ; preds = %12
br label %31
29: ; preds = %2
%30 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %31
31: ; preds = %29, %28
ret void
}

LLVM IR (-O2):
@__const.channgemessage.newmessage = [10 x i8] c"hare rama\00"
@str = [9 x i8] c"hari bol\00"
define void @channgemessage(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp ugt i32 %1, 10
br i1 %3, label %4, label %5
4: ; preds = %2
br label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %4, %5
ret void
}