#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 atoi(char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char *buf;
  buf = (char *)malloc(15);
  if (argc != 2) {
    printf("Incorrect number of inputs!\n");
  } else {
    int num = atoi(argv[1]);
    free(buf);
    if (num > 10) {
      free(buf);
    }
  }
}


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    $0xf,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x3f>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
jmp    11b0 <main+0x70>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0xa,-0x1c(%rbp)
jle    11ab <main+0x6b>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    11b0 <main+0x70>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xf,%edi
call   1050 <malloc@plt>
cmp    $0x2,%ebp
jne    117d <main+0x3d>
mov    %rax,%r14
mov    0x8(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <free@plt>
cmp    $0xb,%ebx
jl     1189 <main+0x49>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    1189 <main+0x49>
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Incorrect number of inputs!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 15)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %27
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %7
%19 = load i8*, i8** %6
%20 = call i32 @free(i8* %19)
%21 = load i32, i32* %7
%22 = icmp sgt i32 %21, 10
br i1 %22, label %23, label %26
23: ; preds = %14
%24 = load i8*, i8** %6
%25 = call i32 @free(i8* %24)
br label %26
26: ; preds = %23, %14
br label %27
27: ; preds = %26, %12
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@str = [28 x i8] c"Incorrect number of inputs!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @malloc(i32 15)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %16
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = tail call i32 @free(i8* %4)
%13 = icmp sgt i32 %11, 10
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = tail call i32 @free(i8* %4)
br label %16
16: ; preds = %8, %14, %6
ret i32 0
}