xunge/DecIR huggingface dataset:
unsigned short Read2Byte(char **src) {
  unsigned short *sp = (unsigned short *)(*src);
  *src += 2;
  return *sp;
}


x86 assembly (clang, -O0):
<Read2Byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
movzwl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read2Byte>:
mov    (%rdi),%rax
lea    0x2(%rax),%rcx
mov    %rcx,(%rdi)
movzwl (%rax),%eax
ret

LLVM IR (-O0):
define zeroext i16 @Read2Byte(i8** %0) {
%2 = alloca i8**
%3 = alloca i16*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i16*
store i16* %6, i16** %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8* %9, i8** %7
%10 = load i16*, i16** %3
%11 = load i16, i16* %10
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @Read2Byte(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = bitcast i8* %2 to i16*
%4 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %4, i8** %0
%5 = load i16, i16* %3
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ operation_sleep();
int /*<<< orphan*/ set_wakeup_timer(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
void operation_sleep_notimer(void) {
  set_wakeup_timer(0, 0, 0);
  operation_sleep();
}


x86 assembly (clang, -O0):
<operation_sleep_notimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <set_wakeup_timer@plt>
mov    $0x0,%al
call   1030 <operation_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_sleep_notimer>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <set_wakeup_timer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <operation_sleep@plt>

LLVM IR (-O0):
define void @operation_sleep_notimer() {
%1 = call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = call i32 (...) @operation_sleep()
ret void
}

LLVM IR (-O2):
define void @operation_sleep_notimer() {
%1 = tail call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = tail call i32 (...) @operation_sleep()
ret void
}
void unused_handler() {
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<unused_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <unused_handler+0x9>
jmp    1109 <unused_handler+0x9>

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

LLVM IR (-O0):
define void @unused_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @unused_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
int main(void) {
  int a = 4;
  int b = 1;
  if (a > 10 || !b)
    a = 8;
  else
    a = 1;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     112d <main+0x2d>
cmpl   $0x0,-0xc(%rbp)
jne    1139 <main+0x39>
movl   $0x8,-0x8(%rbp)
jmp    1140 <main+0x40>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int fio_read_32(int /*<<< orphan*/ *, int);
float fio_read_float32(FILE *f, int is_big_endian) {
  int val;
  float *p, q;
  val = fio_read_32(f, is_big_endian);
  p = (float *)(&val);
  q = *p;
  return q;
}


x86 assembly (clang, -O0):
<fio_read_float32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <fio_read_32@plt>
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_read_float32>:
push   %rax
call   1030 <fio_read_32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fio_read_float32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca float*
%7 = alloca float
store i32* %0, i32** %3
store i32 %1, i32* %4
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = call i32 @fio_read_32(i32* %8, i32 %9)
store i32 %10, i32* %5
%11 = bitcast i32* %5 to float*
store float* %11, float** %6
%12 = load float*, float** %6
%13 = load float, float* %12
store float %13, float* %7
%14 = load float, float* %7
ret float %14
}

LLVM IR (-O2):
define float @fio_read_float32(i32* %0, i32 %1) {
%3 = tail call i32 @fio_read_32(i32* %0, i32 %1)
%4 = bitcast i32 %3 to float
ret float %4
}
void EPIFIFOConfig(unsigned long ulBase, unsigned long ulConfig) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000200))) = ulConfig;
}


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

x86 assembly (clang, -O2):
<EPIFIFOConfig>:
mov    %rsi,0x200(%rdi)
ret

LLVM IR (-O0):
define void @EPIFIFOConfig(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 512
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIFIFOConfig(i64 %0, i64 %1) {
%3 = add i64 %0, 512
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
double tv_seconds(struct timeval const *);
double tv_diff(const struct timeval *tv1, const struct timeval *tv0) {
  return tv_seconds(tv1) - tv_seconds(tv0);
}


x86 assembly (clang, -O0):
<tv_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tv_seconds@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <tv_seconds@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tv_diff>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <tv_seconds@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <tv_seconds@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define double @tv_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = call double @tv_seconds(%struct.timeval* %5)
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = call double @tv_seconds(%struct.timeval* %7)
%9 = fsub double %6, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define double @tv_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = tail call double @tv_seconds(%struct.timeval* %0)
%4 = tail call double @tv_seconds(%struct.timeval* %1)
%5 = fsub double %3, %4
ret double %5
}
void rop3_142_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk2 = S ^ *D;
  stk3 = T ^ *D;
  stk2 = stk2 & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_142_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xc(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_142_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = xor i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %8
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = xor i32 %18, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = load i8, i8* %9
%27 = zext i8 %26 to i32
%28 = and i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %8
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
%32 = load i8, i8* %8
%33 = zext i8 %32 to i32
%34 = xor i32 %31, %33
%35 = trunc i32 %34 to i8
store i8 %35, i8* %7
%36 = load i8, i8* %7
%37 = zext i8 %36 to i32
%38 = load i8, i8* %5
%39 = zext i8 %38 to i32
%40 = xor i32 %39, -1
%41 = and i32 %37, %40
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = xor i32 %43, -1
%45 = and i32 %41, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %5
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = load i8*, i8** %4
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = load i8, i8* %6
%57 = zext i8 %56 to i32
%58 = and i32 %55, %57
%59 = or i32 %52, %58
%60 = trunc i32 %59 to i8
%61 = load i8*, i8** %4
store i8 %60, i8* %61
ret void
}

LLVM IR (-O2):
define void @rop3_142_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
double mod(double a, double b) {
  int neg = 0;
  if (a < 0) {
    a *= -1;
    neg = 1;
  }
  while (a > b) {
    a -= b;
  }
  if (neg) {
    return b - a;
  }
  return a;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113c <mod+0x3c>
movsd  0xed5(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    1141 <mod+0x41>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1169 <mod+0x69>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1141 <mod+0x41>
cmpl   $0x0,-0x1c(%rbp)
je     1187 <mod+0x87>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1191 <mod+0x91>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
movapd %xmm0,%xmm2
movapd 0xef4(%rip),%xmm4
xorpd  %xmm0,%xmm4
xorpd  %xmm3,%xmm3
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm4
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
orpd   %xmm4,%xmm3
ucomisd %xmm1,%xmm3
jbe    113a <mod+0x3a>
nop
subsd  %xmm1,%xmm3
ucomisd %xmm1,%xmm3
ja     1130 <mod+0x30>
subsd  %xmm3,%xmm1
andpd  %xmm0,%xmm1
andnpd %xmm3,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 0, i32* %6
%7 = load double, double* %4
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load double, double* %4
%11 = fmul double %10, -1.000000e+00
store double %11, double* %4
store i32 1, i32* %6
br label %12
12: ; preds = %9, %2
br label %13
13: ; preds = %17, %12
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load double, double* %5
%19 = load double, double* %4
%20 = fsub double %19, %18
store double %20, double* %4
br label %13
21: ; preds = %13
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load double, double* %5
%26 = load double, double* %4
%27 = fsub double %25, %26
store double %27, double* %3
br label %30
28: ; preds = %21
%29 = load double, double* %4
store double %29, double* %3
br label %30
30: ; preds = %28, %24
%31 = load double, double* %3
ret double %31
}

LLVM IR (-O2):
define double @mod(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %4, double %0
%6 = fcmp ogt double %5, %1
br i1 %6, label %7, label %11
7: ; preds = %2, %7
%8 = phi double [ %9, %7 ], [ %5, %2 ]
%9 = fsub double %8, %1
%10 = fcmp ogt double %9, %1
br i1 %10, label %7, label %11
11: ; preds = %7, %2
%12 = phi double [ %5, %2 ], [ %9, %7 ]
%13 = fsub double %1, %12
%14 = select i1 %3, double %13, double %12
ret double %14
}
unsigned long insert_ras(insn, value, errmsg)
unsigned long insn;
long value;
const char **errmsg;
{
  if (value == 0)
    *errmsg = "invalid register operand when updating";
  return insn | ((value & 0x1f) << 16);
}


x86 assembly (clang, -O0):
<insert_ras>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <insert_ras+0x29>
mov    -0x18(%rbp),%rax
lea    0xeda(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_ras>:
mov    %rsi,%rax
test   %rsi,%rsi
jne    1112 <insert_ras+0x12>
lea    0xef1(%rip),%rcx
mov    %rcx,(%rdx)
and    $0x1f,%eax
shl    $0x10,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ras(i64 %0, i64 %1, i8** %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8**
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i8**, i8*** %6
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %10
br label %11
11: ; preds = %9, %3
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = and i64 %13, 31
%15 = shl i64 %14, 16
%16 = or i64 %12, %15
ret i64 %16
}

LLVM IR (-O2):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ras(i64 %0, i64 %1, i8** nocapture writeonly %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %5, label %6
5: ; preds = %3
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %3
%7 = shl i64 %1, 16
%8 = and i64 %7, 2031616
%9 = or i64 %8, %0
ret i64 %9
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ func(int);
int /*<<< orphan*/ func2(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  func(1);
  func2(0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1040 <func@plt>
xor    %edi,%edi
call   1030 <func2@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <func@plt>
xor    %edi,%edi
call   1030 <func2@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @func(i32 1)
%7 = call i32 @func2(i32 0)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @func(i32 1)
%4 = tail call i32 @func2(i32 0)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_close_solution_input_file(int k) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(137, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_close_solution_input_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x89,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_close_solution_input_file>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x89,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_close_solution_input_file(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %2
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 137, i32* %2, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_close_solution_input_file(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 137, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int my_number = 37;
  int *iptr = &my_number;
  printf("La direccion de memoria de my_number es:%p\n", (void *)iptr);
  printf("El valor de my_number es:%d\n", *iptr);
  *iptr = 73;
  printf("El valor de my_number es:%d\n", *iptr);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x25,0xc(%rsp)
lea    0xc(%rsp),%rsi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xef3(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movl   $0x49,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x49,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"La direccion de memoria de my_number es:%p\0A\00"
@.str.1 = [29 x i8] c"El valor de my_number es:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 37, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32*, i32** %2
store i32 73, i32* %10
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"La direccion de memoria de my_number es:%p\0A\00"
@.str.1 = [29 x i8] c"El valor de my_number es:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 37, i32* %1
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %6)
store i32 73, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 73)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool s337_get_error(const uint8_t *p_s337) { return p_s337[5] & 0x80; }


x86 assembly (clang, -O0):
<s337_get_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s337_get_error>:
mov    $0x80,%eax
and    0x14(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @s337_get_error(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 128
ret i32 %6
}

LLVM IR (-O2):
define i32 @s337_get_error(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = and i32 %3, 128
ret i32 %4
}
unsigned short xml_encode_iso_8859_1(unsigned char c) {
  return (unsigned short)c;
}


x86 assembly (clang, -O0):
<xml_encode_iso_8859_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @xml_encode_iso_8859_1(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @xml_encode_iso_8859_1(i8 zeroext %0) {
%2 = zext i8 %0 to i16
ret i16 %2
}
char *strcat(char *dest, const char *src) {
  while (*dest)
    dest++;
  do {
    *dest++ = *src++;
  } while (*src != 0);
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <strcat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcat+0xc>
jmp    112f <strcat+0x2f>
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)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <strcat+0x2f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
mov    $0xffffffffffffffff,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %dl,(%rax,%rcx,1)
movzbl 0x2(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1130 <strcat+0x30>
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @strcat(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** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
br label %5
12: ; preds = %5
br label %13
13: ; preds = %19, %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8, i8* %14
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
store i8 %16, i8* %17
br label %19
19: ; preds = %13
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %13, label %24
24: ; preds = %19
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
br label %10
10: ; preds = %8, %10
%11 = phi i8 [ %16, %10 ], [ %9, %8 ]
%12 = phi i8* [ %15, %10 ], [ %4, %8 ]
%13 = phi i8* [ %14, %10 ], [ %1, %8 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %12
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %10
18: ; preds = %10
ret i8* %15
}
__attribute__((visibility("default"))) void Bin2IntelHEX() {}


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

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

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

LLVM IR (-O2):
define void @Bin2IntelHEX() {
ret void
}
/* Variables and functions */
int read(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ shift(char *, int, int);
int main() {
  char a[100];
  int n, b;
  b = read(a);
  scanf("\n%d", &n);
  shift(a, n, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <read@plt>
mov    %eax,-0x78(%rbp)
lea    0xeab(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x74(%rbp),%esi
mov    -0x78(%rbp),%edx
call   1040 <shift@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x78,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <read@plt>
mov    %eax,%ebp
lea    0xeb4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1040 <shift@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i32 @read(i8* %5)
store i32 %6, i32* %4
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @shift(i8* %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 @read(i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @shift(i8* %3, i32 %7, i32 %5)
ret i32 0
}
int GetUtf8ByteNumForWord(unsigned char firstCh) {
  unsigned char temp = 0x80;
  int num = 0;
  while (temp & firstCh) {
    num++;
    temp = (temp >> 1);
  }
  return num;
}


x86 assembly (clang, -O0):
<GetUtf8ByteNumForWord>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x80,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
movzbl -0x1(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1140 <GetUtf8ByteNumForWord+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x2(%rbp)
jmp    1115 <GetUtf8ByteNumForWord+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUtf8ByteNumForWord>:
xor    %eax,%eax
test   $0x80,%dil
je     1119 <GetUtf8ByteNumForWord+0x19>
mov    $0x80,%ecx
xor    %eax,%eax
nop
add    $0x1,%eax
shr    %ecx
test   %edi,%ecx
jne    1110 <GetUtf8ByteNumForWord+0x10>
ret

LLVM IR (-O0):
define i32 @GetUtf8ByteNumForWord(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %2
store i8 -128, i8* %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %5
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = ashr i32 %16, 1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %3
br label %5
19: ; preds = %5
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @GetUtf8ByteNumForWord(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = phi i32 [ %9, %5 ], [ 128, %1 ]
%8 = add nuw nsw i32 %6, 1
%9 = lshr i32 %7, 1
%10 = and i32 %9, %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %13
}
unsigned xrop3_109_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = T | D;
  stk3 = S & stk4;
  stk2 = D ^ stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_109_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_109_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
lea    (%rsi,%rcx,1),%edx
or     $0xff,%ecx
and    %eax,%ecx
xor    %edx,%ecx
xor    $0xffffff00,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_109_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %6
%28 = load i32, i32* %11
%29 = and i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %5
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %7
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = xor i32 %36, -1
store i32 %37, i32* %8
%38 = load i32, i32* %8
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_109_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = and i32 %8, %4
%10 = xor i32 %7, %9
%11 = xor i32 %10, -256
%12 = xor i32 %4, -1
%13 = and i32 %11, %12
%14 = or i32 %13, %3
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, char *);
int test_map_cb(void *data) {
  printf("item %p = '%s'\n", data, (char *)data);
  return 0;
}


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

x86 assembly (clang, -O2):
<test_map_cb>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"item %p = '%s'\0A\00"
define i32 @test_map_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"item %p = '%s'\0A\00"
define i32 @test_map_cb(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret i32 0
}
int main() {
  int *localArr = (int *)0x00000000;
  int *remoteArr1 = (int *)0x02000000;
  int *remoteArr2 = (int *)0x04000000;
  int *remoteArr3 = (int *)0x06000000;
  *(localArr) = 0;
  *(remoteArr1) = 1;
  *(remoteArr2) = 2;
  *(remoteArr3) = 3;
  *(localArr + 1) = *(remoteArr1);
  *(localArr + 2) = *(remoteArr2);
  *(localArr + 3) = *(remoteArr3);
  *(localArr + 4) = *(localArr) + 4;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x2000000,%eax
mov    %rax,-0x18(%rbp)
mov    $0x4000000,%eax
mov    %rax,-0x20(%rbp)
mov    $0x6000000,%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x4,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x10(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
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* null, i32** %2
store i32* inttoptr (i64 33554432 to i32*), i32** %3
store i32* inttoptr (i64 67108864 to i32*), i32** %4
store i32* inttoptr (i64 100663296 to i32*), i32** %5
%6 = load i32*, i32** %2
store i32 0, i32* %6
%7 = load i32*, i32** %3
store i32 1, i32* %7
%8 = load i32*, i32** %4
store i32 2, i32* %8
%9 = load i32*, i32** %5
store i32 3, i32* %9
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i64 3
store i32 %19, i32* %21
%22 = load i32*, i32** %2
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 4
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 4
store i32 %24, i32* %26
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
double *malloc(int);
int /*<<< orphan*/ mx_multtrmx(int, double *, double *, double *);
double *Sab_fill(int M, double *Ca, double *Cb) {
  double *Sab = malloc(M * M * sizeof(double));
  mx_multtrmx(M, Sab, Ca, Cb);
  return Sab;
}


x86 assembly (clang, -O0):
<Sab_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <mx_multtrmx@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sab_fill>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
imul   %edi,%edi
shl    $0x3,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <mx_multtrmx@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double* @Sab_fill(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = call double* @malloc(i32 %13)
store double* %14, double** %7
%15 = load i32, i32* %4
%16 = load double*, double** %7
%17 = load double*, double** %5
%18 = load double*, double** %6
%19 = call i32 @mx_multtrmx(i32 %15, double* %16, double* %17, double* %18)
%20 = load double*, double** %7
ret double* %20
}

LLVM IR (-O2):
define double* @Sab_fill(i32 %0, double* %1, double* %2) {
%4 = shl i32 %0, 3
%5 = mul i32 %4, %0
%6 = tail call double* @malloc(i32 %5)
%7 = tail call i32 @mx_multtrmx(i32 %0, double* %6, double* %1, double* %2)
ret double* %6
}
double vde_chain_nm7_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<vde_chain_nm7_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <vde_chain_nm7_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <vde_chain_nm7_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <vde_chain_nm7_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <vde_chain_nm7_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm7_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @vde_chain_nm7_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @vde_chain_nm7_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fwrite(void *, size_t, int, int /*<<< orphan*/ *);
void dbg_dump_to_file(const char *fname, void *data, size_t len) {
  FILE *f = fopen(fname, "w");
  fwrite(data, len, 1, f);
  fclose(f);
}


x86 assembly (clang, -O0):
<dbg_dump_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_dump_to_file>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
lea    0xebe(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @dbg_dump_to_file(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite(i8* %10, i64 %11, i32 1, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @dbg_dump_to_file(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_IterateSyntaxMethodArgumentsDontConform(long p_position) {
  _Error(p_position,
         "Iterate syntax method arguments must start with 'iterator', end with "
         "'container' and the rest must match order of syntax rule");
}


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

x86 assembly (clang, -O2):
<Error_IterateSyntaxMethodArgumentsDontConform>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [126 x i8] c"Iterate syntax method arguments must start with 'iterator', end with 'container' and the rest must match order of syntax rule\00"
define void @Error_IterateSyntaxMethodArgumentsDontConform(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [126 x i8] c"Iterate syntax method arguments must start with 'iterator', end with 'container' and the rest must match order of syntax rule\00"
define void @Error_IterateSyntaxMethodArgumentsDontConform(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int unlink(char *);
void cli_file_remove(char *fpath, struct dirent *dp) {
  if (unlink(fpath) == -1)
    fprintf(stderr, "couldn't unlink %s: %s", fpath, strerror(errno));
}


x86 assembly (clang, -O0):
<cli_file_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    118a <cli_file_remove+0x5a>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7b(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_file_remove>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     1147 <cli_file_remove+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%ebp
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe9b(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"couldn't unlink %s: %s\00"
@errno = global i32 0
define void @cli_file_remove(i8* %0, %struct.dirent* %1) {
%3 = alloca i8*
%4 = alloca %struct.dirent*
store i8* %0, i8** %3
store %struct.dirent* %1, %struct.dirent** %4
%5 = load i8*, i8** %3
%6 = call i32 @unlink(i8* %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %3
%11 = load i32, i32* @errno
%12 = call i8* @strerror(i32 %11)
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@stderr = global i32 0
@.str = [23 x i8] c"couldn't unlink %s: %s\00"
@errno = global i32 0
define void @cli_file_remove(i8* %0, %struct.dirent* nocapture readnone %1) {
%3 = tail call i32 @unlink(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i8* @strerror(i32 %7)
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %8)
br label %10
10: ; preds = %5, %2
ret void
}
void glmReverseVector3f(float v[3]) {
  v[0] = -v[0];
  v[1] = -v[1];
  v[2] = -v[2];
}


x86 assembly (clang, -O0):
<glmReverseVector3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmReverseVector3f>:
movaps 0xef9(%rip),%xmm0
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
movss  0x8(%rdi),%xmm3
xorps  %xmm0,%xmm1
movss  %xmm1,(%rdi)
xorps  %xmm0,%xmm2
movss  %xmm2,0x4(%rdi)
xorps  %xmm0,%xmm3
movss  %xmm3,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmReverseVector3f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = fneg float %5
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = fneg float %11
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 1
store float %12, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 2
%17 = load float, float* %16
%18 = fneg float %17
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 2
store float %18, float* %20
ret void
}

LLVM IR (-O2):
define void @glmReverseVector3f(float* nocapture %0) {
%2 = load float, float* %0
%3 = fneg float %2
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fneg float %5
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fneg float %8
store float %9, float* %7
ret void
}