#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 *, int *);
void main() {
  int n;
  printf("%s", "Enter the number: ");
  scanf("%d", &n);
  if (n > 0)
    printf("The number %d is positive", n);
  else if (n < 0)
    printf("The number %d is negative", n);
  else
    printf("%s\n", "You entered 0");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
jle    116d <main+0x4d>
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
cmpl   $0x0,-0x4(%rbp)
jge    118d <main+0x6d>
mov    -0x4(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a2 <main+0x82>
lea    0xeb9(%rip),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a7 <main+0x87>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    116f <main+0x3f>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret
js     117f <main+0x4f>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret
lea    0xead(%rip),%rdi
jmp    1166 <main+0x36>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [19 x i8] c"Enter the number: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"The number %d is positive\00"
@.str.4 = [26 x i8] c"The number %d is negative\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@.str.6 = [14 x i8] c"You entered 0\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %7)
br label %18
9: ; preds = %0
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %13)
br label %17
15: ; preds = %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
br label %18
18: ; preds = %17, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [19 x i8] c"Enter the number: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"The number %d is positive\00"
@.str.4 = [26 x i8] c"The number %d is negative\00"
@.str.6 = [14 x i8] c"You entered 0\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %5)
br label %15
9: ; preds = %0
%10 = icmp slt i32 %5, 0
br i1 %10, label %11, label %13
11: ; preds = %9
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %5)
br label %15
13: ; preds = %9
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %15
15: ; preds = %11, %13, %7
ret void
}