#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 */
scalar_t__ atoi(char *);
int exp0(int, int);
int exp1(int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int main(int argc, char *argv[]) {
  if (argc == 3) {
    int a = (int)atoi(argv[1]);
    int b = (int)atoi(argv[2]);
    int lhs = exp0(a, b);
    int rhs = exp1(a, b);
    if (lhs == rhs) {
      printf("lhs == rhs: %d\n", lhs);
    } else {
      printf("lhs = %d != rhs = %d\n", lhs, rhs);
    }
  }
  return 0;
}


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)
cmpl   $0x3,-0x8(%rbp)
jne    11d7 <main+0x97>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <exp0@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <exp1@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    11be <main+0x7e>
mov    -0x1c(%rbp),%esi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d2 <main+0x92>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d7 <main+0x97>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x3,%edi
jne    11a2 <main+0x62>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %rax,%r14
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %rax,%rbx
mov    %r14d,%edi
mov    %ebx,%esi
call   1030 <exp0@plt>
mov    %eax,%ebp
mov    %r14d,%edi
mov    %ebx,%esi
call   1050 <exp1@plt>
cmp    %eax,%ebp
jne    1190 <main+0x50>
lea    0xe7b(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11a2 <main+0x62>
lea    0xe79(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"lhs == rhs: %d\0A\00"
@.str.1 = [22 x i8] c"lhs = %d != rhs = %d\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %40
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @atoi(i8* %15)
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i64 @atoi(i8* %20)
%22 = trunc i64 %21 to i32
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = call i32 @exp0(i32 %23, i32 %24)
store i32 %25, i32* %8
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = call i32 @exp1(i32 %26, i32 %27)
store i32 %28, i32* %9
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %35
32: ; preds = %12
%33 = load i32, i32* %8
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %33)
br label %39
35: ; preds = %12
%36 = load i32, i32* %8
%37 = load i32, i32* %9
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %36, i32 %37)
br label %39
39: ; preds = %35, %32
br label %40
40: ; preds = %39, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"lhs == rhs: %d\0A\00"
@.str.1 = [22 x i8] c"lhs = %d != rhs = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @atoi(i8* %6)
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i64 @atoi(i8* %10)
%12 = trunc i64 %11 to i32
%13 = tail call i32 @exp0(i32 %8, i32 %12)
%14 = tail call i32 @exp1(i32 %8, i32 %12)
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %20
18: ; preds = %4
%19 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
br label %20
20: ; preds = %16, %18, %2
ret i32 0
}