#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 *, ...);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  int i, *p;
  char str[100], ch;
  printf("Enter a sentence\n");
  for (i = 0; i < 2; i++) {
    scanf("%c", &ch);
    *p = *(&ch);
  }
  if (*p >= 97 && *p <= 122)
    ch = ch - 32;
  printf("String in uppercase is %c", ch);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1178 <main+0x58>
lea    0xed8(%rip),%rdi
lea    -0x81(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x81(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <main+0x20>
mov    -0x10(%rbp),%rax
cmpl   $0x61,(%rax)
jl     11a2 <main+0x82>
mov    -0x10(%rbp),%rax
cmpl   $0x7a,(%rax)
jg     11a2 <main+0x82>
movsbl -0x81(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x81(%rbp)
movsbl -0x81(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter a sentence\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [26 x i8] c"String in uppercase is %c\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [100 x i8]
%4 = alloca i8
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %17
9: ; preds = %6
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = load i32*, i32** %2
store i32 %12, i32* %13
br label %14
14: ; preds = %9
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %6
17: ; preds = %6
%18 = load i32*, i32** %2
%19 = load i32, i32* %18
%20 = icmp sge i32 %19, 97
br i1 %20, label %21, label %30
21: ; preds = %17
%22 = load i32*, i32** %2
%23 = load i32, i32* %22
%24 = icmp sle i32 %23, 122
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 32
%29 = trunc i32 %28 to i8
store i8 %29, i8* %4
br label %30
30: ; preds = %25, %21, %17
%31 = load i8, i8* %4
%32 = sext i8 %31 to i32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %32)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@str = [17 x i8] c"Enter a sentence\00"
define void @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
unreachable
}