xunge/DecIR huggingface dataset:
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzUnaryFunc_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKDOWN_DELAYED(int, int /*<<< orphan*/);
int /*<<< orphan*/ SEND_DATAOFF_DELAYED(int /*<<< orphan*/, int);
void BrzUnaryFuncPush_ackdown(struct comp *comp, int port) {
  struct BrzUnaryFunc_ *c = (struct BrzUnaryFunc_ *)comp;
  SEND_ACKDOWN_DELAYED(1, 0);
  SEND_DATAOFF_DELAYED(0, 1);
}


x86 assembly (clang, -O0):
<BrzUnaryFuncPush_ackdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <SEND_DATAOFF_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzUnaryFuncPush_ackdown>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <SEND_ACKDOWN_DELAYED@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <SEND_DATAOFF_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzUnaryFunc_ = type { i32 }
define void @BrzUnaryFuncPush_ackdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzUnaryFunc_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzUnaryFunc_*
store %struct.BrzUnaryFunc_* %7, %struct.BrzUnaryFunc_** %5
%8 = call i32 @SEND_ACKDOWN_DELAYED(i32 1, i32 0)
%9 = call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzUnaryFuncPush_ackdown(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKDOWN_DELAYED(i32 1, i32 0)
%4 = tail call i32 @SEND_DATAOFF_DELAYED(i32 0, i32 1)
ret void
}
/* Variables and functions */
int addInstructionToMemory(int);
int createEndInstruction(char tokenArray[][20], int numberOfTokens) {
  int instruction = 54 * 10000;
  if (addInstructionToMemory(instruction) == -1)
    return -1;
  ;
  return 1;
}


x86 assembly (clang, -O0):
<createEndInstruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x83d60,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <addInstructionToMemory@plt>
cmp    $0xffffffff,%eax
jne    1143 <createEndInstruction+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <createEndInstruction+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createEndInstruction>:
push   %rax
mov    $0x83d60,%edi
call   1030 <addInstructionToMemory@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @createEndInstruction([20 x i8]* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [20 x i8]*
%5 = alloca i32
%6 = alloca i32
store [20 x i8]* %0, [20 x i8]** %4
store i32 %1, i32* %5
store i32 540000, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @addInstructionToMemory(i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 1, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @createEndInstruction([20 x i8]* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @addInstructionToMemory(i32 540000)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i32 -1, i32 1
ret i32 %5
}
struct m *get_ptr(struct m *m) {
  return m;
}


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

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

LLVM IR (-O0):
%struct.m = type opaque
define %struct.m* @get_ptr(%struct.m* %0) {
%2 = alloca %struct.m*
store %struct.m* %0, %struct.m** %2
%3 = load %struct.m*, %struct.m** %2
ret %struct.m* %3
}

LLVM IR (-O2):
%struct.m = type opaque
define %struct.m* @get_ptr(%struct.m* readnone returned %0) {
ret %struct.m* %0
}
void convert_input_coord() {}


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

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

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

LLVM IR (-O2):
define void @convert_input_coord() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 2 * -1 - 1;
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffd,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
mov    $0xfffffffd,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -3)
ret i32 0
}
float Scl_Int2Flt(int i) { return (float)i / 1000; }


x86 assembly (clang, -O0):
<Scl_Int2Flt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xeec(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_Int2Flt>:
cvtsi2ss %edi,%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @Scl_Int2Flt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = fdiv float %4, 1.000000e+03
ret float %5
}

LLVM IR (-O2):
define float @Scl_Int2Flt(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fdiv float %2, 1.000000e+03
ret float %3
}
int fetrans_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fetrans_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int strbegins_p(const char *str, const char *start) {
  return (strncmp(str, start, strlen(start)) == 0);
}


x86 assembly (clang, -O0):
<strbegins_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbegins_p>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @strbegins_p(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @strbegins_p(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct _stor_lookup_destroy_rsp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_lookup_destroy_rsp *);
void stor_lookup_destroy_rsp_free(struct _stor_lookup_destroy_rsp *ptr) {
  free(ptr);
}


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

LLVM IR (-O0):
%struct._stor_lookup_destroy_rsp = type { i32 }
define void @stor_lookup_destroy_rsp_free(%struct._stor_lookup_destroy_rsp* %0) {
%2 = alloca %struct._stor_lookup_destroy_rsp*
store %struct._stor_lookup_destroy_rsp* %0, %struct._stor_lookup_destroy_rsp** %2
%3 = load %struct._stor_lookup_destroy_rsp*, %struct._stor_lookup_destroy_rsp** %2
%4 = call i32 @free(%struct._stor_lookup_destroy_rsp* %3)
ret void
}

LLVM IR (-O2):
%struct._stor_lookup_destroy_rsp = type { i32 }
define void @stor_lookup_destroy_rsp_free(%struct._stor_lookup_destroy_rsp* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_lookup_destroy_rsp* %0)
ret void
}
/* Variables and functions */
float fabsf(float);
bool warp_fp_cmp(float a, float b, float eps) { return fabsf(a - b) < eps; }


x86 assembly (clang, -O0):
<warp_fp_cmp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_fp_cmp>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
xor    %eax,%eax
ucomiss %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @warp_fp_cmp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = call float @llvm.fabs.f32(float %9)
%11 = load float, float* %6
%12 = fcmp olt float %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @warp_fp_cmp(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fcmp olt float %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __gettimeofday(struct timeval *tv, struct timezone *tz) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@ENOSYS = global i32 0
define i32 @__gettimeofday(%struct.timeval* %0, %struct.timezone* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timezone*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timezone* %1, %struct.timezone** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@ENOSYS = global i32 0
define i32 @__gettimeofday(%struct.timeval* nocapture readnone %0, %struct.timezone* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char name[21];
  printf("Enter a name\n");
  scanf("%s", name);
  printf("\nYou entered  ");
  puts(name);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1060 <scanf@plt>
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter a name\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"\0AYou entered \00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
%8 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [15 x i8] c"\0AYou entered \00"
@str = [13 x i8] c"Enter a name\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
%7 = call i32 (...) @getchar()
ret i32 0
}
unsigned short int unsignedshortint_ignoring_unsignedint(unsigned short int x,
                                                         unsigned int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_unsignedint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_unsignedint(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
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_unsignedint(i16 returned zeroext %0, i32 %1) {
ret i16 %0
}
double relu_activate(const double x) { return x * (x > 0); }


x86 assembly (clang, -O0):
<relu_activate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
xorps  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<relu_activate>:
xorpd  %xmm1,%xmm1
cmpltsd %xmm0,%xmm1
movsd  0xeef(%rip),%xmm2
andpd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @relu_activate(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = sitofp i32 %6 to double
%8 = fmul double %3, %7
ret double %8
}

LLVM IR (-O2):
define double @relu_activate(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = uitofp i1 %2 to double
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
float const M_PI_2;
scalar_t__ floor(float const);
unsigned char lash_getQuadrant(const float rads) {
  int mod, quad;
  mod = (int)floor(rads / M_PI_2);
  quad = mod % 4;
  if (mod < 0)
    if (quad != 0)
      quad += 4;
  return quad + 1;
}


x86 assembly (clang, -O0):
<lash_getQuadrant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
divss  (%rax),%xmm0
call   1030 <floor@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1165 <lash_getQuadrant+0x55>
cmpl   $0x0,-0xc(%rbp)
je     1160 <lash_getQuadrant+0x50>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1165 <lash_getQuadrant+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lash_getQuadrant>:
push   %rax
xorps  %xmm1,%xmm1
divss  %xmm1,%xmm0
call   1030 <floor@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
mov    %eax,%edx
sub    %ecx,%edx
lea    0x4(%rdx),%ecx
test   %edx,%edx
movzbl %cl,%ecx
cmove  %edx,%ecx
test   %eax,%eax
cmovns %edx,%ecx
add    $0x1,%cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@M_PI_2 = constant float 0.000000e+00
define zeroext i8 @lash_getQuadrant(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = load float, float* @M_PI_2
%7 = fdiv float %5, %6
%8 = call i64 @floor(float %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = srem i32 %10, 4
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %1
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 4
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %14
br label %21
21: ; preds = %20, %1
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
%24 = trunc i32 %23 to i8
ret i8 %24
}

LLVM IR (-O2):
@M_PI_2 = constant float 0.000000e+00
define zeroext i8 @lash_getQuadrant(float %0) {
%2 = fdiv float %0, 0.000000e+00
%3 = tail call i64 @floor(float %2)
%4 = trunc i64 %3 to i32
%5 = srem i32 %4, 4
%6 = icmp slt i32 %4, 0
%7 = icmp ne i32 %5, 0
%8 = and i1 %6, %7
%9 = add nsw i32 %5, 4
%10 = select i1 %8, i32 %9, i32 %5
%11 = trunc i32 %10 to i8
%12 = add nsw i8 %11, 1
ret i8 %12
}
void UARTEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) |= 0x00000010;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) |=
      (0x00000001 | 0x00000100 | 0x00000200);
}


x86 assembly (clang, -O0):
<UARTEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x2c(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
or     $0x301,%rcx
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTEnable>:
orq    $0x10,0x2c(%rdi)
orq    $0x301,0x30(%rdi)
ret

LLVM IR (-O0):
define void @UARTEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 44
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 48
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 769
store volatile i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @UARTEnable(i64 %0) {
%2 = add i64 %0, 44
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16
store volatile i64 %5, i64* %3
%6 = add i64 %0, 48
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, 769
store volatile i64 %9, i64* %7
ret void
}
main() {
  int i;
  int a, b, c;
  for (i = 0; i < 1000; i++) {
    if (i % 17)
      a++;
    else
      b++;
    c++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1161 <main+0x61>
mov    -0x8(%rbp),%eax
mov    $0x11,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1141 <main+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114a <main+0x4a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *enrealloc(int, void *, size_t);
void *erealloc(void *p, size_t size) { return enrealloc(1, p, size); }


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

x86 assembly (clang, -O2):
<erealloc>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <enrealloc@plt>

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

LLVM IR (-O2):
define i8* @erealloc(i8* %0, i64 %1) {
%3 = tail call i8* @enrealloc(i32 1, i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printName();
int main() {
  printName();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printName()
ret i32 0
}
/* Variables and functions */
float floorf(float);
float ceilf(float x) { return -floorf(-x); }


x86 assembly (clang, -O0):
<ceilf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <floorf@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceilf>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <floorf@plt>
xorps  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ceilf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call float @llvm.floor.f32(float %4)
%6 = fneg float %5
ret float %6
}

LLVM IR (-O2):
define float @ceilf(float %0) {
%2 = fneg float %0
%3 = tail call float @llvm.floor.f32(float %2)
%4 = fneg float %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int mkdir_251main() {
  int i;
  for (i = 0; i < 48500000; i++)
    putchar(251);
  return 0;
}


x86 assembly (clang, -O0):
<mkdir_251main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2e40d20,-0x4(%rbp)
jge    1144 <mkdir_251main+0x34>
mov    $0xfb,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <mkdir_251main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir_251main>:
push   %rbx
mov    $0x2e40d20,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xfb,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <mkdir_251main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mkdir_251main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 48500000
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @putchar(i32 251)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @mkdir_251main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @putchar(i32 251)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 48500000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func_b();
void func_a() { func_b(); }


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

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

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

LLVM IR (-O2):
define void @func_a() {
%1 = tail call i32 (...) @func_b()
ret void
}
double transresswitch(width, nchannel, stack)
double width;
int nchannel;
int stack;
{
  double restrans;
  restrans = (nchannel) ? (25800) : (61200);
  return ((1.0 + ((stack - 1.0) * 0.8)) * restrans / width);
}


x86 assembly (clang, -O0):
<transresswitch>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    $0xef10,%eax
mov    $0x64c8,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xebc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<transresswitch>:
test   %edi,%edi
mov    $0xef10,%eax
mov    $0x64c8,%ecx
cmove  %eax,%ecx
cvtsi2sd %ecx,%xmm2
cvtsi2sd %esi,%xmm1
addsd  0xee1(%rip),%xmm1
mulsd  0xee1(%rip),%xmm1
addsd  0xee1(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @transresswitch(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 25800, i32 61200
%12 = sitofp i32 %11 to double
store double %12, double* %7
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to double
%15 = fsub double %14, 1.000000e+00
%16 = call double @llvm.fmuladd.f64(double %15, double 8.000000e-01, double 1.000000e+00)
%17 = load double, double* %7
%18 = fmul double %16, %17
%19 = load double, double* %4
%20 = fdiv double %18, %19
ret double %20
}

LLVM IR (-O2):
define double @transresswitch(double %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 61200, i32 25800
%6 = sitofp i32 %5 to double
%7 = sitofp i32 %2 to double
%8 = fadd double %7, -1.000000e+00
%9 = tail call double @llvm.fmuladd.f64(double %8, double 8.000000e-01, double 1.000000e+00)
%10 = fmul double %9, %6
%11 = fdiv double %10, %0
ret double %11
}
void foo() { printf("%s\n", __func__); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__func__.foo = [4 x i8] c"foo\00"
define void @foo() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.foo, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.foo = [4 x i8] c"foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.foo, i64 0, i64 0))
ret void
}
void gc314ChannelAbort(int filedes, int channel) {
  int retval;
  int status = 0;
}


x86 assembly (clang, -O0):
<gc314ChannelAbort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gc314ChannelAbort(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%i", &n);
  data(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <data@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @data(i32 %4)
ret i32 0
}
int test_imm_B5int8_mem(signed char *val) {
  return ((*val) & (0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xb5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_B5int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 181
%7 = icmp ne i32 %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_B5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -75
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void *mythread(void *p) { sleep(2); }


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

x86 assembly (clang, -O2):
<mythread>:
mov    $0x2,%edi
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define noalias i8* @mythread(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 2)
ret i8* undef
}
/* Variables and functions */
long double remquo(double, double, int *);
__attribute__((weak)) long double remquol(long double x, long double y,
                                          int *i) {
  return remquo((double)x, (double)y, i);
}


x86 assembly (clang, -O0):
<remquol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %rdi,-0x28(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
mov    -0x28(%rbp),%rdi
call   1030 <remquo@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remquol>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <remquo@plt>

LLVM IR (-O0):
define weak x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca i32*
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store i32* %2, i32** %6
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = load x86_fp80, x86_fp80* %5
%10 = fptrunc x86_fp80 %9 to double
%11 = load i32*, i32** %6
%12 = call x86_fp80 @remquo(double %8, double %10, i32* %11)
ret x86_fp80 %12
}

LLVM IR (-O2):
define weak x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = fptrunc x86_fp80 %0 to double
%5 = fptrunc x86_fp80 %1 to double
%6 = tail call x86_fp80 @remquo(double %4, double %5, i32* %2)
ret x86_fp80 %6
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdec1pi(int v) { ngen("%s\t$%d,(%%eax)", "subl", v); }


x86 assembly (clang, -O0):
<cgdec1pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdec1pi>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s\09$%d,(%%eax)\00"
@.str.1 = [5 x i8] c"subl\00"
define void @cgdec1pi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s\09$%d,(%%eax)\00"
@.str.1 = [5 x i8] c"subl\00"
define void @cgdec1pi(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
int lnblnk_(char *chline, int len) {
  char *chcur;
  chcur = chline + len;
  while (chcur > chline) {
    if (*--chcur != ' ')
      goto exit;
  }
  return 0;
exit:
  return chcur + 1 - chline;
}


x86 assembly (clang, -O0):
<lnblnk_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    114e <lnblnk_+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x20,%eax
je     1149 <lnblnk_+0x49>
jmp    115a <lnblnk_+0x5a>
jmp    111a <lnblnk_+0x1a>
movl   $0x0,-0x4(%rbp)
jmp    116c <lnblnk_+0x6c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnblnk_>:
movslq %esi,%rax
lea    (%rdi,%rax,1),%rcx
add    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmp    %rdi,%rcx
jbe    1123 <lnblnk_+0x23>
add    $0xffffffff,%eax
cmpb   $0x20,-0x1(%rcx)
lea    -0x1(%rcx),%rcx
je     1110 <lnblnk_+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @lnblnk_(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %8, %2
%6 = phi i8* [ %4, %2 ], [ %9, %8 ]
%7 = icmp ugt i8* %6, %0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 32
br i1 %11, label %5, label %12
12: ; preds = %8
%13 = ptrtoint i8* %6 to i64
%14 = ptrtoint i8* %0 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %5, %12
%18 = phi i32 [ %16, %12 ], [ 0, %5 ]
ret i32 %18
}
/* Variables and functions */
int strlen(const char *str) {
  const char *cstr;
  int i;
  for (i = 0, cstr = str; *cstr != 0; cstr++, i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1146 <strlen+0x46>
jmp    112c <strlen+0x2c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <strlen+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void func4(int i) {
  typeof(i = 0, 1) j;
  typeof(int *) pi;
}


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

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

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

LLVM IR (-O2):
define void @func4(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int myopen(char const *, int, int /*<<< orphan*/);
int creat(const char *pathname, mode_t mode) {
  return myopen(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <myopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2ee1(%rip),%rcx
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <myopen@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(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* @O_CREAT
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @myopen(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @myopen(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
char *strcpy(char *dest, const char *src) {
  while (*src) {
    *dest++ = *src++;
  }
  *dest = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcpy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ close_saving_errno(int);
scalar_t__ merge_flags(int, int);
int mkstemp(char *);
int mkostemp(char *template, int flags) {
  int newfd = mkstemp(template);
  if (newfd == -1)
    return -1;
  if (merge_flags(newfd, flags) < 0) {
    close_saving_errno(newfd);
    return -1;
  }
  return newfd;
}


x86 assembly (clang, -O0):
<mkostemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mkstemp@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1161 <mkostemp+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <mkostemp+0x60>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <merge_flags@plt>
cmp    $0x0,%rax
jge    118a <mkostemp+0x5a>
mov    -0x18(%rbp),%edi
call   1030 <close_saving_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <mkostemp+0x60>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkostemp>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
call   1040 <mkstemp@plt>
mov    $0xffffffff,%ebx
cmp    $0xffffffff,%eax
je     1162 <mkostemp+0x32>
mov    %eax,%ebp
mov    %eax,%edi
mov    %r14d,%esi
call   1050 <merge_flags@plt>
test   %rax,%rax
js     115b <mkostemp+0x2b>
mov    %ebp,%ebx
jmp    1162 <mkostemp+0x32>
mov    %ebp,%edi
call   1030 <close_saving_errno@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i32 @mkstemp(i8* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %22
12: ; preds = %2
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = call i64 @merge_flags(i32 %13, i32 %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* %6
%19 = call i32 @close_saving_errno(i32 %18)
store i32 -1, i32* %3
br label %22
20: ; preds = %12
%21 = load i32, i32* %6
store i32 %21, i32* %3
br label %22
22: ; preds = %20, %17, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = tail call i32 @mkstemp(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @merge_flags(i32 %3, i32 %1)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @close_saving_errno(i32 %3)
br label %10
10: ; preds = %5, %2, %8
%11 = phi i32 [ -1, %8 ], [ -1, %2 ], [ %3, %5 ]
ret i32 %11
}