xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ xcb_property_notify_event_t;
struct xcbc_info {
  int dummy;
};

/* Variables and functions */
void handle_property_notify(struct xcbc_info *xci,
                            xcb_property_notify_event_t *pne) {
  return;
}


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

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

LLVM IR (-O0):
%struct.xcbc_info = type { i32 }
define void @handle_property_notify(%struct.xcbc_info* %0, i32* %1) {
%3 = alloca %struct.xcbc_info*
%4 = alloca i32*
store %struct.xcbc_info* %0, %struct.xcbc_info** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
%struct.xcbc_info = type { i32 }
define void @handle_property_notify(%struct.xcbc_info* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
void *malloc(unsigned int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned int);
void *calloc(size_t nmemb, size_t size) {
  unsigned int nbytes = nmemb * size;
  void *p = malloc(nbytes);
  memset(p, 0, nbytes);
  return p;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %edi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = call i32 @memset(i8* %13, i32 0, i32 %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = trunc i64 %3 to i32
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @memset(i8* %5, i32 0, i32 %4)
ret i8* %5
}
void INT_Excep_PERIA_INTA224(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA224() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void msgbox2(char *title, char *msg) {
  printf("msgbox(title='%s', msg='%s')\n", title, msg);
}


x86 assembly (clang, -O0):
<msgbox2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgbox2>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"msgbox(title='%s', msg='%s')\0A\00"
define void @msgbox2(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 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"msgbox(title='%s', msg='%s')\0A\00"
define void @msgbox2(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *ripemd128_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_ripemd128(unsigned char *out, FILE *fp) {
  return ripemd128_file(out, fp);
}


x86 assembly (clang, -O0):
<hash_file_ripemd128>:
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 <ripemd128_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_file_ripemd128>:
jmp    1030 <ripemd128_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_ripemd128(i8* %0, i32* %1) {
%3 = tail call i8* @ripemd128_file(i8* %0, i32* %1)
ret i8* %3
}
void reverseString(char *a, char *b) {
  char temp = ' ';
  while (a < b) {
    temp = *a;
    *a = *b;
    *b = temp;
    a++;
    b--;
  }
}


x86 assembly (clang, -O0):
<reverseString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x20,-0x11(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1159 <reverseString+0x59>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <reverseString+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseString>:
cmp    %rsi,%rdi
jae    112c <reverseString+0x2c>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl -0x1(%rdi),%eax
movzbl (%rsi),%ecx
mov    %cl,-0x1(%rdi)
mov    %al,(%rsi)
add    $0xffffffffffffffff,%rsi
lea    0x1(%rdi),%rax
cmp    %rsi,%rdi
mov    %rax,%rdi
jb     1110 <reverseString+0x10>
ret

LLVM IR (-O0):
define void @reverseString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8 32, i8* %5
br label %6
6: ; preds = %10, %2
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = icmp ult i8* %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
store i8 %12, i8* %5
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
store i8 %14, i8* %15
%16 = load i8, i8* %5
%17 = load i8*, i8** %4
store i8 %16, i8* %17
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 -1
store i8* %21, i8** %4
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @reverseString(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %1, %2 ]
%6 = phi i8* [ %9, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = load i8, i8* %5
store i8 %8, i8* %6
store i8 %7, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 -1
%11 = icmp ult i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
int occampi_placedpar_post_setup(void) { return 0; }


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

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

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

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

/* Variables and functions */
int open_dump(FILE *f) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @open_dump(i32* nocapture readnone %0) {
ret i32 0
}
int ti_wma_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_wma_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_wma_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_wma_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_wma_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("\nUsage: %s <get | set>\n"
         "  get - display the contents of the NTP Sync Timestamp to 'stdout'.\n"
         "  set - record now time to POT partition as a NTP Sync Timestamp,\n"
         "        if thers is a NTP Sync Timestamp existed yet, just display\n"
         "        it without any write action.\n",
         name);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [262 x i8] c"\0AUsage: %s <get | set>\0A get - display the contents of the NTP Sync Timestamp to 'stdout'.\0A set - record now time to POT partition as a NTP Sync Timestamp,\0A if thers is a NTP Sync Timestamp existed yet, just display\0A it without any write action.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [262 x i8] c"\0AUsage: %s <get | set>\0A get - display the contents of the NTP Sync Timestamp to 'stdout'.\0A set - record now time to POT partition as a NTP Sync Timestamp,\0A if thers is a NTP Sync Timestamp existed yet, just display\0A it without any write action.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int min_write(char const *, int);
int strlen(char const *);
int min_putstr(const char *str) {
  int len = strlen(str);
  return min_write(str, len);
}


x86 assembly (clang, -O0):
<min_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <min_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <min_write@plt>

LLVM IR (-O0):
define i32 @min_putstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @min_write(i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @min_putstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @min_write(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int OpenFile(char const *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ read(int, char *, int);
int OpenReadFile(const char *filepath, int flag) {
  int fd;
  char buf[10];
  fd = OpenFile(filepath, flag);
  read(fd, buf, 10);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<OpenReadFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <OpenFile@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x1a(%rbp),%rsi
mov    $0xa,%edx
call   1050 <read@plt>
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenReadFile>:
push   %rbx
sub    $0x10,%rsp
call   1030 <OpenFile@plt>
mov    %eax,%ebx
lea    0x6(%rsp),%rsi
mov    %eax,%edi
mov    $0xa,%edx
call   1050 <read@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @OpenReadFile(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @OpenFile(i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%12 = call i32 @read(i32 %10, i8* %11, i32 10)
%13 = load i32, i32* %5
%14 = call i32 @close(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @OpenReadFile(i8* %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @OpenFile(i8* %0, i32 %1)
%6 = call i32 @read(i32 %5, i8* %4, i32 10)
%7 = tail call i32 @close(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXT_SYM_SIZE(void *, int *, int *);
void gtxt_ext_sym_get_size(void *ext_sym, int *width, int *height) {
  EXT_SYM_SIZE(ext_sym, width, height);
}


x86 assembly (clang, -O0):
<gtxt_ext_sym_get_size>:
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),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <EXT_SYM_SIZE@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtxt_ext_sym_get_size>:
jmp    1030 <EXT_SYM_SIZE@plt>

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

LLVM IR (-O2):
define void @gtxt_ext_sym_get_size(i8* %0, i32* %1, i32* %2) {
%4 = tail call i32 @EXT_SYM_SIZE(i8* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_sqrt_flt(float *, float);
float xil_fpo_sqrt_flt(float a) {
  float res_flt;
  xip_fpo_sqrt_flt(&res_flt, a);
  return res_flt;
}


x86 assembly (clang, -O0):
<xil_fpo_sqrt_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <xip_fpo_sqrt_flt@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_sqrt_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_sqrt_flt@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xil_fpo_sqrt_flt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 @xip_fpo_sqrt_flt(float* %3, float %4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @xil_fpo_sqrt_flt(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @xip_fpo_sqrt_flt(float* %2, float %0)
%5 = load float, float* %2
ret float %5
}
void *dupInt(void *ptr) {
  int *new_ptr = wmalloc(sizeof(int));
  *new_ptr = *(int *)ptr;
  return new_ptr;
}


x86 assembly (clang, -O0):
<dupInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
mov    $0x0,%al
call   1030 <wmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupInt>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
xor    %eax,%eax
call   1030 <wmalloc@plt>
cltq
mov    (%rbx),%ecx
mov    %ecx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @dupInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32 (i64, ...) bitcast (i32 (...)* @wmalloc to i32 (i64, ...)*)(i64 4)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = bitcast i32* %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @dupInt(i8* nocapture %0) {
%2 = tail call i32 (i64, ...) bitcast (i32 (...)* @wmalloc to i32 (i64, ...)*)(i64 4)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = inttoptr i64 %3 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ debug_warning(char *);
int /*<<< orphan*/ h_free(void *);
void component_editor_cursor_free(void *handle) {
  if (!handle) {
    debug_warning("[component_editor_cursor_free] handle cannot be NULL");
    return;
  }
  h_free(handle);
}


x86 assembly (clang, -O0):
<component_editor_cursor_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <component_editor_cursor_free+0x28>
lea    0xec2(%rip),%rdi
call   1040 <debug_warning@plt>
jmp    1151 <component_editor_cursor_free+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <h_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<component_editor_cursor_free>:
test   %rdi,%rdi
je     112a <component_editor_cursor_free+0xa>
jmp    1030 <h_free@plt>
lea    0xecf(%rip),%rdi
jmp    1040 <debug_warning@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"[component_editor_cursor_free] handle cannot be NULL\00"
define void @component_editor_cursor_free(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 %7, label %5
5: ; preds = %1
%6 = call i32 @debug_warning(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @h_free(i8* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"[component_editor_cursor_free] handle cannot be NULL\00"
define void @component_editor_cursor_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @debug_warning(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @h_free(i8* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1();
int /*<<< orphan*/ main2();
int /*<<< orphan*/ main3(int);
int main(void) {
  int i;
  check_vect();
  main1();
  main2();
  main3(256 - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    $0x0,%al
call   1050 <main1@plt>
mov    $0x0,%al
call   1060 <main2@plt>
mov    $0xff,%edi
call   1040 <main3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
xor    %eax,%eax
call   1050 <main1@plt>
xor    %eax,%eax
call   1060 <main2@plt>
mov    $0xff,%edi
call   1040 <main3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @check_vect()
%4 = call i32 (...) @main1()
%5 = call i32 (...) @main2()
%6 = call i32 @main3(i32 255)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 (...) @main1()
%3 = tail call i32 (...) @main2()
%4 = tail call i32 @main3(i32 255)
ret i32 0
}
int main(void) {
  "a" <= 'a';
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
size_t tolower(int);
void __attribute((always_)) re_set_fastmap(char *fastmap, int icase, int ch) {
  fastmap[ch] = 1;
  if (icase)
    fastmap[tolower(ch)] = 1;
}


x86 assembly (clang, -O0):
<re_set_fastmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
cmpl   $0x0,-0xc(%rbp)
je     1153 <re_set_fastmap+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <tolower@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_set_fastmap>:
push   %rbx
movslq %edx,%rax
movb   $0x1,(%rdi,%rax,1)
test   %esi,%esi
je     112a <re_set_fastmap+0x1a>
mov    %rdi,%rbx
mov    %edx,%edi
call   1030 <tolower@plt>
movb   $0x1,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @re_set_fastmap(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 1, i8* %5
%6 = icmp eq i32 %1, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i64 @tolower(i32 %2)
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 1, i8* %9
br label %10
10: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void ifTest() {
  int x = 0;
  if (2 == 3)
    x = 4;
  assert(x == 4);
}


x86 assembly (clang, -O0):
<ifTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifTest>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @ifTest() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 4
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret void
}

LLVM IR (-O2):
define void @ifTest() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_shell_comment_entities();
int /*<<< orphan*/ test_shell_comments();
void all_shell_tests() {
  test_shell_comments();
  test_shell_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_shell_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_shell_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_shell_comment_entities@plt>

LLVM IR (-O0):
define void @all_shell_tests() {
%1 = call i32 (...) @test_shell_comments()
%2 = call i32 (...) @test_shell_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_shell_tests() {
%1 = tail call i32 (...) @test_shell_comments()
%2 = tail call i32 (...) @test_shell_comment_entities()
ret void
}
int msm_bus_axi_porthalt(int master_port) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_bus_axi_porthalt(i32 %0) {
ret i32 0
}
float Maxf(float a, float b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<Maxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <Maxf+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <Maxf+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Maxf>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Maxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @Maxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int misc_strftime(char *out, int len, char *fmt) {
  time_t tv;
  struct tm tm;
  time(&tv);
  localtime_r(&tv, &tm);
  return strftime(out, len, fmt, &tm);
}


x86 assembly (clang, -O0):
<misc_strftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <time@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<misc_strftime>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   1040 <time@plt>
lea    0x8(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <localtime_r@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %r12,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @misc_strftime(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.tm
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = call i32 @time(i32* %7)
%10 = call i32 @localtime_r(i32* %7, %struct.tm* %8)
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = call i32 @strftime(i8* %11, i32 %12, i8* %13, %struct.tm* %8)
ret i32 %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @misc_strftime(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.tm
%6 = bitcast i32* %4 to i8*
%7 = bitcast %struct.tm* %5 to i8*
%8 = call i32 @time(i32* %4)
%9 = call i32 @localtime_r(i32* %4, %struct.tm* %5)
%10 = call i32 @strftime(i8* %0, i32 %1, i8* %2, %struct.tm* %5)
ret i32 %10
}
int dec128_is754version1985(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dec128_is754version1985() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ p_memsz;
  int /*<<< orphan*/ p_vaddr;
};
typedef TYPE_1__ Elf32_Phdr;

/* Variables and functions */
int /*<<< orphan*/ munmap_guest(int /*<<< orphan*/, int /*<<< orphan*/);
void unmapSegment(int fd, Elf32_Phdr *segment) {
  munmap_guest(segment->p_vaddr, segment->p_memsz);
}


x86 assembly (clang, -O0):
<unmapSegment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <munmap_guest@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmapSegment>:
mov    (%rsi),%eax
mov    0x4(%rsi),%edi
mov    %eax,%esi
jmp    1030 <munmap_guest@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define void @unmapSegment(i32 %0, %struct.TYPE_3__* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_3__*
store i32 %0, i32* %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @munmap_guest(i32 %7, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
define void @unmapSegment(i32 %0, %struct.TYPE_3__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @munmap_guest(i32 %4, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned int increment(unsigned int, unsigned int, unsigned int);
unsigned int ringbuffer_increment(unsigned int a, unsigned int delta,
                                  unsigned int begin, unsigned int end) {
  assert(end >= begin);
  assert(a >= begin);
  return increment(a - begin, delta, end - begin) + begin;
}


x86 assembly (clang, -O0):
<ringbuffer_increment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    -0xc(%rbp),%edx
call   1030 <increment@plt>
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ringbuffer_increment>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%r15d
mov    %esi,%r14d
mov    %edi,%ebx
xor    %edi,%edi
sub    %edx,%ebp
setae  %dil
call   1040 <assert@plt>
xor    %edi,%edi
sub    %r15d,%ebx
setae  %dil
call   1040 <assert@plt>
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <increment@plt>
add    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ringbuffer_increment(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %7
%11 = icmp uge i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = icmp uge i32 %14, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = sub i32 %19, %20
%22 = load i32, i32* %6
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = sub i32 %23, %24
%26 = call i32 @increment(i32 %21, i32 %22, i32 %25)
%27 = load i32, i32* %7
%28 = add i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ringbuffer_increment(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp uge i32 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp uge i32 %0, %2
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = sub i32 %0, %2
%12 = sub i32 %3, %2
%13 = tail call i32 @increment(i32 %11, i32 %1, i32 %12)
%14 = add i32 %13, %2
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  p = realloc(p, size);
  if (p == NULL) {
    perror("realloc() failed");
    exit(EXIT_FAILURE);
    ;
  }
  return p;
}


x86 assembly (clang, -O0):
<xrealloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1176 <xrealloc+0x46>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rax
call   1030 <realloc@plt>
test   %rax,%rax
je     113d <xrealloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"realloc() failed\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int foo(int *);
int main(void) {
  int **p = 0;
  return foo(*p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32* undef)
ret i32 %1
}
void clear_app_setting_bit_for_32bit_apps(void) {}


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

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

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

LLVM IR (-O2):
define void @clear_app_setting_bit_for_32bit_apps() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *ltrim(char *s) {
  while (isspace(*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <ltrim+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ltrim+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <ltrim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ltrim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @ltrim(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ memcpy(void *, void const *, size_t);
void *__mempcpy(void *dstpp, const void *srcpp, size_t len) {
  return (void *)((char *)memcpy(dstpp, srcpp, len) + len);
}


x86 assembly (clang, -O0):
<__mempcpy>:
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),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mempcpy>:
push   %rbx
mov    %rdx,%rbx
call   1030 <memcpy@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__mempcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @memcpy(i8* %7, i8* %8, i64 %9)
%11 = inttoptr i64 %10 to i8*
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8, i8* %11, i64 %12
ret i8* %13
}

LLVM IR (-O2):
define i8* @__mempcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @memcpy(i8* %0, i8* %1, i64 %2)
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 %2
ret i8* %6
}
__attribute__((vector_size(16))) int fa(void) {
  return (__attribute__((vector_size(16))) int){1, 1, 0, 0};
}


x86 assembly (clang, -O0):
<fa>:
push   %rbp
mov    %rsp,%rbp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,-0x10(%rbp)
movdqa -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa>:
movaps 0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define <4 x i32> @fa() {
%1 = alloca <4 x i32>
store <4 x i32> <i32 1, i32 1, i32 0, i32 0>, <4 x i32>* %1
%2 = load <4 x i32>, <4 x i32>* %1
ret <4 x i32> %2
}

LLVM IR (-O2):
define <4 x i32> @fa() {
ret <4 x i32> <i32 1, i32 1, i32 0, i32 0>
}
int cadd(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<cadd>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @cadd(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void delay(unsigned int duration) { usleep(duration * 1000); }


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
double ls_costN_nm2_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<ls_costN_nm2_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm2_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_costN_nm2_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_costN_nm2_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
float __builtin_wasm_max_f32(float, float);
float max_f32(float x, float y) { return __builtin_wasm_max_f32(x, y); }


x86 assembly (clang, -O0):
<max_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__builtin_wasm_max_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_f32>:
jmp    1030 <__builtin_wasm_max_f32@plt>

LLVM IR (-O0):
define float @max_f32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__builtin_wasm_max_f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @max_f32(float %0, float %1) {
%3 = tail call float @__builtin_wasm_max_f32(float %0, float %1)
ret float %3
}
/* Type definitions */
struct evdns_getaddrinfo_request {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *);
void cancel_gai_cb(int fd, short what, void *ptr) {
  struct evdns_getaddrinfo_request *r = ptr;
  evdns_getaddrinfo_cancel(r);
}


x86 assembly (clang, -O0):
<cancel_gai_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <evdns_getaddrinfo_cancel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cancel_gai_cb>:
mov    %rdx,%rdi
jmp    1030 <evdns_getaddrinfo_cancel@plt>

LLVM IR (-O0):
%struct.evdns_getaddrinfo_request = type { i32 }
define void @cancel_gai_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.evdns_getaddrinfo_request*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.evdns_getaddrinfo_request*
store %struct.evdns_getaddrinfo_request* %9, %struct.evdns_getaddrinfo_request** %7
%10 = load %struct.evdns_getaddrinfo_request*, %struct.evdns_getaddrinfo_request** %7
%11 = call i32 @evdns_getaddrinfo_cancel(%struct.evdns_getaddrinfo_request* %10)
ret void
}

LLVM IR (-O2):
%struct.evdns_getaddrinfo_request = type { i32 }
define void @cancel_gai_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.evdns_getaddrinfo_request*
%5 = tail call i32 @evdns_getaddrinfo_cancel(%struct.evdns_getaddrinfo_request* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void iso_free_a4k(void *p) { free(p); }


x86 assembly (clang, -O0):
<iso_free_a4k>:
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):
<iso_free_a4k>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @iso_free_a4k(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 @iso_free_a4k(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double exp(double);
double Dexp(double x) { return exp(x); }


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

x86 assembly (clang, -O2):
<Dexp>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @Dexp(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned calc_hash(const char *p) {
  unsigned hash = 5381;
  assert(p != NULL);
  while (*p != 0)
    hash = (hash << 5) + hash + *p++;
  return hash;
}


x86 assembly (clang, -O0):
<calc_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116a <calc_hash+0x5a>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <calc_hash+0x25>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_hash>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     1159 <calc_hash+0x49>
add    $0x1,%rbx
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
mov    %eax,%edx
test   %cl,%cl
jne    1140 <calc_hash+0x30>
pop    %rbx
ret
mov    $0x1505,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @calc_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 5381, i32* %3
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
br label %8
8: ; preds = %13, %1
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i32, i32* %3
%15 = shl i32 %14, 5
%16 = load i32, i32* %3
%17 = add i32 %15, %16
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
%20 = load i8, i8* %18
%21 = sext i8 %20 to i32
%22 = add i32 %17, %21
store i32 %22, i32* %3
br label %8
23: ; preds = %8
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @calc_hash(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1, %7
%8 = phi i8 [ %15, %7 ], [ %5, %1 ]
%9 = phi i32 [ %14, %7 ], [ 5381, %1 ]
%10 = phi i8* [ %13, %7 ], [ %0, %1 ]
%11 = sext i8 %8 to i32
%12 = mul i32 %9, 33
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = add i32 %12, %11
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %1
%18 = phi i32 [ 5381, %1 ], [ %14, %7 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
char *malloc(int);
char *hostname() {
  char *hn;
  hn = NULL;
  hn = malloc(128 * sizeof(char));
  gethostname(hn, 128 * sizeof(char));
  return hn;
}


x86 assembly (clang, -O0):
<hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x80,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x80,%esi
call   1040 <gethostname@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hostname>:
push   %rbx
mov    $0x80,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x80,%esi
call   1040 <gethostname@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hostname() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* @malloc(i32 128)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @gethostname(i8* %3, i32 128)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @hostname() {
%1 = tail call dereferenceable_or_null(128) i8* @malloc(i32 128)
%2 = tail call i32 @gethostname(i8* %1, i32 128)
ret i8* %1
}