xunge/DecIR huggingface dataset:
void TimerHalSetTimerClkSource(unsigned int timerMuxSelectionRegister,
                               unsigned int clkSource) {
  (*((volatile unsigned int *)(((0x44E00000) + 0x500) +
                               timerMuxSelectionRegister))) &= ~((0x00000003u));
  unsigned int controlSetting = clkSource & ((0x0u) | (0x1u) | (0x2u));
  (*((volatile unsigned int *)(((0x44E00000) + 0x500) +
                               timerMuxSelectionRegister))) |= controlSetting;
  while (((*((volatile unsigned int *)(((0x44E00000) + 0x500) +
                                       timerMuxSelectionRegister))) &
          (0x00000003u)) != controlSetting)
    ;
}


x86 assembly (clang, -O0):
<TimerHalSetTimerClkSource>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x44e00500,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffc,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0x44e00500,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x44e00500,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x3,%eax
cmp    -0xc(%rbp),%eax
je     1154 <TimerHalSetTimerClkSource+0x54>
jmp    1137 <TimerHalSetTimerClkSource+0x37>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerHalSetTimerClkSource>:
add    $0x44e00500,%edi
andl   $0xfffffffc,(%rdi)
and    $0x3,%esi
or     %esi,(%rdi)
xchg   %ax,%ax
mov    (%rdi),%eax
and    $0x3,%eax
cmp    %esi,%eax
jne    1110 <TimerHalSetTimerClkSource+0x10>
ret

LLVM IR (-O0):
define void @TimerHalSetTimerClkSource(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = add i32 1155532032, %6
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, -4
store volatile i32 %11, i32* %9
%12 = load i32, i32* %4
%13 = and i32 %12, 3
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %3
%16 = add i32 1155532032, %15
%17 = zext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = or i32 %19, %14
store volatile i32 %20, i32* %18
br label %21
21: ; preds = %30, %2
%22 = load i32, i32* %3
%23 = add i32 1155532032, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = and i32 %26, 3
%28 = load i32, i32* %5
%29 = icmp ne i32 %27, %28
br i1 %29, label %30, label %31
30: ; preds = %21
br label %21
31: ; preds = %21
ret void
}

LLVM IR (-O2):
define void @TimerHalSetTimerClkSource(i32 %0, i32 %1) {
%3 = add i32 %0, 1155532032
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -4
store volatile i32 %7, i32* %5
%8 = and i32 %1, 3
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
br label %11
11: ; preds = %11, %2
%12 = load volatile i32, i32* %5
%13 = and i32 %12, 3
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %11
15: ; preds = %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetNextUTFCode(char const *, unsigned int *);
unsigned int GetUTFOctets(const char *text) {
  unsigned int octets;
  (void)GetNextUTFCode(text, &octets);
  return (octets);
}


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

x86 assembly (clang, -O2):
<GetUTFOctets>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <GetNextUTFCode@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @GetUTFOctets(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @GetNextUTFCode(i8* %0, i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__12__IO__clr();
void Msp430GpioC__11__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__12__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__11__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__12__IO__clr()
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ fatal(char *);
void *xzalloc(size_t size) {
  void *m = calloc(1, size);
  if (NULL == m)
    fatal("Out of memory");
  return m;
}


x86 assembly (clang, -O0):
<xzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1156 <xzalloc+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzalloc>:
push   %rbx
mov    %rdi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <xzalloc+0x22>
lea    0xec3(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xzalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @calloc(i32 1, i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xzalloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ reverse_int_array(int *, int);
int /*<<< orphan*/ reverse_int_ptr_array(int **, int);
void reverse_int_ptr_ptrtest(int **ptrs) {
  reverse_int_ptr_array(ptrs, 2);
  reverse_int_array(*(ptrs + 0), 4);
  reverse_int_array(*(ptrs + 1), 4);
}


x86 assembly (clang, -O0):
<reverse_int_ptr_ptrtest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <reverse_int_ptr_array@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x4,%esi
call   1030 <reverse_int_array@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x4,%esi
call   1030 <reverse_int_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_int_ptr_ptrtest>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1040 <reverse_int_ptr_array@plt>
mov    (%rbx),%rdi
mov    $0x4,%esi
call   1030 <reverse_int_array@plt>
mov    0x8(%rbx),%rdi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <reverse_int_array@plt>

LLVM IR (-O0):
define void @reverse_int_ptr_ptrtest(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = call i32 @reverse_int_ptr_array(i32** %3, i32 2)
%5 = load i32**, i32*** %2
%6 = getelementptr inbounds i32*, i32** %5, i64 0
%7 = load i32*, i32** %6
%8 = call i32 @reverse_int_array(i32* %7, i32 4)
%9 = load i32**, i32*** %2
%10 = getelementptr inbounds i32*, i32** %9, i64 1
%11 = load i32*, i32** %10
%12 = call i32 @reverse_int_array(i32* %11, i32 4)
ret void
}

LLVM IR (-O2):
define void @reverse_int_ptr_ptrtest(i32** %0) {
%2 = tail call i32 @reverse_int_ptr_array(i32** %0, i32 2)
%3 = load i32*, i32** %0
%4 = tail call i32 @reverse_int_array(i32* %3, i32 4)
%5 = getelementptr inbounds i32*, i32** %0, i64 1
%6 = load i32*, i32** %5
%7 = tail call i32 @reverse_int_array(i32* %6, i32 4)
ret void
}
char *ndb_osdep_createBatchImportAll_fname() { return ("ndb_convert.sh"); }


x86 assembly (clang, -O0):
<ndb_osdep_createBatchImportAll_fname>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndb_osdep_createBatchImportAll_fname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"ndb_convert.sh\00"
define i8* @ndb_osdep_createBatchImportAll_fname() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"ndb_convert.sh\00"
define i8* @ndb_osdep_createBatchImportAll_fname() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Reset_Handler();
void CpuReset(void) { Reset_Handler(); }


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

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

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

LLVM IR (-O2):
define void @CpuReset() {
%1 = tail call i32 (...) @Reset_Handler()
ret void
}
/* Variables and functions */
scalar_t__ jRead_long(char *, char *, int *);
int jRead_int(char *pJson, char *pQuery, int *queryParams) {
  return (int)jRead_long(pJson, pQuery, queryParams);
}


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

x86 assembly (clang, -O2):
<jRead_int>:
jmp    1030 <jRead_long@plt>

LLVM IR (-O0):
define i32 @jRead_int(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i64 @jRead_long(i8* %7, i8* %8, i32* %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @jRead_int(i8* %0, i8* %1, i32* %2) {
%4 = tail call i64 @jRead_long(i8* %0, i8* %1, i32* %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int yas_lis3dh_write_reg(unsigned char, unsigned char *, int);
int yas_lis3dh_write_reg_byte(unsigned char adr, unsigned char val) {
  return yas_lis3dh_write_reg(adr, &val, 1);
}


x86 assembly (clang, -O0):
<yas_lis3dh_write_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x1(%rbp),%edi
call   1030 <yas_lis3dh_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_lis3dh_write_reg_byte>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_lis3dh_write_reg@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @yas_lis3dh_write_reg_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @yas_lis3dh_write_reg(i8 zeroext %0, i8* %3, i32 1)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int map_state;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void set_XWindowAttributes_map_state(void *_p, int _v) {
  ((XWindowAttributes *)_p)->map_state = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XWindowAttributes_map_state>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XWindowAttributes_map_state(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XWindowAttributes_map_state(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  const char filename[] = "output.txt";
  FILE *fp;
  fp = fopen(filename, "w");
  fclose(fp);
  puts("File created");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xf(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x742e74757074756f,%rax
74 2e 74
mov    %rax,0x8(%rsp)
movl   $0x747874,0xf(%rsp)
lea    0xeb9(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1050 <fopen@plt>
mov    %rax,%rdi
call   1040 <fclose@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.filename = [11 x i8] c"output.txt\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [13 x i8] c"File created\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [11 x i8]* %2 to i8*
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @fclose(i32* %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.filename = [11 x i8] c"output.txt\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [13 x i8] c"File created\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fclose(i32* %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char **new_matrix2c(int, int);
char **new_matrix2c_data(int n, int m, char *data) {
  char **X = new_matrix2c(n, m);
  memcpy(X[0], data, n * m * sizeof(char));
  return X;
}


x86 assembly (clang, -O0):
<new_matrix2c_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <new_matrix2c@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cltq
shl    $0x0,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_matrix2c_data>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <new_matrix2c@plt>
mov    %rax,%r15
mov    (%rax),%rdi
imul   %ebx,%ebp
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8** @new_matrix2c_data(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i8** @new_matrix2c(i32 %8, i32 %9)
store i8** %10, i8*** %7
%11 = load i8**, i8*** %7
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = load i8*, i8** %6
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = mul nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 1
%20 = trunc i64 %19 to i32
%21 = call i32 @memcpy(i8* %13, i8* %14, i32 %20)
%22 = load i8**, i8*** %7
ret i8** %22
}

LLVM IR (-O2):
define i8** @new_matrix2c_data(i32 %0, i32 %1, i8* %2) {
%4 = tail call i8** @new_matrix2c(i32 %0, i32 %1)
%5 = load i8*, i8** %4
%6 = mul nsw i32 %1, %0
%7 = tail call i32 @memcpy(i8* %5, i8* %2, i32 %6)
ret i8** %4
}
/* Variables and functions */
unsigned int random_in_range(unsigned int, unsigned int);
unsigned int get_random_block_type(void) {
  unsigned int min = 1, max = 8;
  return random_in_range(min, max);
}


x86 assembly (clang, -O0):
<get_random_block_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <random_in_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_block_type>:
mov    $0x1,%edi
mov    $0x8,%esi
jmp    1030 <random_in_range@plt>

LLVM IR (-O0):
define i32 @get_random_block_type() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 8, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @random_in_range(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_random_block_type() {
%1 = tail call i32 @random_in_range(i32 1, i32 8)
ret i32 %1
}
void my_task_almost(int foo, char *bar) {}


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

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

LLVM IR (-O0):
define void @my_task_almost(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @my_task_almost(i32 %0, i8* nocapture %1) {
ret void
}
void XtAppCreateShell() {}


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

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

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

LLVM IR (-O2):
define void @XtAppCreateShell() {
ret void
}
int main(void) {
  int a = 41;
  if (a <= 41) {
    a++;
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x29,-0x8(%rbp)
cmpl   $0x29,-0x8(%rbp)
jg     1125 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 41, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 41
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %0
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
void dump_word(char *prefix, char *id, unsigned short value) {
  if (prefix)
    printf("%s%s=%d\n", prefix, id, value);
  else
    printf("%s=%d\n", id, value);
}


x86 assembly (clang, -O0):
<dump_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <dump_word+0x41>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movzwl -0x12(%rbp),%ecx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1167 <dump_word+0x57>
mov    -0x10(%rbp),%rsi
movzwl -0x12(%rbp),%edx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_word>:
mov    %edx,%ecx
mov    %rsi,%rdx
test   %rdi,%rdi
je     112b <dump_word+0x1b>
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s%s=%d\0A\00"
@.str.1 = [7 x i8] c"%s=%d\0A\00"
define void @dump_word(i8* %0, i8* %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i16, i16* %6
%13 = zext i16 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %13)
br label %20
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i16, i16* %6
%18 = zext i16 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %16, i32 %18)
br label %20
20: ; preds = %15, %9
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s%s=%d\0A\00"
@.str.1 = [7 x i8] c"%s=%d\0A\00"
define void @dump_word(i8* %0, i8* %1, i16 zeroext %2) {
%4 = icmp eq i8* %0, null
%5 = zext i16 %2 to i32
br i1 %4, label %8, label %6
6: ; preds = %3
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %5)
br label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %5)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int memcmp(char const *, char const *, size_t);
size_t strlen(char const *);
int strcmp(const char *a, const char *b) {
  size_t al, bl;
  al = strlen(a);
  bl = strlen(b);
  if (al != bl)
    return al - bl;
  return memcmp(a, b, al);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1168 <strcmp+0x48>
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    117c <strcmp+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cmp    %rax,%rbx
jne    1153 <strcmp+0x33>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcmp@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i64, i64* %6
%17 = load i64, i64* %7
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
store i32 %19, i32* %3
br label %25
20: ; preds = %2
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = load i64, i64* %6
%24 = call i32 @memcmp(i8* %21, i8* %22, i64 %23)
store i32 %24, i32* %3
br label %25
25: ; preds = %20, %15
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = sub i64 %3, %4
%8 = trunc i64 %7 to i32
br label %11
9: ; preds = %2
%10 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %3)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}
int test_imm_22int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x22 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_22int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x22,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_22int64_midword_mem>:
testb  $0x22,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_22int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 34
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_22int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2228224
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ IPC_NOWAIT;
int msgrcv(int, void *, int, long, int /*<<< orphan*/);
int CommReceiveNoBlock(int channel_id, void *message, int size) {
  long type = *(long *)message;
  if (msgrcv(channel_id, message, size - sizeof(long), type, IPC_NOWAIT) ==
      -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<CommReceiveNoBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
sub    $0x8,%rax
mov    %eax,%edx
mov    -0x20(%rbp),%rcx
mov    0x2ea7(%rip),%rax
mov    (%rax),%r8d
call   1030 <msgrcv@plt>
cmp    $0xffffffff,%eax
jne    1166 <CommReceiveNoBlock+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <CommReceiveNoBlock+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommReceiveNoBlock>:
push   %rax
mov    (%rsi),%rcx
add    $0xfffffff8,%edx
mov    0x2ed2(%rip),%rax
mov    (%rax),%r8d
call   1030 <msgrcv@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPC_NOWAIT = global i32 0
define i32 @CommReceiveNoBlock(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
store i64 %11, i64* %8
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = sub i64 %15, 8
%17 = trunc i64 %16 to i32
%18 = load i64, i64* %8
%19 = load i32, i32* @IPC_NOWAIT
%20 = call i32 @msgrcv(i32 %12, i8* %13, i32 %17, i64 %18, i32 %19)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %23
22: ; preds = %3
store i32 -1, i32* %4
br label %24
23: ; preds = %3
store i32 0, i32* %4
br label %24
24: ; preds = %23, %22
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
@IPC_NOWAIT = global i32 0
define i32 @CommReceiveNoBlock(i32 %0, i8* %1, i32 %2) {
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %4
%6 = add i32 %2, -8
%7 = load i32, i32* @IPC_NOWAIT
%8 = tail call i32 @msgrcv(i32 %0, i8* %1, i32 %6, i64 %5, i32 %7)
%9 = icmp eq i32 %8, -1
%10 = sext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int _isgraph(int);
int isgraph(int c) { return _isgraph(c); }


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

x86 assembly (clang, -O2):
<isgraph>:
jmp    1030 <_isgraph@plt>

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = tail call i32 @_isgraph(i32 %0)
ret i32 %2
}
void swbug(void *swdesc) { printf("[SOFTWARE BUG] %s", swdesc); }


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

x86 assembly (clang, -O2):
<swbug>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"[SOFTWARE BUG] %s\00"
define void @swbug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"[SOFTWARE BUG] %s\00"
define void @swbug(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int write_target_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(17, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<write_target_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x11,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_target_solutions>:
mov    $0x11,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_target_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 17, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_target_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 17, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
char *getlogin(void) {
  __set_errno(ENOSYS);
  return NULL;
}


x86 assembly (clang, -O0):
<getlogin>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlogin>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i8* @getlogin() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define noalias i8* @getlogin() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i8* null
}
char *procprt_CURCPU_e(struct tstat *curstat, int avgval, int nsecs) {
  return "    -";
}


x86 assembly (clang, -O0):
<procprt_CURCPU_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_CURCPU_e>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [6 x i8] c" -\00"
define i8* @procprt_CURCPU_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [6 x i8] c" -\00"
define i8* @procprt_CURCPU_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef union vec3 {
  int dummy;
} vec3;

/* Variables and functions */
int /*<<< orphan*/ vec3_vec3_cwise_product(union vec3 *, union vec3 *,
                                           union vec3 const *);
union vec3 *vec3_cwise_product_self(union vec3 *vo, const union vec3 *vi) {
  vec3_vec3_cwise_product(vo, vo, vi);
  return vo;
}


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

x86 assembly (clang, -O2):
<vec3_cwise_product_self>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rdi,%rsi
call   1030 <vec3_vec3_cwise_product@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_cwise_product_self(%union.vec3* %0, %union.vec3* %1) {
%3 = alloca %union.vec3*
%4 = alloca %union.vec3*
store %union.vec3* %0, %union.vec3** %3
store %union.vec3* %1, %union.vec3** %4
%5 = load %union.vec3*, %union.vec3** %3
%6 = load %union.vec3*, %union.vec3** %3
%7 = load %union.vec3*, %union.vec3** %4
%8 = call i32 @vec3_vec3_cwise_product(%union.vec3* %5, %union.vec3* %6, %union.vec3* %7)
%9 = load %union.vec3*, %union.vec3** %3
ret %union.vec3* %9
}

LLVM IR (-O2):
%union.vec3 = type { i32 }
define %union.vec3* @vec3_cwise_product_self(%union.vec3* returned %0, %union.vec3* %1) {
%3 = tail call i32 @vec3_vec3_cwise_product(%union.vec3* %0, %union.vec3* %0, %union.vec3* %1)
ret %union.vec3* %0
}
void get_cp_info(void) {}


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

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

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

LLVM IR (-O2):
define void @get_cp_info() {
ret void
}
/* Variables and functions */
int close(int);
int Close(int socket) { return close(socket); }


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

x86 assembly (clang, -O2):
<Close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void display_stop(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @display_stop() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ depth;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
int get_XWindowAttributes_depth(void *_p) {
  return (int)((XWindowAttributes *)_p)->depth;
}


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

x86 assembly (clang, -O2):
<get_XWindowAttributes_depth>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowAttributes_depth(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowAttributes_depth(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void border_sw_ext_diagonal_special_sand_long_hori(unsigned char *pic,
                                                   unsigned char *mirr) {
  *pic = 0x30;
  *mirr = 0x01;
}


x86 assembly (clang, -O0):
<border_sw_ext_diagonal_special_sand_long_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_sw_ext_diagonal_special_sand_long_hori>:
movb   $0x30,(%rdi)
movb   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @border_sw_ext_diagonal_special_sand_long_hori(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
store i8 48, i8* %5
%6 = load i8*, i8** %4
store i8 1, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_sw_ext_diagonal_special_sand_long_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 48, i8* %0
store i8 1, i8* %1
ret void
}
int cairo_code_draw_casALabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_casALabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_casALabel_get_width() {
ret i32 7
}
int label_socket_set(const char *label) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @label_socket_set(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fn(int /*<<< orphan*/);
void foo(void) { fn(0); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <fn@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @fn(i32 0)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @fn(i32 0)
ret void
}
/* Variables and functions */
int isspace(unsigned char);
int isspace_c(char c) { return isspace((unsigned char)c); }


x86 assembly (clang, -O0):
<isspace_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace_c>:
movzbl %dil,%edi
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @isspace_c(i8 signext %0) {
%2 = tail call i32 @isspace(i8 zeroext %0)
ret i32 %2
}
void putcodew(code) unsigned int code;
{
  unsigned int hi = code >> 8;
  if (hi)
    putcode(hi);
  putcode(code & 0xff);
}


x86 assembly (clang, -O0):
<putcodew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1138 <putcodew+0x28>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <putcode@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <putcode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcodew>:
push   %rbx
mov    %edi,%ebx
cmp    $0x100,%edi
jb     1127 <putcodew+0x17>
mov    %ebx,%edi
shr    $0x8,%edi
xor    %eax,%eax
call   1030 <putcode@plt>
movzbl %bl,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putcode@plt>

LLVM IR (-O0):
define void @putcodew(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 8
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 (i32, ...) bitcast (i32 (...)* @putcode to i32 (i32, ...)*)(i32 %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %2
%13 = and i32 %12, 255
%14 = call i32 (i32, ...) bitcast (i32 (...)* @putcode to i32 (i32, ...)*)(i32 %13)
ret void
}

LLVM IR (-O2):
define void @putcodew(i32 %0) {
%2 = icmp ult i32 %0, 256
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = lshr i32 %0, 8
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @putcode to i32 (i32, ...)*)(i32 %4)
br label %6
6: ; preds = %3, %1
%7 = and i32 %0, 255
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @putcode to i32 (i32, ...)*)(i32 %7)
ret void
}
/* Variables and functions */
unsigned short SHRT_MAX;
int /*<<< orphan*/ abort();
void tests(unsigned short s, int ok) {
  if ((s >= 1) && (s <= SHRT_MAX)) {
    if (!ok)
      abort();
  } else if (ok)
    abort();
}


x86 assembly (clang, -O0):
<tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x1,%eax
jl     115b <tests+0x4b>
movzwl -0x2(%rbp),%eax
mov    0x2ea6(%rip),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     115b <tests+0x4b>
cmpl   $0x0,-0x8(%rbp)
jne    1156 <tests+0x46>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1171 <tests+0x61>
cmpl   $0x0,-0x8(%rbp)
je     116c <tests+0x5c>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1171 <tests+0x61>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests>:
push   %rax
test   %edi,%edi
je     1127 <tests+0x17>
mov    0x2ec4(%rip),%rax
cmp    %di,(%rax)
jb     1127 <tests+0x17>
test   %esi,%esi
je     112b <tests+0x1b>
pop    %rax
ret
test   %esi,%esi
je     1125 <tests+0x15>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SHRT_MAX = global i16 0
define void @tests(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = icmp sge i32 %6, 1
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i16, i16* @SHRT_MAX
%12 = zext i16 %11 to i32
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %14
br label %26
20: ; preds = %8, %2
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %20
br label %26
26: ; preds = %25, %19
ret void
}

LLVM IR (-O2):
@SHRT_MAX = global i16 0
define void @tests(i16 zeroext %0, i32 %1) {
%3 = icmp eq i16 %0, 0
%4 = load i16, i16* @SHRT_MAX
%5 = icmp ult i16 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = icmp eq i32 %1, 0
br i1 %6, label %11, label %8
8: ; preds = %2
br i1 %7, label %9, label %14
9: ; preds = %8
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %2
br i1 %7, label %14, label %12
12: ; preds = %11
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %11, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prDouble(double);
int /*<<< orphan*/ printf(char *);
void prScalarDouble(double arg) {
  printf("[](");
  prDouble(arg);
  printf(")");
}


x86 assembly (clang, -O0):
<prScalarDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <prDouble@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prScalarDouble>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1050 <printf@plt>
movsd  (%rsp),%xmm0
call   1040 <prDouble@plt>
mov    $0x29,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"[](\00"
@.str.1 = [2 x i8] c")\00"
define void @prScalarDouble(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = load double, double* %2
%5 = call i32 @prDouble(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"[](\00"
define void @prScalarDouble(double %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @prDouble(double %0)
%4 = tail call i32 @putchar(i32 41)
ret void
}
unsigned bsr(unsigned int value) {
  unsigned res;
  asm volatile("bsr %1,%0" : "=r"(res) : "r"(value));
  return res;
}


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

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

LLVM IR (-O0):
define i32 @bsr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm sideeffect "bsr $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bsr(i32 %0) {
%2 = tail call i32 asm sideeffect "bsr $1,$0", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
int ft_strlen_mod(char *str) {
  int i;
  i = 0;
  while (str[i] != '\n')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1132 <ft_strlen_mod+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen_mod+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen_mod>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0xa,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen_mod+0x10>
ret

LLVM IR (-O0):
define i32 @ft_strlen_mod(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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, 10
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @ft_strlen_mod(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}