xunge/DecIR huggingface dataset:
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void create_random(int tab[]) {
  srand(time(NULL));
  for (int i = 0; i < 100; i++) {
    tab[i] = (rand() % 100);
  }
}


x86 assembly (clang, -O0):
<create_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1185 <create_random+0x55>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <create_random+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_random>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1150 <create_random+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @create_random(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @create_random(i32* nocapture writeonly %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %5
4: ; preds = %5
ret void
5: ; preds = %1, %5
%6 = phi i64 [ 0, %1 ], [ %10, %5 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 100
%9 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %8, i32* %9
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 100
br i1 %11, label %4, label %5
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ dobind(int);
int /*<<< orphan*/ next_sendto(int, void const *, size_t, int,
                               struct sockaddr const *, int /*<<< orphan*/);
int /*<<< orphan*/ set_next_sendto();
ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
               const struct sockaddr *dest_addr, socklen_t addrlen) {
  set_next_sendto();
  dobind(sockfd);
  return next_sendto(sockfd, buf, len, flags, dest_addr, addrlen);
}


x86 assembly (clang, -O0):
<sendto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    $0x0,%al
call   1050 <set_next_sendto@plt>
mov    -0x4(%rbp),%edi
call   1040 <dobind@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <next_sendto@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendto>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8,%r15
mov    %ecx,%r12d
mov    %rdx,%r13
mov    %rsi,%rbp
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <set_next_sendto@plt>
mov    %ebx,%edi
call   1040 <dobind@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r12d,%ecx
mov    %r15,%r8
mov    %r14d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <next_sendto@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca %struct.sockaddr*
%12 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i32 %3, i32* %10
store %struct.sockaddr* %4, %struct.sockaddr** %11
store i32 %5, i32* %12
%13 = call i32 (...) @set_next_sendto()
%14 = load i32, i32* %7
%15 = call i32 @dobind(i32 %14)
%16 = load i32, i32* %7
%17 = load i8*, i8** %8
%18 = load i64, i64* %9
%19 = load i32, i32* %10
%20 = load %struct.sockaddr*, %struct.sockaddr** %11
%21 = load i32, i32* %12
%22 = call i32 @next_sendto(i32 %16, i8* %17, i64 %18, i32 %19, %struct.sockaddr* %20, i32 %21)
ret i32 %22
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5) {
%7 = tail call i32 (...) @set_next_sendto()
%8 = tail call i32 @dobind(i32 %0)
%9 = tail call i32 @next_sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World again !\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Hello World again !\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"Hello World again !\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned short port_word_in(unsigned short port) {
  unsigned short result;
  __asm__("in %%dx, %%ax" : "=a"(result) : "d"(port));
  return result;
}


x86 assembly (clang, -O0):
<port_word_in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_word_in>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @port_word_in(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @port_word_in(i16 zeroext %0) {
%2 = tail call i16 asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
int Sub(int a, int b) { return b - a; }


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

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

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

LLVM IR (-O2):
define i32 @Sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
float abs_float(float input) {
  float retVal;
  if (input < 0) {
    retVal = (float)(input * -1);
  } else {
    retVal = (float)input;
  }
  return retVal;
}


x86 assembly (clang, -O0):
<abs_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <abs_float+0x2d>
movss  0xee2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1137 <abs_float+0x37>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_float>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @abs_float(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %2
%8 = fmul float %7, -1.000000e+00
store float %8, float* %3
br label %11
9: ; preds = %1
%10 = load float, float* %2
store float %10, float* %3
br label %11
11: ; preds = %9, %6
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @abs_float(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ output(char *, int, int);
int /*<<< orphan*/ strcpy(char *, char *);
void flexsym(void) {
  struct {
    char name[8];
    unsigned short flags;
    long value;
  } s;
  strcpy(s.name, "SozobonX");
  s.value = 0x87654321;
  s.flags = (0x4000 | 0x0200);
  output((char *)&s, sizeof s, 1);
}


x86 assembly (clang, -O0):
<flexsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
mov    $0x87654321,%eax
mov    %rax,-0x8(%rbp)
movw   $0x4200,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
call   1040 <output@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flexsym>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    $0x87654321,%eax
mov    %rax,0x18(%rsp)
movw   $0x4200,0x10(%rsp)
mov    %rbx,%rdi
mov    $0x18,%esi
mov    $0x1,%edx
call   1040 <output@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { [8 x i8], i16, i64 }
@.str = [9 x i8] c"SozobonX\00"
define void @flexsym() {
%1 = alloca %struct.anon
%2 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 2
store i64 2271560481, i64* %5
%6 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
store i16 16896, i16* %6
%7 = bitcast %struct.anon* %1 to i8*
%8 = call i32 @output(i8* %7, i32 24, i32 1)
ret void
}

LLVM IR (-O2):
%struct.anon = type { [8 x i8], i16, i64 }
@.str = [9 x i8] c"SozobonX\00"
define void @flexsym() {
%1 = alloca %struct.anon
%2 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 2
store i64 2271560481, i64* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 1
store i16 16896, i16* %5
%6 = call i32 @output(i8* %2, i32 24, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int call_longjmp_1(jmp_buf *buf) { longjmp(*buf, 1); }


x86 assembly (clang, -O0):
<call_longjmp_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <longjmp@plt>

x86 assembly (clang, -O2):
<call_longjmp_1>:
push   %rax
mov    (%rdi),%edi
mov    $0x1,%esi
call   1030 <longjmp@plt>

LLVM IR (-O0):
define i32 @call_longjmp_1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @longjmp(i32 %4, i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @call_longjmp_1(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @longjmp(i32 %2, i32 1)
unreachable
}
void DMAChannelIntFlagClear(unsigned long ulChannelID,
                            unsigned long ulIntFlags) {
  ;

  ;
  if ((ulChannelID) < 7) {
    (*((volatile unsigned long *)(0x40020000 + 0x00000004))) |=
        (ulIntFlags << ulChannelID * 4);
  } else {
    (*((volatile unsigned long *)(0x40020400 + 0x00000004))) |=
        (ulIntFlags << (ulChannelID - 1024) * 4);
  }
}


x86 assembly (clang, -O0):
<DMAChannelIntFlagClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x7,-0x8(%rbp)
jae    113e <DMAChannelIntFlagClear+0x3e>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shl    $0x2,%rcx
shl    %cl,%rax
mov    $0x40020004,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40020004,%eax
mov    %rcx,(%rax)
jmp    1167 <DMAChannelIntFlagClear+0x67>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x400,%rcx
shl    $0x2,%rcx
shl    %cl,%rax
mov    $0x40020404,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x40020404,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMAChannelIntFlagClear>:
xor    %eax,%eax
cmp    $0x7,%rdi
setae  %al
lea    0x0(,%rdi,4),%ecx
shl    %cl,%rsi
shl    $0xa,%rax
or     %rsi,0x40020004(%rax)
ret

LLVM IR (-O0):
define void @DMAChannelIntFlagClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 7
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = mul i64 %9, 4
%11 = shl i64 %8, %10
%12 = load volatile i64, i64* inttoptr (i64 1073872900 to i64*)
%13 = or i64 %12, %11
store volatile i64 %13, i64* inttoptr (i64 1073872900 to i64*)
br label %22
14: ; preds = %2
%15 = load i64, i64* %4
%16 = load i64, i64* %3
%17 = sub i64 %16, 1024
%18 = mul i64 %17, 4
%19 = shl i64 %15, %18
%20 = load volatile i64, i64* inttoptr (i64 1073873924 to i64*)
%21 = or i64 %20, %19
store volatile i64 %21, i64* inttoptr (i64 1073873924 to i64*)
br label %22
22: ; preds = %14, %7
ret void
}

LLVM IR (-O2):
define void @DMAChannelIntFlagClear(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, 7
%4 = shl i64 %0, 2
%5 = add i64 %4, -4096
%6 = select i1 %3, i64 %4, i64 %5
%7 = select i1 %3, i64* inttoptr (i64 1073872900 to i64*), i64* inttoptr (i64 1073873924 to i64*)
%8 = shl i64 %1, %6
%9 = load volatile i64, i64* %7
%10 = or i64 %9, %8
store volatile i64 %10, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_handler(char *);
scalar_t__ nc_strerror(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
void handle_netcdf_error(const char *msg, int status) {
  char errmsg[512];
  sprintf(errmsg, "%s: %s", msg, (char *)nc_strerror(status));
  error_handler(errmsg);
}


x86 assembly (clang, -O0):
<handle_netcdf_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x220(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x218(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <nc_strerror@plt>
mov    -0x220(%rbp),%rdi
mov    -0x218(%rbp),%rdx
mov    %rax,%rcx
lea    0xe85(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <error_handler@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_netcdf_error>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <nc_strerror@plt>
lea    0xeb5(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rdi
call   1030 <error_handler@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
define void @handle_netcdf_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [512 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i64 @nc_strerror(i32 %8)
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %10)
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%13 = call i32 @error_handler(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
define void @handle_netcdf_error(i8* %0, i32 %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = tail call i64 @nc_strerror(i32 %1)
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
%8 = call i32 @error_handler(i8* %4)
ret void
}
double Mfunc2D(double x, double y, double m, double gamma, double h) {
  return m * (y - x) + gamma * 2 * (h + (1. - 2 * h) * x) * x * (1. - x);
}


x86 assembly (clang, -O0):
<Mfunc2D>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  0xed4(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
addsd  %xmm5,%xmm5
movsd  0xeb1(%rip),%xmm3
subsd  %xmm5,%xmm3
movsd  -0x8(%rbp),%xmm5
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe8f(%rip),%xmm3
subsd  -0x8(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mfunc2D>:
subsd  %xmm0,%xmm1
addsd  %xmm3,%xmm3
movapd %xmm4,%xmm6
addsd  %xmm4,%xmm6
movsd  0xee8(%rip),%xmm5
movapd %xmm5,%xmm7
subsd  %xmm6,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm4,%xmm7
mulsd  %xmm3,%xmm7
mulsd  %xmm0,%xmm7
subsd  %xmm0,%xmm5
mulsd  %xmm7,%xmm5
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm5
movapd %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @Mfunc2D(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %8
%12 = load double, double* %7
%13 = load double, double* %6
%14 = fsub double %12, %13
%15 = load double, double* %9
%16 = fmul double %15, 2.000000e+00
%17 = load double, double* %10
%18 = load double, double* %10
%19 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %18, double 1.000000e+00)
%20 = load double, double* %6
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double %17)
%22 = fmul double %16, %21
%23 = load double, double* %6
%24 = fmul double %22, %23
%25 = load double, double* %6
%26 = fsub double 1.000000e+00, %25
%27 = fmul double %24, %26
%28 = call double @llvm.fmuladd.f64(double %11, double %14, double %27)
ret double %28
}

LLVM IR (-O2):
define double @Mfunc2D(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %1, %0
%7 = fmul double %3, 2.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %4, double -2.000000e+00, double 1.000000e+00)
%9 = tail call double @llvm.fmuladd.f64(double %8, double %0, double %4)
%10 = fmul double %7, %9
%11 = fmul double %10, %0
%12 = fsub double 1.000000e+00, %0
%13 = fmul double %12, %11
%14 = tail call double @llvm.fmuladd.f64(double %2, double %6, double %13)
ret double %14
}
/* Variables and functions */
double sqrt(double const);
double stdlib_base_sqrt(const double x) { return sqrt(x); }


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

x86 assembly (clang, -O2):
<stdlib_base_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <stdlib_base_sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @stdlib_base_sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ pcap_list_cursor_prev();
int /*<<< orphan*/ warn_text_ui(char *);
bool cmd_prev(const char *arg) {
  if (arg)
    warn_text_ui("Unexpected argument for the prev command");
  pcap_list_cursor_prev();
  return true;
}


x86 assembly (clang, -O0):
<cmd_prev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <cmd_prev+0x23>
lea    0xec2(%rip),%rdi
call   1030 <warn_text_ui@plt>
mov    $0x0,%al
call   1040 <pcap_list_cursor_prev@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_prev>:
push   %rax
test   %rdi,%rdi
je     1132 <cmd_prev+0x12>
lea    0xed3(%rip),%rdi
call   1030 <warn_text_ui@plt>
xor    %eax,%eax
call   1040 <pcap_list_cursor_prev@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Unexpected argument for the prev command\00"
define i32 @cmd_prev(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @warn_text_ui(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = call i32 (...) @pcap_list_cursor_prev()
ret i32 1
}

LLVM IR (-O2):
@.str = [41 x i8] c"Unexpected argument for the prev command\00"
define i32 @cmd_prev(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @warn_text_ui(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (...) @pcap_list_cursor_prev()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_data_abort(void) { puts("BAD\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_data_abort() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_data_abort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(unsigned long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned long);
void *zalloc(unsigned long size) {
  void *ret = malloc(size);
  if (ret) {
    memset(ret, 0, size);
  }
  return ret;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <zalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @zalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int __attribute__((const)) lw6mat_mat4_v_index(int i_column, int j_row) {
  return i_column * 4 + j_row;
}


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

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

LLVM IR (-O0):
define i32 @lw6mat_mat4_v_index(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 = mul nsw i32 %5, 4
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @lw6mat_mat4_v_index(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 2
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_racket_char_string() {
  test_parser_verify_parse(test_parser_sourcefile("racket", " \"a\""), "racket",
                           "\"a\"", "", 0);
}


x86 assembly (clang, -O0):
<test_racket_char_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xebd(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_racket_char_string>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xeca(%rip),%rdx
lea    0xec6(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"racket\00"
@.str.1 = [5 x i8] c" \22a\22\00"
@.str.2 = [4 x i8] c"\22a\22\00"
@.str.3 = [1 x i8] zeroinitializer
define void @test_racket_char_string() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"racket\00"
@.str.1 = [5 x i8] c" \22a\22\00"
@.str.2 = [4 x i8] c"\22a\22\00"
@.str.3 = [1 x i8] zeroinitializer
define void @test_racket_char_string() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
double sqre(double a) { return a * a; }


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

x86 assembly (clang, -O2):
<sqre>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @sqre(double %0) {
%2 = fmul double %0, %0
ret double %2
}
int execute_mbind() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mbind() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  while (1) {
    printf("\nFAILURECODE:IHFOJFIO)U#)(**&$)(PJW)(#U)(U#P PJ# "
           "#)2323401010304123120 (U($ U$U)$)");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [83 x i8] c"\0AFAILURECODE:IHFOJFIO)U#)(**&$)(PJW)(#U)(U#P PJ# #)2323401010304123120 (U($ U$U)$)\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@.str = [83 x i8] c"\0AFAILURECODE:IHFOJFIO)U#)(**&$)(PJW)(#U)(U#P PJ# #)2323401010304123120 (U($ U$U)$)\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0))
br label %1
}
void *thread_a(void *arg) {
  int i;
  return 0;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @thread_a(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void utf8proc_free(void *udata, void *ptr) {
  (void)udata;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<utf8proc_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @utf8proc_free(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 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @utf8proc_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
int sequentialSearch(int array[], int key, int n) {
  int i, position = -1;
  for (i = 0; i < n; i++) {
    if (key == array[i]) {
      position = i;
      return position;
    }
  }
  return position;
}


x86 assembly (clang, -O0):
<sequentialSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1160 <sequentialSearch+0x60>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    114d <sequentialSearch+0x4d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <sequentialSearch+0x66>
jmp    1152 <sequentialSearch+0x52>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <sequentialSearch+0x1c>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequentialSearch>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <sequentialSearch+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %esi,(%rdi,%rcx,4)
je     111f <sequentialSearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <sequentialSearch+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sequentialSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Type definitions */
struct mesh_var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quad_border_cond(struct mesh_var *, int const, int const,
                                    int, int, int, int);
int /*<<< orphan*/ quad_mesh(struct mesh_var *, int const, int const);
void Shear_mesh(struct mesh_var *mv) {
  const int n_x_a = 0, n_y_a = 0;
  quad_mesh(mv, n_x_a, n_y_a);
  quad_border_cond(mv, n_x_a, n_y_a, -1, -3, -3, -3);
}


x86 assembly (clang, -O0):
<Shear_mesh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <quad_mesh@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    $0xfffffffd,%r9d
mov    %edx,%esi
mov    %r9d,%r8d
movl   $0xfffffffd,(%rsp)
call   1040 <quad_border_cond@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shear_mesh>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <quad_mesh@plt>
movl   $0xfffffffd,(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    $0xfffffffd,%r8d
mov    $0xfffffffd,%r9d
call   1040 <quad_border_cond@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.mesh_var = type { i32 }
define void @Shear_mesh(%struct.mesh_var* %0) {
%2 = alloca %struct.mesh_var*
%3 = alloca i32
%4 = alloca i32
store %struct.mesh_var* %0, %struct.mesh_var** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load %struct.mesh_var*, %struct.mesh_var** %2
%6 = call i32 @quad_mesh(%struct.mesh_var* %5, i32 0, i32 0)
%7 = load %struct.mesh_var*, %struct.mesh_var** %2
%8 = call i32 @quad_border_cond(%struct.mesh_var* %7, i32 0, i32 0, i32 -1, i32 -3, i32 -3, i32 -3)
ret void
}

LLVM IR (-O2):
%struct.mesh_var = type { i32 }
define void @Shear_mesh(%struct.mesh_var* %0) {
%2 = tail call i32 @quad_mesh(%struct.mesh_var* %0, i32 0, i32 0)
%3 = tail call i32 @quad_border_cond(%struct.mesh_var* %0, i32 0, i32 0, i32 -1, i32 -3, i32 -3, i32 -3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigtermHandler(int sig) {
  printf("Received SIGTERM, scheduling shutdown...");
  (void)sig;
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Received SIGTERM, scheduling shutdown...\00"
define void @sigtermHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Received SIGTERM, scheduling shutdown...\00"
define void @sigtermHandler(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int ftruncate(int, int /*<<< orphan*/);
int open(char const *, int /*<<< orphan*/);
int truncate(const char *path, off_t len) {
  int fd = open(path, O_WRONLY);
  int code = -1;
  if (fd >= 0) {
    code = ftruncate(fd, len);
    close(fd);
  }
  return code;
}


x86 assembly (clang, -O0):
<truncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     117b <truncate+0x4b>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
test   %eax,%eax
js     115f <truncate+0x2f>
mov    %eax,%ebp
mov    %eax,%edi
mov    %ebx,%esi
call   1030 <ftruncate@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1040 <close@plt>
mov    %ebx,%eax
jmp    1164 <truncate+0x34>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_WRONLY = global i32 0
define i32 @truncate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* @O_WRONLY
%9 = call i32 @open(i8* %7, i32 %8)
store i32 %9, i32* %5
store i32 -1, i32* %6
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @ftruncate(i32 %13, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %12, %2
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
define i32 @truncate(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = tail call i32 @open(i8* %0, i32 %3)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @ftruncate(i32 %4, i32 %1)
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %6, %2
%10 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int days_in_year(int /*<<< orphan*/);
int /*<<< orphan*/ year_from_time(double);
double in_leap_year(double t) { return days_in_year(year_from_time(t)) == 366; }


x86 assembly (clang, -O0):
<in_leap_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <year_from_time@plt>
mov    %eax,%edi
call   1030 <days_in_year@plt>
cmp    $0x16e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_leap_year>:
push   %rax
call   1040 <year_from_time@plt>
mov    %eax,%edi
call   1030 <days_in_year@plt>
cmp    $0x16e,%eax
je     1139 <in_leap_year+0x19>
xorps  %xmm0,%xmm0
pop    %rax
ret
movsd  0xebf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @in_leap_year(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @year_from_time(double %3)
%5 = call i32 @days_in_year(i32 %4)
%6 = icmp eq i32 %5, 366
%7 = zext i1 %6 to i32
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @in_leap_year(double %0) {
%2 = tail call i32 @year_from_time(double %0)
%3 = tail call i32 @days_in_year(i32 %2)
%4 = icmp eq i32 %3, 366
%5 = uitofp i1 %4 to double
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, int /*<<< orphan*/ *, int);
float copy_fi(uint32_t x) {
  float f;
  memcpy(&f, &x, 4);
  return f;
}


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

x86 assembly (clang, -O2):
<copy_fi>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @copy_fi(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = bitcast float* %3 to i8*
%5 = call i32 @memcpy(float* %3, i32* %2, i32 4)
%6 = load float, float* %3
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void set_string_to_null(char *str, int len) {
  memset(str, 0, sizeof(char) * len);
}


x86 assembly (clang, -O0):
<set_string_to_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_string_to_null>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @set_string_to_null(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 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(i8* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @set_string_to_null(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ regex_flag_icase_short(char, void *);
void regex_flag_icase_long(const char *s __attribute__((unused)),
                           const char *const unused __attribute__((unused)),
                           void *data) {
  regex_flag_icase_short('i', data);
}


x86 assembly (clang, -O0):
<regex_flag_icase_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x69,%edi
call   1030 <regex_flag_icase_short@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regex_flag_icase_long>:
mov    $0x69,%edi
mov    %rdx,%rsi
jmp    1030 <regex_flag_icase_short@plt>

LLVM IR (-O0):
define void @regex_flag_icase_long(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @regex_flag_icase_short(i8 signext 105, i8* %7)
ret void
}

LLVM IR (-O2):
define void @regex_flag_icase_long(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @regex_flag_icase_short(i8 signext 105, i8* %2)
ret void
}
/* Variables and functions */
int adb_condition(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int adb_is_symlink(const char *path) {
  char buf[2048] = {0};
  sprintf(buf, "-L %s", path);
  return adb_condition(buf);
}


x86 assembly (clang, -O0):
<adb_is_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1030 <memset@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1040 <adb_condition@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adb_is_symlink>:
push   %r14
push   %rbx
sub    $0x808,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x800,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xeaa(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <adb_condition@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"-L %s\00"
define i32 @adb_is_symlink(i8* %0) {
%2 = alloca i8*
%3 = alloca [2048 x i8]
store i8* %0, i8** %2
%4 = bitcast [2048 x i8]* %3 to i8*
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @adb_condition(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"-L %s\00"
define i32 @adb_is_symlink(i8* %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @adb_condition(i8* %3)
ret i32 %5
}
/* Variables and functions */
unsigned char *back_pixels();
unsigned char *front_pixels(void) { return back_pixels(); }


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

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

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

LLVM IR (-O2):
define i8* @front_pixels() {
%1 = tail call i8* (...) @back_pixels()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void portable_free(void *p) { free(p); }


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

LLVM IR (-O0):
define void @portable_free(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 @portable_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
char *PHYSFS_getBaseDir();
int /*<<< orphan*/ printf(char *, char *);
int cmd_getbasedir(char *args) {
  printf("Base dir is [%s].\n", PHYSFS_getBaseDir());
  return (1);
}


x86 assembly (clang, -O0):
<cmd_getbasedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <PHYSFS_getBaseDir@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_getbasedir>:
push   %rax
xor    %eax,%eax
call   1040 <PHYSFS_getBaseDir@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Base dir is [%s].\0A\00"
define i32 @cmd_getbasedir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* (...) @PHYSFS_getBaseDir()
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [19 x i8] c"Base dir is [%s].\0A\00"
define i32 @cmd_getbasedir(i8* nocapture readnone %0) {
%2 = tail call i8* (...) @PHYSFS_getBaseDir()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 1
}