#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 clock_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int CLOCKS_PER_SEC;
int clock();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ make_request(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  int ch, n;
  clock_t s, e, elapse;
  FILE *fp;
  char *result, temp[1024], *fst, *snd;
  do {
    result = (char *)malloc(4096);
    printf(
        "\n1. Addition\n2. Multiplication \n3.Take Backup of File\n4.Exit\n");
    scanf("%d", &ch);
    switch (ch) {
    case 1:
      fst = (char *)malloc(6);
      snd = (char *)malloc(6);
      printf("Enter First no.");
      scanf("%s", fst);
      printf("Enter Second no.");
      scanf("%s", snd);
      strcpy(temp, "add");
      strcat(temp, " ");
      strcat(temp, fst);
      strcat(temp, " ");
      strcat(temp, snd);
      s = clock();
      result = (char *)make_request(temp);
      e = clock();
      elapse = (e - s) * CLOCKS_PER_SEC;
      printf("Time Elapsed = %lu\n", elapse);
      printf("Addition = %s\n", result);
      break;
    case 2:
      fst = (char *)malloc(6);
      snd = (char *)malloc(6);
      printf("Enter First no.");
      scanf("%s", fst);
      printf("Enter Second no.");
      scanf("%s", snd);
      strcpy(temp, "mult");
      strcat(temp, " ");
      strcat(temp, fst);
      strcat(temp, " ");
      strcat(temp, snd);
      s = clock();
      result = (char *)make_request(temp);
      e = clock();
      elapse = (e - s) * CLOCKS_PER_SEC;
      printf("Time Elapsed = %lu\n", elapse);
      printf("Product = %s\n", result);
      break;
    case 3:
      fst = (char *)malloc(100);
      snd = (char *)malloc(100);
      printf("Enter Filepath on server\n");
      scanf("%s", fst);
      printf("Enter filepath to store backup file\n");
      scanf("%s", snd);
      strcpy(temp, "BackUpFile");
      strcat(temp, " ");
      strcat(temp, fst);
      s = clock();
      result = (char *)make_request(temp);
      e = clock();
      elapse = (e - s) * CLOCKS_PER_SEC;
      printf("Time Elapsed = %lu\n", elapse);
      fp = fopen(snd, "w");
      if (fp == NULL) {
        fprintf(stderr, "Can't open Input File");
        exit(1);
      }
      n = fprintf(fp, "%s", result);
      if (n < 0)
        printf("\nUnable to Write in File at local Machine\n");
      else
        printf("\nBackup Successful\n");
      fclose(fp);
      break;
    case 4:
      exit(0);
    default:
      printf("\nInvalid Choice\n");
    }
  } while (ch != 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1000,%edi
call   1090 <malloc@plt>
mov    %rax,-0x38(%rbp)
lea    0xe32(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x459(%rbp)
call   1070 <printf@plt>
mov    -0x459(%rbp),%al
lea    0xe56(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x458(%rbp)
sub    $0x3,%eax
ja     1602 <main+0x452>
mov    -0x458(%rbp),%rax
lea    0xdd9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x6,%edi
call   1090 <malloc@plt>
mov    %rax,-0x448(%rbp)
mov    $0x6,%edi
call   1090 <malloc@plt>
mov    %rax,-0x450(%rbp)
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x448(%rbp),%rsi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x450(%rbp),%rsi
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    -0x440(%rbp),%rdi
lea    0xdcf(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x440(%rbp),%rdi
lea    0xdc0(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x440(%rbp),%rdi
mov    -0x448(%rbp),%rsi
call   10c0 <strcat@plt>
lea    -0x440(%rbp),%rdi
lea    0xd9a(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x440(%rbp),%rdi
mov    -0x450(%rbp),%rsi
call   10c0 <strcat@plt>
mov    $0x0,%al
call   1050 <clock@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x440(%rbp),%rdi
call   1030 <make_request@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1050 <clock@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    0x2cc0(%rip),%rcx
imul   (%rcx),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xd43(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1610 <main+0x460>
mov    $0x6,%edi
call   1090 <malloc@plt>
mov    %rax,-0x448(%rbp)
mov    $0x6,%edi
call   1090 <malloc@plt>
mov    %rax,-0x450(%rbp)
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x448(%rbp),%rsi
lea    0xccd(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x450(%rbp),%rsi
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    -0x440(%rbp),%rdi
lea    0xcd2(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x440(%rbp),%rdi
lea    0xc9a(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x440(%rbp),%rdi
mov    -0x448(%rbp),%rsi
call   10c0 <strcat@plt>
lea    -0x440(%rbp),%rdi
lea    0xc74(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x440(%rbp),%rdi
mov    -0x450(%rbp),%rsi
call   10c0 <strcat@plt>
mov    $0x0,%al
call   1050 <clock@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x440(%rbp),%rdi
call   1030 <make_request@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1050 <clock@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    0x2b9a(%rip),%rcx
imul   (%rcx),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xc1d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xc33(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1610 <main+0x460>
mov    $0x64,%edi
call   1090 <malloc@plt>
mov    %rax,-0x448(%rbp)
mov    $0x64,%edi
call   1090 <malloc@plt>
mov    %rax,-0x450(%rbp)
lea    0xc0c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x448(%rbp),%rsi
lea    0xba7(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xc03(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x450(%rbp),%rsi
lea    0xb84(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    -0x440(%rbp),%rdi
lea    0xbfe(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x440(%rbp),%rdi
lea    0xb74(%rip),%rsi
call   10c0 <strcat@plt>
lea    -0x440(%rbp),%rdi
mov    -0x448(%rbp),%rsi
call   10c0 <strcat@plt>
mov    $0x0,%al
call   1050 <clock@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x440(%rbp),%rdi
call   1030 <make_request@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1050 <clock@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    0x2a9a(%rip),%rcx
imul   (%rcx),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xb1d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x450(%rbp),%rdi
lea    0xb88(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    15a9 <main+0x3f9>
mov    0x2a4a(%rip),%rax
movslq (%rax),%rdi
lea    0xb65(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rdx
lea    0xaa9(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    15df <main+0x42f>
lea    0xb40(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    15ed <main+0x43d>
lea    0xb58(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1060 <fclose@plt>
jmp    1610 <main+0x460>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0xb49(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1615 <main+0x465>
cmpl   $0x4,-0x14(%rbp)
jne    11c9 <main+0x19>
xor    %eax,%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
lea    0xc(%rsp),%r14
lea    0xe13(%rip),%r13
lea    0xe2f(%rip),%rbp
jmp    1217 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
lea    0xf46(%rip),%rdi
call   1050 <puts@plt>
cmpl   $0x4,0xc(%rsp)
je     1553 <main+0x383>
mov    $0x1000,%edi
call   10a0 <malloc@plt>
lea    0xe6e(%rip),%rdi
call   1050 <puts@plt>
lea    0xddc(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1200 <main+0x30>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
mov    $0x6,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    $0x6,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
lea    0xd9e(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xda0(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xd92(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd81(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
lea    0xd7c(%rip),%rsi
call   1040 <strcpy@plt>
mov    %r15,%rdi
lea    0xd71(%rip),%r12
mov    %r12,%rsi
call   10d0 <strcat@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   10d0 <strcat@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   10d0 <strcat@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   10d0 <strcat@plt>
xor    %eax,%eax
call   1060 <clock@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1030 <make_request@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1060 <clock@plt>
sub    %ebx,%eax
mov    0x2cd1(%rip),%rcx
imul   (%rcx),%eax
lea    0xd1c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd20(%rip),%rdi
jmp    153d <main+0x36d>
cs nopw 0x0(%rax,%rax,1)
mov    $0x64,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    $0x64,%edi
call   10a0 <malloc@plt>
mov    %rax,%r14
lea    0xd72(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xd72(%rip),%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0x10(%rsp),%r13
mov    %r13,%rdi
lea    0xcd8(%rip),%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
lea    0xc91(%rip),%rsi
call   10d0 <strcat@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10d0 <strcat@plt>
xor    %eax,%eax
call   1060 <clock@plt>
mov    %rbp,%r15
mov    %eax,%ebp
mov    %r13,%rdi
call   1030 <make_request@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <clock@plt>
sub    %ebp,%eax
mov    0x2c07(%rip),%rcx
imul   (%rcx),%eax
lea    0xc52(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14,%rdi
lea    0xc80(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     156e <main+0x39e>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
test   %eax,%eax
lea    0xce8(%rip),%rdi
lea    0xcf4(%rip),%rax
cmovs  %rax,%rdi
call   1050 <puts@plt>
mov    %rbp,%rdi
call   1070 <fclose@plt>
lea    0xc(%rsp),%r14
lea    0xbb4(%rip),%r13
mov    %r15,%rbp
jmp    120c <main+0x3c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x6,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    $0x6,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
lea    0xb92(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xb94(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xb86(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xb75(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
lea    0xb99(%rip),%rsi
call   1040 <strcpy@plt>
mov    %rbp,%rdi
lea    0xb65(%rip),%r12
mov    %r12,%rsi
call   10d0 <strcat@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10d0 <strcat@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   10d0 <strcat@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
call   10d0 <strcat@plt>
xor    %eax,%eax
call   1060 <clock@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <make_request@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1060 <clock@plt>
sub    %ebx,%eax
mov    0x2ac5(%rip),%rcx
imul   (%rcx),%eax
lea    0xb10(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xb28(%rip),%rdi
mov    %rbp,%rsi
lea    0xadc(%rip),%rbp
xor    %eax,%eax
call   1080 <printf@plt>
jmp    120c <main+0x3c>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x2a63(%rip),%rax
movslq (%rax),%rcx
lea    0xb01(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
call   10f0 <fwrite@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"\0A1. Addition\0A2. Multiplication \0A3.Take Backup of File\0A4.Exit\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Enter First no.\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [17 x i8] c"Enter Second no.\00"
@.str.5 = [4 x i8] c"add\00"
@.str.6 = [2 x i8] c" \00"
@CLOCKS_PER_SEC = global i32 0
@.str.7 = [20 x i8] c"Time Elapsed = %lu\0A\00"
@.str.8 = [15 x i8] c"Addition = %s\0A\00"
@.str.9 = [5 x i8] c"mult\00"
@.str.10 = [14 x i8] c"Product = %s\0A\00"
@.str.11 = [26 x i8] c"Enter Filepath on server\0A\00"
@.str.12 = [37 x i8] c"Enter filepath to store backup file\0A\00"
@.str.13 = [11 x i8] c"BackUpFile\00"
@.str.14 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.15 = [22 x i8] c"Can't open Input File\00"
@.str.16 = [43 x i8] c"\0AUnable to Write in File at local Machine\0A\00"
@.str.17 = [20 x i8] c"\0ABackup Successful\0A\00"
@.str.18 = [17 x i8] c"\0AInvalid Choice\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i8*
%13 = alloca [1024 x i8]
%14 = alloca i8*
%15 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %16
16: ; preds = %154, %2
%17 = call i64 @malloc(i32 4096)
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %12
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%21 = load i32, i32* %6
switch i32 %21, label %151 [
i32 1, label %22
i32 2, label %59
i32 3, label %96
i32 4, label %149
]
22: ; preds = %16
%23 = call i64 @malloc(i32 6)
%24 = inttoptr i64 %23 to i8*
store i8* %24, i8** %14
%25 = call i64 @malloc(i32 6)
%26 = inttoptr i64 %25 to i8*
store i8* %26, i8** %15
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%28 = load i8*, i8** %14
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%31 = load i8*, i8** %15
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%36 = call i32 @strcat(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%38 = load i8*, i8** %14
%39 = call i32 @strcat(i8* %37, i8* %38)
%40 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%41 = call i32 @strcat(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%43 = load i8*, i8** %15
%44 = call i32 @strcat(i8* %42, i8* %43)
%45 = call i32 (...) @clock()
store i32 %45, i32* %8
%46 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%47 = call i64 @make_request(i8* %46)
%48 = inttoptr i64 %47 to i8*
store i8* %48, i8** %12
%49 = call i32 (...) @clock()
store i32 %49, i32* %9
%50 = load i32, i32* %9
%51 = load i32, i32* %8
%52 = sub nsw i32 %50, %51
%53 = load i32, i32* @CLOCKS_PER_SEC
%54 = mul nsw i32 %52, %53
store i32 %54, i32* %10
%55 = load i32, i32* %10
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %55)
%57 = load i8*, i8** %12
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* %57)
br label %153
59: ; preds = %16
%60 = call i64 @malloc(i32 6)
%61 = inttoptr i64 %60 to i8*
store i8* %61, i8** %14
%62 = call i64 @malloc(i32 6)
%63 = inttoptr i64 %62 to i8*
store i8* %63, i8** %15
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%65 = load i8*, i8** %14
%66 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%68 = load i8*, i8** %15
%69 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %68)
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%71 = call i32 @strcpy(i8* %70, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%72 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%73 = call i32 @strcat(i8* %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%75 = load i8*, i8** %14
%76 = call i32 @strcat(i8* %74, i8* %75)
%77 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%78 = call i32 @strcat(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%80 = load i8*, i8** %15
%81 = call i32 @strcat(i8* %79, i8* %80)
%82 = call i32 (...) @clock()
store i32 %82, i32* %8
%83 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%84 = call i64 @make_request(i8* %83)
%85 = inttoptr i64 %84 to i8*
store i8* %85, i8** %12
%86 = call i32 (...) @clock()
store i32 %86, i32* %9
%87 = load i32, i32* %9
%88 = load i32, i32* %8
%89 = sub nsw i32 %87, %88
%90 = load i32, i32* @CLOCKS_PER_SEC
%91 = mul nsw i32 %89, %90
store i32 %91, i32* %10
%92 = load i32, i32* %10
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %92)
%94 = load i8*, i8** %12
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %94)
br label %153
96: ; preds = %16
%97 = call i64 @malloc(i32 100)
%98 = inttoptr i64 %97 to i8*
store i8* %98, i8** %14
%99 = call i64 @malloc(i32 100)
%100 = inttoptr i64 %99 to i8*
store i8* %100, i8** %15
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
%102 = load i8*, i8** %14
%103 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %102)
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0))
%105 = load i8*, i8** %15
%106 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %105)
%107 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%108 = call i32 @strcpy(i8* %107, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%109 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%110 = call i32 @strcat(i8* %109, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%111 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%112 = load i8*, i8** %14
%113 = call i32 @strcat(i8* %111, i8* %112)
%114 = call i32 (...) @clock()
store i32 %114, i32* %8
%115 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%116 = call i64 @make_request(i8* %115)
%117 = inttoptr i64 %116 to i8*
store i8* %117, i8** %12
%118 = call i32 (...) @clock()
store i32 %118, i32* %9
%119 = load i32, i32* %9
%120 = load i32, i32* %8
%121 = sub nsw i32 %119, %120
%122 = load i32, i32* @CLOCKS_PER_SEC
%123 = mul nsw i32 %121, %122
store i32 %123, i32* %10
%124 = load i32, i32* %10
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %124)
%126 = load i8*, i8** %15
%127 = call i32* @fopen(i8* %126, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
store i32* %127, i32** %11
%128 = load i32*, i32** %11
%129 = icmp eq i32* %128, null
br i1 %129, label %130, label %136
130: ; preds = %96
%131 = load i32, i32* @stderr
%132 = sext i32 %131 to i64
%133 = inttoptr i64 %132 to i32*
%134 = call i32 (i32*, i8*, ...) @fprintf(i32* %133, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%135 = call i32 @exit(i32 1)
unreachable
136: ; preds = %96
%137 = load i32*, i32** %11
%138 = load i8*, i8** %12
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %138)
store i32 %139, i32* %7
%140 = load i32, i32* %7
%141 = icmp slt i32 %140, 0
br i1 %141, label %142, label %144
142: ; preds = %136
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.16, i64 0, i64 0))
br label %146
144: ; preds = %136
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0))
br label %146
146: ; preds = %144, %142
%147 = load i32*, i32** %11
%148 = call i32 @fclose(i32* %147)
br label %153
149: ; preds = %16
%150 = call i32 @exit(i32 0)
unreachable
151: ; preds = %16
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.18, i64 0, i64 0))
br label %153
153: ; preds = %151, %146, %59, %22
br label %154
154: ; preds = %153
%155 = load i32, i32* %6
%156 = icmp ne i32 %155, 4
br i1 %156, label %16, label %157
157: ; preds = %154
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"Enter First no.\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [17 x i8] c"Enter Second no.\00"
@.str.5 = [4 x i8] c"add\00"
@.str.6 = [2 x i8] c" \00"
@CLOCKS_PER_SEC = global i32 0
@.str.7 = [20 x i8] c"Time Elapsed = %lu\0A\00"
@.str.8 = [15 x i8] c"Addition = %s\0A\00"
@.str.9 = [5 x i8] c"mult\00"
@.str.10 = [14 x i8] c"Product = %s\0A\00"
@.str.13 = [11 x i8] c"BackUpFile\00"
@.str.14 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.15 = [22 x i8] c"Can't open Input File\00"
@str = [61 x i8] c"\0A1. Addition\0A2. Multiplication \0A3.Take Backup of File\0A4.Exit\00"
@str.19 = [25 x i8] c"Enter Filepath on server\00"
@str.20 = [36 x i8] c"Enter filepath to store backup file\00"
@str.21 = [19 x i8] c"\0ABackup Successful\00"
@str.22 = [42 x i8] c"\0AUnable to Write in File at local Machine\00"
@str.23 = [16 x i8] c"\0AInvalid Choice\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [1024 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
br label %7
7: ; preds = %96, %2
%8 = call i64 @malloc(i32 4096)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
switch i32 %11, label %94 [
i32 1, label %12
i32 2, label %35
i32 3, label %58
i32 4, label %92
]
12: ; preds = %7
%13 = call i64 @malloc(i32 6)
%14 = inttoptr i64 %13 to i8*
%15 = call i64 @malloc(i32 6)
%16 = inttoptr i64 %15 to i8*
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%21 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 @strcat(i8* %6, i8* %14)
%24 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%25 = call i32 @strcat(i8* %6, i8* %16)
%26 = call i32 (...) @clock()
%27 = call i64 @make_request(i8* %6)
%28 = inttoptr i64 %27 to i8*
%29 = call i32 (...) @clock()
%30 = sub nsw i32 %29, %26
%31 = load i32, i32* @CLOCKS_PER_SEC
%32 = mul nsw i32 %30, %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* %28)
br label %96
35: ; preds = %7
%36 = call i64 @malloc(i32 6)
%37 = inttoptr i64 %36 to i8*
%38 = call i64 @malloc(i32 6)
%39 = inttoptr i64 %38 to i8*
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %37)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %39)
%44 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%45 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%46 = call i32 @strcat(i8* %6, i8* %37)
%47 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%48 = call i32 @strcat(i8* %6, i8* %39)
%49 = call i32 (...) @clock()
%50 = call i64 @make_request(i8* %6)
%51 = inttoptr i64 %50 to i8*
%52 = call i32 (...) @clock()
%53 = sub nsw i32 %52, %49
%54 = load i32, i32* @CLOCKS_PER_SEC
%55 = mul nsw i32 %53, %54
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %51)
br label %96
58: ; preds = %7
%59 = call i64 @malloc(i32 100)
%60 = inttoptr i64 %59 to i8*
%61 = call i64 @malloc(i32 100)
%62 = inttoptr i64 %61 to i8*
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.19, i64 0, i64 0))
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %60)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.20, i64 0, i64 0))
%66 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %62)
%67 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%68 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%69 = call i32 @strcat(i8* %6, i8* %60)
%70 = call i32 (...) @clock()
%71 = call i64 @make_request(i8* %6)
%72 = call i32 (...) @clock()
%73 = sub nsw i32 %72, %70
%74 = load i32, i32* @CLOCKS_PER_SEC
%75 = mul nsw i32 %73, %74
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %75)
%77 = call i32* @fopen(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%78 = icmp eq i32* %77, null
br i1 %78, label %79, label %85
79: ; preds = %58
%80 = load i32, i32* @stderr
%81 = sext i32 %80 to i64
%82 = inttoptr i64 %81 to i32*
%83 = call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0), i64 21, i64 1, i32* %82)
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %58
%86 = inttoptr i64 %71 to i8*
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %86)
%88 = icmp slt i32 %87, 0
%89 = select i1 %88, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @str.22, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str.21, i64 0, i64 0)
%90 = call i32 @puts(i8* dereferenceable(1) %89)
%91 = call i32 @fclose(i32* %77)
br label %96
92: ; preds = %7
%93 = call i32 @exit(i32 0)
unreachable
94: ; preds = %7
%95 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.23, i64 0, i64 0))
br label %96
96: ; preds = %12, %35, %85, %94
%97 = load i32, i32* %3
%98 = icmp eq i32 %97, 4
br i1 %98, label %99, label %7
99: ; preds = %96
ret i32 0
}