xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strlen(char *);
bool empty(char *str) {
  if (strlen(str) == 0)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    113b <empty+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <empty+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @empty(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strlen(i8* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ terminal_writestring(char *);
int print2() {
  terminal_writestring("2\n");
  return 2;
}


x86 assembly (clang, -O0):
<print2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <terminal_writestring@plt>
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print2>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <terminal_writestring@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"2\0A\00"
define i32 @print2() {
%1 = call i32 @terminal_writestring(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@.str = [3 x i8] c"2\0A\00"
define i32 @print2() {
%1 = tail call i32 @terminal_writestring(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
char **ML_CompleteBuildList(char const *);
char **SV_MapComplete_f(const char *partial) {
  return ML_CompleteBuildList(partial);
}


x86 assembly (clang, -O0):
<SV_MapComplete_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ML_CompleteBuildList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_MapComplete_f>:
jmp    1030 <ML_CompleteBuildList@plt>

LLVM IR (-O0):
define i8** @SV_MapComplete_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8** @ML_CompleteBuildList(i8* %3)
ret i8** %4
}

LLVM IR (-O2):
define i8** @SV_MapComplete_f(i8* %0) {
%2 = tail call i8** @ML_CompleteBuildList(i8* %0)
ret i8** %2
}
int f2(void) { return 12; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    $0xc,%eax
ret

LLVM IR (-O0):
define i32 @f2() {
ret i32 12
}

LLVM IR (-O2):
define i32 @f2() {
ret i32 12
}
/* Variables and functions */
main() {
  void (*a)(int, int), (*b)(int) = 0;
  a = b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca void (i32, i32)*
%2 = alloca void (i32)*
store void (i32)* null, void (i32)** %2
%3 = load void (i32)*, void (i32)** %2
%4 = bitcast void (i32)* %3 to void (i32, i32)*
store void (i32, i32)* %4, void (i32, i32)** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int index_of_env_variable(char *str) {
  int index = 0;
  while (*str) {
    if (*str == '$' && *(str + 1) == '{') {
      return index;
    }
    ++index;
    ++str;
  }
  return -1;
}


x86 assembly (clang, -O0):
<index_of_env_variable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <index_of_env_variable+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
jne    1148 <index_of_env_variable+0x48>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x7b,%eax
jne    1148 <index_of_env_variable+0x48>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <index_of_env_variable+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <index_of_env_variable+0xf>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_of_env_variable>:
xor    %eax,%eax
jmp    111b <index_of_env_variable+0x1b>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x7b,0x1(%rdi,%rax,1)
je     112d <index_of_env_variable+0x2d>
add    $0x1,%rax
movzbl (%rdi,%rax,1),%ecx
cmp    $0x24,%cl
je     1110 <index_of_env_variable+0x10>
test   %cl,%cl
jne    1117 <index_of_env_variable+0x17>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @index_of_env_variable(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %22, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %27
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 36
br i1 %13, label %14, label %22
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 123
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = load i32, i32* %4
store i32 %21, i32* %2
br label %28
22: ; preds = %14, %9
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %3
br label %5
27: ; preds = %5
store i32 -1, i32* %2
br label %28
28: ; preds = %27, %20
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @index_of_env_variable(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i8* [ %0, %1 ], [ %12, %10 ]
%4 = phi i32 [ 0, %1 ], [ %11, %10 ]
%5 = load i8, i8* %3
switch i8 %5, label %10 [
i8 0, label %13
i8 36, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 123
br i1 %9, label %13, label %10
10: ; preds = %2, %6
%11 = add nuw nsw i32 %4, 1
%12 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
13: ; preds = %2, %6
%14 = phi i32 [ %4, %6 ], [ -1, %2 ]
ret i32 %14
}
/* Type definitions */
struct event_base {
  int dummy;
};
typedef void event;
typedef int /*<<< orphan*/ evutil_socket_t;
typedef int /*<<< orphan*/ event_callback_fn;

/* Variables and functions */
struct event *event_new(struct event_base *base, evutil_socket_t fd,
                        short events, event_callback_fn cb, void *ctx) {
  (void)base;
  (void)fd;
  (void)events;
  (void)cb;
  (void)ctx;
  return ((void *)0xdadadada);
}


x86 assembly (clang, -O0):
<event_new>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    $0xdadadada,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_new>:
mov    $0xdadadada,%eax
ret

LLVM IR (-O0):
%struct.event = type opaque
%struct.event_base = type { i32 }
define %struct.event* @event_new(%struct.event_base* %0, i32 %1, i16 signext %2, i32 %3, i8* %4) {
%6 = alloca %struct.event_base*
%7 = alloca i32
%8 = alloca i16
%9 = alloca i32
%10 = alloca i8*
store %struct.event_base* %0, %struct.event_base** %6
store i32 %1, i32* %7
store i16 %2, i16* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load %struct.event_base*, %struct.event_base** %6
%12 = load i32, i32* %7
%13 = load i16, i16* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
ret %struct.event* inttoptr (i64 3671775962 to %struct.event*)
}

LLVM IR (-O2):
%struct.event = type opaque
%struct.event_base = type { i32 }
define %struct.event* @event_new(%struct.event_base* nocapture readnone %0, i32 %1, i16 signext %2, i32 %3, i8* nocapture readnone %4) {
ret %struct.event* inttoptr (i64 3671775962 to %struct.event*)
}
void av_tx_init() {}


x86 assembly (clang, -O0):
<av_tx_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_tx_init>:
ret

LLVM IR (-O0):
define void @av_tx_init() {
ret void
}

LLVM IR (-O2):
define void @av_tx_init() {
ret void
}
void UARTPinMuxSetup(unsigned int instanceNum) {
  if (0 == instanceNum) {
    (*((volatile unsigned int *)((0x44E10000) + (0x970 + ((0) * 0x10))))) =
        ((0x00000010u) | (0x00000020u));
    (*((volatile unsigned int *)((0x44E10000) + (0x974 + ((0) * 0x10))))) =
        (0x00000010u);
  }
}


x86 assembly (clang, -O0):
<UARTPinMuxSetup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    1128 <UARTPinMuxSetup+0x28>
mov    $0x44e10970,%eax
movl   $0x30,(%rax)
mov    $0x44e10974,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTPinMuxSetup>:
test   %edi,%edi
je     1105 <UARTPinMuxSetup+0x5>
ret
movl   $0x30,0x44e10970
movl   $0x10,0x44e10974
ret

LLVM IR (-O0):
define void @UARTPinMuxSetup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 0, %3
br i1 %4, label %5, label %6
5: ; preds = %1
store volatile i32 48, i32* inttoptr (i64 1155598704 to i32*)
store volatile i32 16, i32* inttoptr (i64 1155598708 to i32*)
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @UARTPinMuxSetup(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
store volatile i32 48, i32* inttoptr (i64 1155598704 to i32*)
store volatile i32 16, i32* inttoptr (i64 1155598708 to i32*)
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ atoi(char *);
int main(int argc, char const *argv[]) {
  char str[] = " ";
  if (atoi(str) != 0) {
    return 1;
  }
  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)
mov    0xed3(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <atoi@plt>
cmp    $0x0,%rax
je     1150 <main+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1157 <main+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <atoi@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8]* %6 to i8*
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%9 = call i64 @atoi(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@__const.main.str = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @__const.main.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int check_wchar_unsigned() { return (int)-1 > (int)0; }


x86 assembly (clang, -O0):
<check_wchar_unsigned>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_wchar_unsigned>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @check_wchar_unsigned() {
ret i32 0
}

LLVM IR (-O2):
define i32 @check_wchar_unsigned() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ t1;

/* Variables and functions */
int compute_similarity(int *, int *, int);
int /*<<< orphan*/ printf(char *, int);
void main() {
  int t1[] = {2, 4, 1, 0};
  int t2[] = {1, 4, 4, 4};
  int len = sizeof(t1) / sizeof(t1[0]);
  int sim = compute_similarity(t1, t2, len);
  printf("Simliarity is %d", sim);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x24(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1040 <compute_similarity@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1040 <compute_similarity@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.t1 = [4 x i32] [i32 2, i32 4, i32 1, i32 0]
@__const.main.t2 = [4 x i32] [i32 1, i32 4, i32 4, i32 4]
@.str = [17 x i8] c"Simliarity is %d\00"
define void @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [4 x i32]* %1 to i8*
%6 = bitcast [4 x i32]* %2 to i8*
store i32 4, i32* %3
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @compute_similarity(i32* %7, i32* %8, i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@__const.main.t1 = [4 x i32] [i32 2, i32 4, i32 1, i32 0]
@__const.main.t2 = [4 x i32] [i32 1, i32 4, i32 4, i32 4]
@.str = [17 x i8] c"Simliarity is %d\00"
define void @main() {
%1 = alloca [4 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [4 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @compute_similarity(i32* %5, i32* %6, i32 4)
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ random();
double rand_double(void) { return (double)random() / RAND_MAX; }


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_double() {
%1 = call i64 (...) @random()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_double() {
%1 = tail call i64 (...) @random()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_new() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_new"
         "\n");
}


x86 assembly (clang, -O0):
<pa_tagstruct_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_tagstruct_new>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_tagstruct_new\0A\00"
define i32 @pa_tagstruct_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_tagstruct_new\00"
define i32 @pa_tagstruct_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
void func(void) {
  const char *error_msg = "Resource not available to user.";
  int error_type = 3;
  printf("Error (type %d): %s\n", error_type, error_msg);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
lea    0xf09(%rip),%rdi
lea    0xee2(%rip),%rdx
mov    $0x3,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Resource not available to user.\00"
@.str.1 = [21 x i8] c"Error (type %d): %s\0A\00"
define void @func() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = load i8*, i8** %1
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Resource not available to user.\00"
@.str.1 = [21 x i8] c"Error (type %d): %s\0A\00"
define void @func() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int __u8;
typedef int const __u16;

/* Variables and functions */
__u16 get_unaligned_le16(const void *_ptr) {
  const __u8 *ptr = _ptr;
  return ptr[0] | (ptr[1] << 8);
}


x86 assembly (clang, -O0):
<get_unaligned_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unaligned_le16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_unaligned_le16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_unaligned_le16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ interact_with_port(char *, char, int);
int lift(char *lifter_address, char lift_drop) {
  interact_with_port(lifter_address, 'L', (lift_drop == 'l') ? 0 : 1);
  return 0;
}


x86 assembly (clang, -O0):
<lift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%ecx
mov    $0x1,%edx
xor    %eax,%eax
cmp    $0x6c,%ecx
cmove  %eax,%edx
mov    $0x4c,%esi
call   1030 <interact_with_port@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lift>:
push   %rax
xor    %edx,%edx
cmp    $0x6c,%sil
setne  %dl
mov    $0x4c,%esi
call   1030 <interact_with_port@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lift(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 108
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
%11 = call i32 @interact_with_port(i8* %5, i8 signext 76, i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @lift(i8* %0, i8 signext %1) {
%3 = icmp ne i8 %1, 108
%4 = zext i1 %3 to i32
%5 = tail call i32 @interact_with_port(i8* %0, i8 signext 76, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _SSIBaseValid(int);
void SSIAdvFrameHoldEnable(uint32_t ui32Base) {
  ASSERT(_SSIBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) |= 0x00000400;
}


x86 assembly (clang, -O0):
<SSIAdvFrameHoldEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%ecx
or     $0x400,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIAdvFrameHoldEnable>:
push   %rbx
mov    %edi,%ebx
call   1030 <_SSIBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
orl    $0x400,0x4(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @SSIAdvFrameHoldEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_SSIBaseValid(i32 %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, 1024
store volatile i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @SSIAdvFrameHoldEnable(i32 %0) {
%2 = tail call i32 @_SSIBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = add nsw i32 %0, 4
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1024
store volatile i32 %8, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ values_not_equal_display_error(void *, void *);
void _assert_int_not_equal(const int a, const int b, const char *const file,
                           const int line) {
  if (!values_not_equal_display_error((void *)a, (void *)b)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_int_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movslq -0x4(%rbp),%rdi
movslq -0x8(%rbp),%rsi
call   1040 <values_not_equal_display_error@plt>
cmp    $0x0,%eax
jne    1157 <_assert_int_not_equal+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_int_not_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
movslq %edi,%rdi
movslq %esi,%rsi
call   1040 <values_not_equal_display_error@plt>
test   %eax,%eax
je     113e <_assert_int_not_equal+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

LLVM IR (-O0):
define void @_assert_int_not_equal(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
%15 = call i32 @values_not_equal_display_error(i8* %11, i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %4
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i32 @_fail(i8* %18, i32 %19)
br label %21
21: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
define void @_assert_int_not_equal(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %1 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @values_not_equal_display_error(i8* %6, i8* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = tail call i32 @_fail(i8* %2, i32 %3)
br label %13
13: ; preds = %11, %4
ret void
}
int is_pal(char *str, int start, int end) {
  if (start >= end)
    return 1;
  if (str[start] == str[end])
    return is_pal(str, start + 1, end - 1);
  return 0;
}


x86 assembly (clang, -O0):
<is_pal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     113a <is_pal+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    117e <is_pal+0x6e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1177 <is_pal+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
call   1030 <is_pal@plt>
mov    %eax,-0x4(%rbp)
jmp    117e <is_pal+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pal>:
mov    $0x1,%eax
cmp    %edx,%esi
jge    113b <is_pal+0x3b>
movslq %edx,%r8
movslq %esi,%rdx
add    $0xffffffffffffffff,%r8
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rdi,%rdx,1),%ecx
cmp    0x1(%rdi,%r8,1),%cl
jne    113c <is_pal+0x3c>
add    $0x1,%rdx
lea    -0x1(%r8),%rcx
cmp    %r8,%rdx
mov    %rcx,%r8
jl     1120 <is_pal+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_pal(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 1, i32* %4
br label %34
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %5
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %18, %24
br i1 %25, label %26, label %33
26: ; preds = %12
%27 = load i8*, i8** %5
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
%30 = load i32, i32* %7
%31 = sub nsw i32 %30, 1
%32 = call i32 @is_pal(i8* %27, i32 %29, i32 %31)
store i32 %32, i32* %4
br label %34
33: ; preds = %12
store i32 0, i32* %4
br label %34
34: ; preds = %33, %26, %11
%35 = load i32, i32* %4
ret i32 %35
}

LLVM IR (-O2):
define i32 @is_pal(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %20
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %16
%9 = phi i64 [ %7, %5 ], [ %17, %16 ]
%10 = phi i64 [ %6, %5 ], [ %18, %16 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = add nsw i64 %9, 1
%18 = add nsw i64 %10, -1
%19 = icmp slt i64 %17, %18
br i1 %19, label %8, label %20
20: ; preds = %16, %8, %3
%21 = phi i32 [ 1, %3 ], [ 0, %8 ], [ 1, %16 ]
ret i32 %21
}
signed long long int
signedlonglongint_ignoring_unsignedint(signed long long int x, unsigned int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedlonglongint_ignoring_unsignedint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedlonglongint_ignoring_unsignedint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlonglongint_ignoring_unsignedint(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglongint_ignoring_unsignedint(i64 returned %0, i32 %1) {
ret i64 %0
}
/* Variables and functions */
int scanw(char *, char *);
int s_scanw(char *fmt, char *string) { return (scanw(fmt, string)); }


x86 assembly (clang, -O0):
<s_scanw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <scanw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_scanw>:
jmp    1030 <scanw@plt>

LLVM IR (-O0):
define i32 @s_scanw(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @scanw(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @s_scanw(i8* %0, i8* %1) {
%3 = tail call i32 @scanw(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ MALLOC(int);
int /*<<< orphan*/ filename_convert(char *, char const *, int);
int strlen(char const *);
char *gen_local_filename(const char *filename) {
  int l = strlen(filename);
  char *dst = (char *)MALLOC(l + 1);
  filename_convert(dst, filename, l);
  return dst;
}


x86 assembly (clang, -O0):
<gen_local_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <MALLOC@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <filename_convert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_local_filename>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    0x1(%r15),%edi
call   1050 <MALLOC@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <filename_convert@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @gen_local_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i64 @MALLOC(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = call i32 @filename_convert(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @gen_local_filename(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @MALLOC(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @filename_convert(i8* %5, i8* %0, i32 %2)
ret i8* %5
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("EOF: %d\n", EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"EOF: %d\0A\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @EOF
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"EOF: %d\0A\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
unsigned long long fibonacci(unsigned int n) {
  if (0 == n || 1 == n) {
    return n;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
je     1134 <fibonacci+0x24>
mov    $0x1,%eax
cmp    -0xc(%rbp),%eax
jne    1140 <fibonacci+0x30>
mov    -0xc(%rbp),%eax
mov    %rax,-0x8(%rbp)
jmp    1168 <fibonacci+0x58>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %r14d,%r14d
cmp    $0x2,%edi
jb     1133 <fibonacci+0x23>
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    $0xfffffffe,%ebx
add    %rax,%r14
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
mov    %ebx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @fibonacci(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 0, %4
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 1, %7
br i1 %8, label %9, label %12
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
store i64 %11, i64* %2
br label %20
12: ; preds = %6
%13 = load i32, i32* %3
%14 = sub i32 %13, 1
%15 = call i64 @fibonacci(i32 %14)
%16 = load i32, i32* %3
%17 = sub i32 %16, 2
%18 = call i64 @fibonacci(i32 %17)
%19 = add i64 %15, %18
store i64 %19, i64* %2
br label %20
20: ; preds = %12, %9
%21 = load i64, i64* %2
ret i64 %21
}

LLVM IR (-O2):
define i64 @fibonacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %8
3: ; preds = %8, %1
%4 = phi i64 [ 0, %1 ], [ %14, %8 ]
%5 = phi i32 [ %0, %1 ], [ %13, %8 ]
%6 = zext i32 %5 to i64
%7 = add i64 %4, %6
ret i64 %7
8: ; preds = %1, %8
%9 = phi i32 [ %13, %8 ], [ %0, %1 ]
%10 = phi i64 [ %14, %8 ], [ 0, %1 ]
%11 = add i32 %9, -1
%12 = tail call i64 @fibonacci(i32 %11)
%13 = add i32 %9, -2
%14 = add i64 %12, %10
%15 = icmp ult i32 %13, 2
br i1 %15, label %3, label %8
}
/* Variables and functions */
int CLOCKS_PER_SEC;
scalar_t__ clock();
double cputime(void) {
  double t;
  t = CLOCKS_PER_SEC / 100000.;
  t += (double)clock();
  return t / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<cputime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xed5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2e92(%rip),%rax
cvtsi2sdl (%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cputime>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ecc(%rip),%rbx
cvtsi2sdl (%rbx),%xmm0
divsd  0xed8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <clock@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
cvtsi2sdl (%rbx),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define double @cputime() {
%1 = alloca double
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.000000e+05
store double %4, double* %1
%5 = call i64 (...) @clock()
%6 = sitofp i64 %5 to double
%7 = load double, double* %1
%8 = fadd double %7, %6
store double %8, double* %1
%9 = load double, double* %1
%10 = load i32, i32* @CLOCKS_PER_SEC
%11 = sitofp i32 %10 to double
%12 = fdiv double %9, %11
ret double %12
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define double @cputime() {
%1 = load i32, i32* @CLOCKS_PER_SEC
%2 = sitofp i32 %1 to double
%3 = fdiv double %2, 1.000000e+05
%4 = tail call i64 (...) @clock()
%5 = sitofp i64 %4 to double
%6 = fadd double %3, %5
%7 = load i32, i32* @CLOCKS_PER_SEC
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
ret double %9
}
int f(int a) {
  int bb = 12;
  return a + bb;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 12, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 12
ret i32 %2
}
void foo015(int p) {}


x86 assembly (clang, -O0):
<foo015>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo015>:
ret

LLVM IR (-O0):
define void @foo015(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo015(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int dxl_read_byte(int, int);
int getCurrentVoltage(int Id) {
  int CurrentVolt;
  CurrentVolt = dxl_read_byte(Id, 42);
  PrintErrorCode();
  return CurrentVolt;
}


x86 assembly (clang, -O0):
<getCurrentVoltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2a,%esi
call   1040 <dxl_read_byte@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PrintErrorCode@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentVoltage>:
push   %rbx
mov    $0x2a,%esi
call   1040 <dxl_read_byte@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <PrintErrorCode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getCurrentVoltage(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @dxl_read_byte(i32 %4, i32 42)
store i32 %5, i32* %3
%6 = call i32 (...) @PrintErrorCode()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @getCurrentVoltage(i32 %0) {
%2 = tail call i32 @dxl_read_byte(i32 %0, i32 42)
%3 = tail call i32 (...) @PrintErrorCode()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int sysapi_strempty(char *string) {
  return string ? (!strcmp(string, "") ? 1 : 0) : 1;
}


x86 assembly (clang, -O0):
<sysapi_strempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <sysapi_strempty+0x45>
mov    -0x8(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %dl
xor    $0xff,%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <sysapi_strempty+0x52>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <sysapi_strempty+0x52>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysapi_strempty>:
test   %rdi,%rdi
je     110e <sysapi_strempty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @sysapi_strempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %5
%14 = phi i32 [ %11, %5 ], [ 1, %12 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @sysapi_strempty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 1, %1 ]
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int sprintf(char *, char *, int);
int write(int, char *, size_t);
int put_pid(int fd, pid_t pid) {
  char buf[32];
  int len;
  len = sprintf(buf, "%10d\n", (int)pid);
  return write(fd, buf, (size_t)len) == len;
}


x86 assembly (clang, -O0):
<put_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec0(%rip),%rsi
call   1040 <sprintf@plt>
mov    %eax,-0x34(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
movslq -0x34(%rbp),%rdx
call   1030 <write@plt>
cmp    -0x34(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_pid>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rdx
mov    %edi,%ebp
lea    0xecc(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
movslq %eax,%rbx
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%10d\0A\00"
define i32 @put_pid(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca [32 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = call i32 @write(i32 %11, i8* %12, i64 %14)
%16 = load i32, i32* %6
%17 = icmp eq i32 %15, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@.str = [6 x i8] c"%10d\0A\00"
define i32 @put_pid(i32 %0, i64 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = trunc i64 %1 to i32
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = sext i32 %6 to i64
%8 = call i32 @write(i32 %0, i8* %4, i64 %7)
%9 = icmp eq i32 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int ladoquad, area, dobarea;
  printf("Digite o valor do lado do quadrado!\n");
  scanf("%d", &ladoquad);
  area = ladoquad * ladoquad;
  dobarea = (area * 2);
  printf("O dobro da Área vale %d\n", dobarea);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
imul   %esi,%esi
add    %esi,%esi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Digite o valor do lado do quadrado!\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"O dobro da \C3\81rea vale %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 2
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"O dobro da \C3\81rea vale %d\0A\00"
@str = [36 x i8] c"Digite o valor do lado do quadrado!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = shl i32 %5, 1
%7 = mul i32 %6, %5
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
char *hello();
char *ext_hello() { return hello(); }


x86 assembly (clang, -O0):
<ext_hello>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <hello@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_hello>:
xor    %eax,%eax
jmp    1030 <hello@plt>

LLVM IR (-O0):
define i8* @ext_hello() {
%1 = call i8* (...) @hello()
ret i8* %1
}

LLVM IR (-O2):
define i8* @ext_hello() {
%1 = tail call i8* (...) @hello()
ret i8* %1
}
/* Variables and functions */
char const *u8charcc(char const *);
const char *u8charc(char *str) { return u8charcc((const char *)str); }


x86 assembly (clang, -O0):
<u8charc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8charcc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8charc>:
jmp    1030 <u8charcc@plt>

LLVM IR (-O0):
define i8* @u8charc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @u8charcc(i8* %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @u8charc(i8* %0) {
%2 = tail call i8* @u8charcc(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprimeVetor(float dadosImp[]) {
  int posicao;
  for (posicao = 0; posicao < 16 * 2; posicao++) {
    printf("%2.2f ", dadosImp[posicao]);
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<imprimeVetor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    115a <imprimeVetor+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <imprimeVetor+0x13>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimeVetor>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movss  (%r15,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1140 <imprimeVetor+0x20>
lea    0xea2(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%2.2f \00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @imprimeVetor(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%2.2f \00"
@str = [2 x i8] c"\0A\00"
define void @imprimeVetor(float* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %8, %2 ]
%4 = getelementptr inbounds float, float* %0, i64 %3
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %6)
%8 = add nuw nsw i64 %3, 1
%9 = icmp eq i64 %8, 32
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}