xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void _exit(int32_t status) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int test4_() {
  MAIN__();
  return 0;
}


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

x86 assembly (clang, -O2):
<test4_>:
push   %rax
xor    %eax,%eax
call   1030 <MAIN__@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test4_() {
%1 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @test4_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_fail() {
  printf("                         _______    ___       __   __ \n             "
         "           |   ____|  /   \\     |  | |  | \n                        "
         "|  |__    /  ^  \\    |  | |  | \n                        |   __|  / "
         " /_\\  \\   |  | |  |\n                        |  |    /  _____  \\  "
         "|  | |  `----.\n                        |__|   /__/     \\__\\ |__| "
         "|_______|\n\n");
}


x86 assembly (clang, -O0):
<print_fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [344 x i8] c" _______ ___ __ __ \0A | ____| / \\ | | | | \0A | |__ / ^ \\ | | | | \0A | __| / /_\\ \\ | | | |\0A | | / _____ \\ | | | `----.\0A |__| /__/ \\__\\ |__| |_______|\0A\0A\00"
define void @print_fail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [343 x i8] c" _______ ___ __ __ \0A | ____| / \\ | | | | \0A | |__ / ^ \\ | | | | \0A | __| / /_\\ \\ | | | |\0A | | / _____ \\ | | | `----.\0A |__| /__/ \\__\\ |__| |_______|\0A\00"
define void @print_fail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([343 x i8], [343 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ sin(double);
float Sin(float angle) { return (float)sin((double)angle); }


x86 assembly (clang, -O0):
<Sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sin>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @Sin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sin(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @Sin(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sin(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int ok_submode(char *side_effect) {
  return strcmp(side_effect, "chgd_major") != 0;
}


x86 assembly (clang, -O0):
<ok_submode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"chgd_major\00"
define i32 @ok_submode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"chgd_major\00"
define i32 @ok_submode(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glb_warning(char *);
void glb_minimizer_error(char error_text[]) { glb_warning(error_text); }


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

x86 assembly (clang, -O2):
<glb_minimizer_error>:
jmp    1030 <glb_warning@plt>

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

LLVM IR (-O2):
define void @glb_minimizer_error(i8* %0) {
%2 = tail call i32 @glb_warning(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int workq_destroy_data_(int *shmid) {
  if (shmctl(*shmid, IPC_RMID, NULL) == -1) {
    perror("shmctl");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<workq_destroy_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    1173 <workq_destroy_data_+0x43>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workq_destroy_data_>:
push   %rax
mov    (%rdi),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <shmctl@plt>
cmp    $0xffffffff,%eax
je     114c <workq_destroy_data_+0x1c>
xor    %eax,%eax
pop    %rcx
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmctl\00"
define i32 @workq_destroy_data_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = load i32, i32* @IPC_RMID
%6 = call i32 @shmctl(i32 %4, i32 %5, i32* null)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"shmctl\00"
define i32 @workq_destroy_data_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = load i32, i32* @IPC_RMID
%4 = tail call i32 @shmctl(i32 %2, i32 %3, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i32 0
}
void do__help(void) {}


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

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

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

LLVM IR (-O2):
define void @do__help() {
ret void
}
int max(int a, int b) {
  if (a <= b)
    return b;
  else
    return a;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <max+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void VIDDummyOnScreenDebugMessage(__attribute((unused)) char *string, ...) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyOnScreenDebugMessage(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void json_free_serialized_string(char *string) { free((void *)(string)); }


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

x86 assembly (clang, -O2):
<json_free_serialized_string>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @json_free_serialized_string(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ cgiWriteInt(int /*<<< orphan*/ *, int);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
int strlen(char *);
int cgiWriteString(FILE *out, char *s) {
  int len = strlen(s);
  cgiWriteInt(out, len);
  if (fwrite(s, 1, len, out) != len) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<cgiWriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <cgiWriteInt@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
cmp    -0x1c(%rbp),%eax
je     1182 <cgiWriteString+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1189 <cgiWriteString+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiWriteString>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <cgiWriteInt@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
xor    %ecx,%ecx
cmp    %ebp,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @cgiWriteString(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @cgiWriteInt(i32* %0, i32 %3)
%5 = tail call i32 @fwrite(i8* %1, i32 1, i32 %3, i32* %0)
%6 = icmp eq i32 %5, %3
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ iothub_service_client_sample_run();
int main(void) {
  iothub_service_client_sample_run();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <iothub_service_client_sample_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <iothub_service_client_sample_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @iothub_service_client_sample_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_service_client_sample_run()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ __set_file_attribute(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
DIR *opendir(const char *dirname) {
  DIR *ret;
  ret = (DIR *)malloc(sizeof(void *));
  if (ret)
    __set_file_attribute(ret);
  return ret;
}


x86 assembly (clang, -O0):
<opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114e <opendir+0x2e>
mov    -0x10(%rbp),%rdi
call   1040 <__set_file_attribute@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendir>:
push   %rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113b <opendir+0x1b>
mov    %rbx,%rdi
call   1040 <__set_file_attribute@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @opendir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = call i32 @__set_file_attribute(i32* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @opendir(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @__set_file_attribute(i32* %3)
br label %7
7: ; preds = %5, %1
ret i32* %3
}
void NEOMOTE_1_isr_RX_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @NEOMOTE_1_isr_RX_Interrupt() {
ret void
}
char *string_to_text(char *str) {
  int i;
  for (i = 1; str[i] != '"'; i++) {
    str[i - 1] = str[i];
  }
  str[i - 1] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<string_to_text>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
je     114d <string_to_text+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <string_to_text+0xf>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_text>:
mov    %rdi,%rax
mov    0x1(%rdi),%dl
cmp    $0x22,%dl
jne    1112 <string_to_text+0x12>
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
lea    0x2(%rax),%rsi
xor    %ecx,%ecx
movabs $0x100000000,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %rdi,%rcx
mov    %dl,-0x2(%rsi)
movzbl (%rsi),%edx
add    $0x1,%rsi
cmp    $0x22,%dl
jne    1130 <string_to_text+0x30>
sar    $0x20,%rcx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @string_to_text(i8* returned %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 34
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 1, %1 ]
%7 = phi i8 [ %12, %5 ], [ %3, %1 ]
%8 = add nsw i64 %6, -1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %7, i8* %9
%10 = add nuw nsw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 34
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = shl i64 %6, 32
%16 = ashr exact i64 %15, 32
br label %17
17: ; preds = %14, %1
%18 = phi i64 [ 0, %1 ], [ %16, %14 ]
%19 = getelementptr inbounds i8, i8* %0, i64 %18
store i8 0, i8* %19
ret i8* %0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void wait(double speed) {
  struct timespec sleep_time;
  sleep_time.tv_sec = 0;
  sleep_time.tv_nsec = (1 / speed) * (1e8 / 100);
  nanosleep(&sleep_time, NULL);
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
sub    $0x18,%rsp
movsd  0xee4(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xee0(%rip),%xmm1
movq   $0x0,0x10(%rsp)
cvttsd2si %xmm1,%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define void @wait(double %0) {
%2 = alloca double
%3 = alloca %struct.timespec
store double %0, double* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %4
%5 = load double, double* %2
%6 = fdiv double 1.000000e+00, %5
%7 = fmul double %6, 1.000000e+06
%8 = fptosi double %7 to i32
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %8, i32* %9
%10 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define void @wait(double %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %4
%5 = fdiv double 1.000000e+00, %0
%6 = fmul double %5, 1.000000e+06
%7 = fptosi double %6 to i32
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
void *malloc(unsigned long);
void *mymalloc(unsigned long int size) {
  void *addr = malloc(size + 32);
  return (void *)((unsigned long int)addr / 16 * 16 + 16);
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x4,%rax
shl    $0x4,%rax
add    $0x10,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %rax
add    $0x20,%rdi
call   1030 <malloc@plt>
add    $0x10,%rax
and    $0xfffffffffffffff0,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 32
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = udiv i64 %8, 16
%10 = mul i64 %9, 16
%11 = add i64 %10, 16
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @mymalloc(i64 %0) {
%2 = add i64 %0, 32
%3 = tail call i8* @malloc(i64 %2)
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 16
%6 = and i64 %5, -16
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int hash_isexist_file(char const *);
int customer_check_file_exist(const char *filepath) {
  return hash_isexist_file(filepath);
}


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

x86 assembly (clang, -O2):
<customer_check_file_exist>:
jmp    1030 <hash_isexist_file@plt>

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

LLVM IR (-O2):
define i32 @customer_check_file_exist(i8* %0) {
%2 = tail call i32 @hash_isexist_file(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ iothub_client_sample_upload_to_blob_run();
int main(void) {
  iothub_client_sample_upload_to_blob_run();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <iothub_client_sample_upload_to_blob_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <iothub_client_sample_upload_to_blob_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @iothub_client_sample_upload_to_blob_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_client_sample_upload_to_blob_run()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fexcept_t;

/* Variables and functions */
int /*<<< orphan*/ fesetexceptflag(int /*<<< orphan*/ *, int);
void nullPointer_fesetexceptflag(int excepts) {
  fexcept_t *flagp = 0;
  (void)fesetexceptflag(flagp, excepts);
  (void)fesetexceptflag(0, excepts);
}


x86 assembly (clang, -O0):
<nullPointer_fesetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <fesetexceptflag@plt>
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fesetexceptflag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullPointer_fesetexceptflag>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <fesetexceptflag@plt>
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <fesetexceptflag@plt>

LLVM IR (-O0):
define void @nullPointer_fesetexceptflag(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %2
%6 = call i32 @fesetexceptflag(i32* %4, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @fesetexceptflag(i32* null, i32 %7)
ret void
}

LLVM IR (-O2):
define void @nullPointer_fesetexceptflag(i32 %0) {
%2 = tail call i32 @fesetexceptflag(i32* null, i32 %0)
%3 = tail call i32 @fesetexceptflag(i32* null, i32 %0)
ret void
}
void XtWarningMsg() {}


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

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

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

LLVM IR (-O2):
define void @XtWarningMsg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ startShowAllLeapYear(int, int);
void showAllLeapYearInAge(int age) {
  int count = 0, i;
  int start = (100 * age) - 99;
  printf("\n***SHOWING ALL LEAP YEAR ON %d AGE.\n", age);
  startShowAllLeapYear(start, 1);
}


x86 assembly (clang, -O0):
<showAllLeapYearInAge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
imul   $0x64,-0x4(%rbp),%eax
sub    $0x63,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%edi
mov    $0x1,%esi
call   1040 <startShowAllLeapYear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showAllLeapYearInAge>:
push   %rbx
mov    %edi,%esi
imul   $0x64,%edi,%ebx
add    $0xffffff9d,%ebx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <startShowAllLeapYear@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\0A***SHOWING ALL LEAP YEAR ON %d AGE.\0A\00"
define void @showAllLeapYearInAge(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%6 = load i32, i32* %2
%7 = mul nsw i32 100, %6
%8 = sub nsw i32 %7, 99
store i32 %8, i32* %5
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %5
%12 = call i32 @startShowAllLeapYear(i32 %11, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0A***SHOWING ALL LEAP YEAR ON %d AGE.\0A\00"
define void @showAllLeapYearInAge(i32 %0) {
%2 = mul nsw i32 %0, 100
%3 = add nsw i32 %2, -99
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @startShowAllLeapYear(i32 %3, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *);
void help_helper(FILE *file, char *basename, char *cmd) {
  fprintf(file, "Usage: %s %s <command>\n\n", basename, cmd);
}


x86 assembly (clang, -O0):
<help_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_helper>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: %s %s <command>\0A\0A\00"
define void @help_helper(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s %s <command>\0A\0A\00"
define void @help_helper(i32* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!!!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello World!!!\0A\00"
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 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello World!!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_02(unsigned int a) { return a >= 0x80000000; }


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80000000,-0x4(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test_02(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, -2147483648
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_02(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void divide_by_zero_handler() {
  printf("\n #####> Exiting on divide by zero !!\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<divide_by_zero_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<divide_by_zero_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0A #####> Exiting on divide by zero !!\0A\00"
define void @divide_by_zero_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [38 x i8] c"\0A #####> Exiting on divide by zero !!\00"
define void @divide_by_zero_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
int multiple(int num) {
  int i, mask = 1, mult = 1;
  for (i = 1; i <= 10; i++, mask <<= 1)
    if ((num & mask) != 0) {
      mult = 0;
      break;
    }
  return mult;
}


x86 assembly (clang, -O0):
<multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     115d <multiple+0x5d>
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1141 <multiple+0x41>
movl   $0x0,-0x10(%rbp)
jmp    115d <multiple+0x5d>
jmp    1146 <multiple+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <multiple+0x1c>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiple>:
xor    %eax,%eax
test   $0x3ff,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @multiple(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %4
store i32 1, i32* %5
store i32 1, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 10
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 0, i32* %5
br label %21
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = shl i32 %19, 1
store i32 %20, i32* %4
br label %6
21: ; preds = %14, %6
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @multiple(i32 %0) {
%2 = and i32 %0, 1023
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void PrintError(const char *argv[]) {
  fprintf(stderr, "%s: %s\n", argv[1], strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<PrintError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<PrintError>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%ebx
mov    0x8(%rdi),%r14
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaa(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @PrintError(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = load i8*, i8** %5
%7 = load i32, i32* @errno
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @PrintError(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ g(int /*<<< orphan*/);
int *malloc(int);
int /*<<< orphan*/ puts(char *);
int main(void) {
  int tamanho = 5;
  int *ponteiro = malloc(tamanho * sizeof *ponteiro);
  g(f(ponteiro));
  if (ponteiro != NULL) {
    free(ponteiro);
  } else {
    puts("Memória insuficiente.");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <f@plt>
mov    %eax,%edi
call   1070 <g@plt>
cmpq   $0x0,-0x10(%rbp)
je     11a2 <main+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    11ae <main+0x5e>
lea    0xe57(%rip),%rdi
call   1040 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <f@plt>
mov    %eax,%edi
call   1070 <g@plt>
test   %rbx,%rbx
je     117c <main+0x2c>
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1188 <main+0x38>
lea    0xe7d(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Mem\C3\B3ria insuficiente.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 5, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i32* @malloc(i32 %7)
store i32* %8, i32** %3
%9 = load i32*, i32** %3
%10 = call i32 @f(i32* %9)
%11 = call i32 @g(i32 %10)
%12 = load i32*, i32** %3
%13 = icmp ne i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %0
%15 = load i32*, i32** %3
%16 = call i32 @free(i32* %15)
br label %19
17: ; preds = %0
%18 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [23 x i8] c"Mem\C3\B3ria insuficiente.\00"
define i32 @main() {
%1 = tail call i32* @malloc(i32 20)
%2 = tail call i32 @f(i32* %1)
%3 = tail call i32 @g(i32 %2)
%4 = icmp eq i32* %1, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @free(i32* %1)
br label %9
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int identify2(char *, int);
int /*<<< orphan*/ printf(char *, ...);
void cmdWho(void) {
  char name[256];
  int err = identify2(name, 256);
  if (err) {
    printf("Erro: %d\n", err);
    return;
  }
  printf("%s\n", name);
}


x86 assembly (clang, -O0):
<cmdWho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
call   1030 <identify2@plt>
mov    %eax,-0x104(%rbp)
cmpl   $0x0,-0x104(%rbp)
je     1168 <cmdWho+0x48>
mov    -0x104(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    117d <cmdWho+0x5d>
lea    -0x100(%rbp),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdWho>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <identify2@plt>
test   %eax,%eax
je     1160 <cmdWho+0x30>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x108,%rsp
ret
mov    %rsp,%rdi
call   1030 <puts@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Erro: %d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @cmdWho() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @identify2(i8* %3, i32 256)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %13
10: ; preds = %0
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Erro: %d\0A\00"
define void @cmdWho() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @identify2(i8* %2, i32 256)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* %2)
br label %9
9: ; preds = %7, %5
ret void
}
void INT_Excep_CAN2_RXM2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN2_RXM2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tml_dr_vAdd3(double const *, double *, double *, int);
void tml_dr_vAdd2(const double *src, double *dst, int n) {
  tml_dr_vAdd3(src, dst, dst, n);
}


x86 assembly (clang, -O0):
<tml_dr_vAdd2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <tml_dr_vAdd3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tml_dr_vAdd2>:
mov    %edx,%ecx
mov    %rsi,%rdx
jmp    1030 <tml_dr_vAdd3@plt>

LLVM IR (-O0):
define void @tml_dr_vAdd2(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = call i32 @tml_dr_vAdd3(double* %7, double* %8, double* %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @tml_dr_vAdd2(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @tml_dr_vAdd3(double* %0, double* %1, double* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *const, int const *const, int const);
int pkcs7unpad(const uint8_t *const padded_message, const int len,
               const int BK_SIZE, uint8_t *const out) {
  if (len % BK_SIZE != 0) {
    return -1;
  }
  const int pad = padded_message[len - 1];
  memcpy(out, padded_message, len - pad);
  return 0;
}


x86 assembly (clang, -O0):
<pkcs7unpad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
cmp    $0x0,%edx
je     1142 <pkcs7unpad+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <pkcs7unpad+0x5f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    -0x24(%rbp),%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkcs7unpad>:
mov    %edx,%r9d
mov    %esi,%r8d
mov    %esi,%eax
cltd
idiv   %r9d
mov    $0xffffffff,%eax
test   %edx,%edx
je     1126 <pkcs7unpad+0x16>
ret
push   %rax
mov    %rdi,%rsi
movslq %r8d,%rax
sub    -0x4(%rdi,%rax,4),%r8d
mov    %rcx,%rdi
mov    %r8d,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @pkcs7unpad(i32* %0, i32 %1, i32 %2, i32* %3) {
%5 = srem i32 %1, %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = add nsw i32 %1, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = sub nsw i32 %1, %11
%13 = tail call i32 @memcpy(i32* %3, i32* %0, i32 %12)
br label %14
14: ; preds = %4, %7
%15 = phi i32 [ 0, %7 ], [ -1, %4 ]
ret i32 %15
}
__attribute__((always_)) char identity_mapping(char c) { return c; }


x86 assembly (clang, -O0):
<identity_mapping>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<identity_mapping>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @identity_mapping(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @identity_mapping(i8 returned signext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ green(char *);
void setup_pins() { green("Setup GPIO\n"); }


x86 assembly (clang, -O0):
<setup_pins>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <green@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Setup GPIO\0A\00"
define void @setup_pins() {
%1 = call i32 @green(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Setup GPIO\0A\00"
define void @setup_pins() {
%1 = tail call i32 @green(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Hero {
  int dummy;
};
struct Ability {
  int dummy;
};

/* Variables and functions */
float damage_RollAttack(struct Hero *);
float ChangPingJun_WuMing_damage(struct Ability *self, struct Hero *attacker,
                                 struct Hero *target) {
  return damage_RollAttack(attacker) * (float)(2.0);
}


x86 assembly (clang, -O0):
<ChangPingJun_WuMing_damage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <damage_RollAttack@plt>
movss  0xecb(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChangPingJun_WuMing_damage>:
push   %rax
mov    %rsi,%rdi
call   1030 <damage_RollAttack@plt>
addss  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define float @ChangPingJun_WuMing_damage(%struct.Ability* %0, %struct.Hero* %1, %struct.Hero* %2) {
%4 = alloca %struct.Ability*
%5 = alloca %struct.Hero*
%6 = alloca %struct.Hero*
store %struct.Ability* %0, %struct.Ability** %4
store %struct.Hero* %1, %struct.Hero** %5
store %struct.Hero* %2, %struct.Hero** %6
%7 = load %struct.Hero*, %struct.Hero** %5
%8 = call float @damage_RollAttack(%struct.Hero* %7)
%9 = fmul float %8, 2.000000e+00
ret float %9
}

LLVM IR (-O2):
%struct.Ability = type { i32 }
%struct.Hero = type { i32 }
define float @ChangPingJun_WuMing_damage(%struct.Ability* nocapture readnone %0, %struct.Hero* %1, %struct.Hero* nocapture readnone %2) {
%4 = tail call float @damage_RollAttack(%struct.Hero* %1)
%5 = fmul float %4, 2.000000e+00
ret float %5
}
int main() {
  __complex__ float res = mycacoshf(1.0);
  if (__imag__ res >= 0.0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
mov    $0x1,%al
call   1040 <mycacoshf@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116a <main+0x4a>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x1,%al
call   1040 <mycacoshf@plt>
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca { float, float }
store i32 0, i32* %1
%3 = call i32 (double, ...) bitcast (i32 (...)* @mycacoshf to i32 (double, ...)*)(double 1.000000e+00)
%4 = sitofp i32 %3 to float
%5 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%6 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %4, float* %5
store float 0.000000e+00, float* %6
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = fcmp oge double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %0
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (double, ...) bitcast (i32 (...)* @mycacoshf to i32 (double, ...)*)(double 1.000000e+00)
tail call void @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ kill_x();
void kill_render() { kill_x(); }


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

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

LLVM IR (-O0):
define void @kill_render() {
%1 = call i32 (...) @kill_x()
ret void
}

LLVM IR (-O2):
define void @kill_render() {
%1 = tail call i32 (...) @kill_x()
ret void
}