xunge/DecIR huggingface dataset:
/* Type definitions */
struct frame {
  int dummy;
};
struct fcgi {
  int dummy;
};

/* Variables and functions */
int process_get_values_result(struct frame *f, struct fcgi *fcgi,
                              const char *str, size_t num) {
  return 1;
}


x86 assembly (clang, -O0):
<process_get_values_result>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.frame = type { i32 }
%struct.fcgi = type { i32 }
define i32 @process_get_values_result(%struct.frame* %0, %struct.fcgi* %1, i8* %2, i64 %3) {
%5 = alloca %struct.frame*
%6 = alloca %struct.fcgi*
%7 = alloca i8*
%8 = alloca i64
store %struct.frame* %0, %struct.frame** %5
store %struct.fcgi* %1, %struct.fcgi** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i32 1
}

LLVM IR (-O2):
%struct.frame = type { i32 }
%struct.fcgi = type { i32 }
define i32 @process_get_values_result(%struct.frame* nocapture readnone %0, %struct.fcgi* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char const *);
void panic(const char *str) {
  puts(str);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @panic(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int gcd(int, int);
int lcm(int a, int b) { return a * b / gcd(a, b); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = sdiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ usart_out_byte(int /*<<< orphan*/);
void usart_out_string(uint8_t *string) {
  uint8_t b;
  while (b = *string++)
    usart_out_byte(b);
}


x86 assembly (clang, -O0):
<usart_out_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1146 <usart_out_string+0x36>
mov    -0xc(%rbp),%edi
call   1030 <usart_out_byte@plt>
jmp    111c <usart_out_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usart_out_string>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     112f <usart_out_string+0x1f>
add    $0x4,%rbx
xchg   %ax,%ax
call   1030 <usart_out_byte@plt>
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1120 <usart_out_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @usart_out_string(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i32* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = tail call i32 @usart_out_byte(i32 %5)
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void accumid_to_sigref_cal(int32_t accumid, int32_t *sr, int32_t *cal) {
  int32_t srcal = accumid ^ 0x3;
  *sr = srcal & (0x2) ? 1 : 0;
  *cal = srcal & (0x1) ? 1 : 0;
}


x86 assembly (clang, -O0):
<accumid_to_sigref_cal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
and    $0x2,%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<accumid_to_sigref_cal>:
xor    $0x3,%edi
mov    %edi,%eax
shr    %eax
and    $0x1,%eax
mov    %eax,(%rsi)
and    $0x1,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @accumid_to_sigref_cal(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = xor i32 %8, 3
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = and i32 %10, 2
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = and i32 %16, 1
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 1, i32 0
%21 = load i32*, i32** %6
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @accumid_to_sigref_cal(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = xor i32 %0, 3
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1
store i32 %6, i32* %1
%7 = and i32 %4, 1
store i32 %7, i32* %2
ret void
}
int Operand_label8_rtoa(unsigned int *valp, unsigned int pc) {
  *valp += pc;
  return 0;
}


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

x86 assembly (clang, -O2):
<Operand_label8_rtoa>:
add    %esi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_label8_rtoa(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
int check_doubleComplex() { return sizeof(double _Complex); }


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

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

LLVM IR (-O0):
define i32 @check_doubleComplex() {
ret i32 16
}

LLVM IR (-O2):
define i32 @check_doubleComplex() {
ret i32 16
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvt_pi2ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cvt_pi2ps(__m128 a, __m64 b) { return _mm_cvt_pi2ps(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_cvt_pi2ps>:
jmp    1030 <_mm_cvt_pi2ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvt_pi2ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cvt_pi2ps(i32 %0, i32 %1)
ret i32 %3
}
void testClosureIIrV(void (*closure)(int, int), int a1, int a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureIIrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureIIrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define void @testClosureIIrV(void (i32, i32)* nocapture %0, i32 %1, i32 %2) {
tail call void %0(i32 %1, i32 %2)
ret void
}
SP_CASE(imacro, end) { SP_TRUE(1); }


x86 assembly (clang, -O0):
<SP_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SP_CASE>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <SP_TRUE@plt>

LLVM IR (-O0):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
ret i32 undef
}
int test_imm_93uint16_mem(unsigned short *val) {
  return ((*val) & (0x93 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_93uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 147
%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_93uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 147
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int bmm050_compensate_X(short, unsigned short);
signed int bmm050_compensate_X_s32(signed short mdata_x,
                                   unsigned short data_r) {
  signed int retval = 0;
  retval = bmm050_compensate_X(mdata_x, data_r);
  if (retval == (signed int)-32768)
    retval = ((signed int)(-2147483647 - 1));
  return retval;
}


x86 assembly (clang, -O0):
<bmm050_compensate_X_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movzwl -0x4(%rbp),%esi
call   1030 <bmm050_compensate_X@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffff8000,-0x8(%rbp)
jne    1154 <bmm050_compensate_X_s32+0x44>
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmm050_compensate_X_s32>:
push   %rax
call   1030 <bmm050_compensate_X@plt>
cmp    $0xffff8000,%eax
mov    $0x80000000,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bmm050_compensate_X_s32(i16 signext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
store i32 0, i32* %5
%6 = load i16, i16* %3
%7 = load i16, i16* %4
%8 = call i32 @bmm050_compensate_X(i16 signext %6, i16 zeroext %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -32768
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -2147483648, i32* %5
br label %12
12: ; preds = %11, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @bmm050_compensate_X_s32(i16 signext %0, i16 zeroext %1) {
%3 = tail call i32 @bmm050_compensate_X(i16 signext %0, i16 zeroext %1)
%4 = icmp eq i32 %3, -32768
%5 = select i1 %4, i32 -2147483648, i32 %3
ret i32 %5
}
void clear_buffer(float *buffer, int size) {
  int i;
  for (i = 0; i < size; i++)
    buffer[i] = 0;
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <clear_buffer+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clear_buffer+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
test   %esi,%esi
jle    1126 <clear_buffer+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clear_buffer(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void d_end(int i) {
  time_t now;
  time(&now);
  printf("\033[1;32m"
         "thread[%d]: barrier:"
         "\033[0m"
         " done at %s",
         i, ctime(&now));
}


x86 assembly (clang, -O0):
<d_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <time@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_end>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <time@plt>
mov    %r14,%rdi
call   1030 <ctime@plt>
lea    0xeae(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\1B[1;32mthread[%d]: barrier:\1B[0m done at %s\00"
define void @d_end(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @time(i32* %3)
%5 = load i32, i32* %2
%6 = call i8* @ctime(i32* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"\1B[1;32mthread[%d]: barrier:\1B[0m done at %s\00"
define void @d_end(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call i8* @ctime(i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %5)
ret void
}
char *getDate() { return "9/12/2002"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"9/12/2002\00"
define i8* @getDate() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"9/12/2002\00"
define i8* @getDate() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
void f121(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({
      goto a;
      0;
    });
  a:
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f121>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f121() {
ret void
}
/* Variables and functions */
void *malloc(long);
int /*<<< orphan*/ perror(char *);
void *libaft_malloc(long size) {
  void *p = malloc(size);
  if (!p) {
    perror("libaft: malloc");
    return 0;
  }
  return p;
}


x86 assembly (clang, -O0):
<libaft_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115d <libaft_malloc+0x3d>
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    1165 <libaft_malloc+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libaft_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1133 <libaft_malloc+0x13>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
jmp    112e <libaft_malloc+0xe>

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

LLVM IR (-O2):
@.str = [15 x i8] c"libaft: malloc\00"
define noalias i8* @libaft_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void _patch_op_imm(void *out, void *in, uint16_t imm, int sh, int len) {
  volatile uint32_t *p, *q;
  p = out;
  q = in;
  *p = (*q & ~(((1 << len) - 1) << sh)) | ((imm & ((1 << len) - 1)) << sh);
}


x86 assembly (clang, -O0):
<_patch_op_imm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    %cl,%eax
mov    -0x34(%rbp),%ecx
or     %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_patch_op_imm>:
mov    %ecx,%r9d
mov    $0xffffffff,%eax
mov    %r8d,%ecx
shl    %cl,%eax
not    %eax
mov    %eax,%r8d
mov    %r9d,%ecx
shl    %cl,%r8d
not    %r8d
and    %edx,%eax
shl    %cl,%eax
and    (%rsi),%r8d
or     %r8d,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @_patch_op_imm(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i8*, i8** %6
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %11
%15 = load i8*, i8** %7
%16 = bitcast i8* %15 to i32*
store i32* %16, i32** %12
%17 = load i32*, i32** %12
%18 = load volatile i32, i32* %17
%19 = load i32, i32* %10
%20 = shl i32 1, %19
%21 = sub nsw i32 %20, 1
%22 = load i32, i32* %9
%23 = shl i32 %21, %22
%24 = xor i32 %23, -1
%25 = and i32 %18, %24
%26 = load i32, i32* %8
%27 = load i32, i32* %10
%28 = shl i32 1, %27
%29 = sub nsw i32 %28, 1
%30 = and i32 %26, %29
%31 = load i32, i32* %9
%32 = shl i32 %30, %31
%33 = or i32 %25, %32
%34 = load i32*, i32** %11
store volatile i32 %33, i32* %34
ret void
}

LLVM IR (-O2):
define void @_patch_op_imm(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = bitcast i8* %0 to i32*
%7 = bitcast i8* %1 to i32*
%8 = load volatile i32, i32* %7
%9 = shl nsw i32 -1, %4
%10 = xor i32 %9, -1
%11 = shl i32 %10, %3
%12 = xor i32 %11, -1
%13 = and i32 %8, %12
%14 = and i32 %10, %2
%15 = shl i32 %14, %3
%16 = or i32 %13, %15
store volatile i32 %16, i32* %6
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", add(1, 2));
  return 0;
}


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
mov    $0x2,%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
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 @add(i32 1, i32 2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ strchr(char const *, char const);
char *strset(const char *p, const char *set) {
  for (; *p; p++) {
    if (strchr(set, *p))
      return ((char *)p);
  }
  return (0);
}


x86 assembly (clang, -O0):
<strset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <strset+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1154 <strset+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <strset+0x62>
jmp    1159 <strset+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strset+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <strset+0x2c>
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    113e <strset+0x2e>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strset+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strset(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i64 @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, char *, size_t, int /*<<< orphan*/);
ssize_t get_udp_packet(int sock_fd, char *packet, size_t size) {
  ssize_t n_read;
  while ((n_read = recv(sock_fd, packet, size, 0)) < 0)
    ;
  return n_read;
}


x86 assembly (clang, -O0):
<get_udp_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1146 <get_udp_packet+0x36>
jmp    1123 <get_udp_packet+0x13>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_udp_packet>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %eax,%eax
js     1120 <get_udp_packet+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @get_udp_packet(i32 %0, i8* %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret i32 %5
}
void rpmv2s_(dx, dy) short *dx, *dy;
{ rpmv2((float)*dx, (float)*dy); }


x86 assembly (clang, -O0):
<rpmv2s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rpmv2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpmv2s_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
mov    $0x2,%al
jmp    1030 <rpmv2@plt>

LLVM IR (-O0):
define void @rpmv2s_(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = fpext float %7 to double
%9 = load i16*, i16** %4
%10 = load i16, i16* %9
%11 = sitofp i16 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, ...) bitcast (i32 (...)* @rpmv2 to i32 (double, double, ...)*)(double %8, double %12)
ret void
}

LLVM IR (-O2):
define void @rpmv2s_(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = sitofp i16 %3 to double
%5 = load i16, i16* %1
%6 = sitofp i16 %5 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rpmv2 to i32 (double, double, ...)*)(double %4, double %6)
ret void
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ socket_printf(struct session *, int, char *, int, int, int);
int /*<<< orphan*/ telopt_debug(struct session *, char *);
int send_do_mccp2(struct session *ses, int cplen, unsigned char *cpsrc) {
  socket_printf(ses, 3, "%c%c%c", 255, 253, 86);
  telopt_debug(ses, "SENT IAC DO MCCP2");
  return 3;
}


x86 assembly (clang, -O0):
<send_do_mccp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
lea    0xebd(%rip),%rdx
mov    $0xff,%ecx
mov    $0xfd,%r8d
mov    $0x56,%r9d
call   1040 <socket_printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_do_mccp2>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdx
mov    $0x3,%esi
mov    $0xff,%ecx
mov    $0xfd,%r8d
mov    $0x56,%r9d
call   1040 <socket_printf@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [18 x i8] c"SENT IAC DO MCCP2\00"
define i32 @send_do_mccp2(%struct.session* %0, i32 %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i32
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.session*, %struct.session** %4
%8 = call i32 @socket_printf(%struct.session* %7, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 253, i32 86)
%9 = load %struct.session*, %struct.session** %4
%10 = call i32 @telopt_debug(%struct.session* %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [18 x i8] c"SENT IAC DO MCCP2\00"
define i32 @send_do_mccp2(%struct.session* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @socket_printf(%struct.session* %0, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 253, i32 86)
%5 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}
void addVec3f(float *a, float *b, float *out) {
  out[0] = a[0] + b[0];
  out[1] = a[1] + b[1];
  out[2] = a[2] + b[2];
}


x86 assembly (clang, -O0):
<addVec3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addVec3f>:
movss  (%rdi),%xmm0
addss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
addss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @addVec3f(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 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fadd float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fadd float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @addVec3f(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fadd float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fadd float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
scalar_t__ aes_test();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("AES Tests: %s\n", aes_test() ? "SUCCEEDED" : "FAILED");
  return (0);
}


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    $0x0,%al
call   1030 <aes_test@plt>
mov    %rax,%rcx
lea    0xed2(%rip),%rsi
lea    0xec1(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <aes_test@plt>
test   %rax,%rax
lea    0xee7(%rip),%rax
lea    0xed6(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"AES Tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
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 i64 (...) @aes_test()
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"AES Tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @aes_test()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
void radeonInitSSECodegen(struct dfn_generators *gen) { (void)gen; }


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

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

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

LLVM IR (-O2):
%struct.dfn_generators = type opaque
define void @radeonInitSSECodegen(%struct.dfn_generators* nocapture %0) {
ret void
}
int do_000() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @do_000() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int palindrome(int a, int b) {
  if (a == b) {
    printf("The number is palindrome\n");
  } else {
    printf("THe number is not palindrome\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113b <palindrome+0x2b>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
jmp    1147 <palindrome+0x37>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palindrome>:
push   %rax
cmp    %esi,%edi
lea    0xf03(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"The number is palindrome\0A\00"
@.str.1 = [30 x i8] c"THe number is not palindrome\0A\00"
define i32 @palindrome(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"THe number is not palindrome\00"
@str.2 = [25 x i8] c"The number is palindrome\00"
define i32 @palindrome(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
char *langRomTypeHarryFox() { return "Harry Fox"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Harry Fox\00"
define i8* @langRomTypeHarryFox() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"Harry Fox\00"
define i8* @langRomTypeHarryFox() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
int main() {
  f(2, -3);
  f(2, 3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xfffffffd,%esi
call   1030 <f@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 2, i32 -3)
%2 = tail call i32 @f(i32 2, i32 3)
ret i32 0
}
/* Type definitions */
struct lconv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _current_locale();
struct lconv *localeconv_l(int /*<<< orphan*/);
struct lconv *localeconv(void) {
  return localeconv_l(_current_locale());
}


x86 assembly (clang, -O0):
<localeconv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <_current_locale@plt>
mov    %eax,%edi
call   1030 <localeconv_l@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<localeconv>:
push   %rax
xor    %eax,%eax
call   1040 <_current_locale@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <localeconv_l@plt>

LLVM IR (-O0):
%struct.lconv = type { i32 }
define %struct.lconv* @localeconv() {
%1 = call i32 (...) @_current_locale()
%2 = call %struct.lconv* @localeconv_l(i32 %1)
ret %struct.lconv* %2
}

LLVM IR (-O2):
%struct.lconv = type { i32 }
define %struct.lconv* @localeconv() {
%1 = tail call i32 (...) @_current_locale()
%2 = tail call %struct.lconv* @localeconv_l(i32 %1)
ret %struct.lconv* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ make_config_dir_name(char *, char const *);
FILE *local_then_config_fopen(const char *filename, const char *permits) {
  FILE *rval = fopen(filename, permits);
  if (!rval) {
    char ext_filename[255];
    make_config_dir_name(ext_filename, filename);
    rval = fopen(ext_filename, "rb");
  }
  return (rval);
}


x86 assembly (clang, -O0):
<local_then_config_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1176 <local_then_config_fopen+0x56>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <make_config_dir_name@plt>
lea    -0x120(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_then_config_fopen>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
jne    1154 <local_then_config_fopen+0x34>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <make_config_dir_name@plt>
lea    0xeb4(%rip),%rsi
mov    %r14,%rdi
call   1040 <fopen@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32* @local_then_config_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca [255 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32* @fopen(i8* %7, i8* %8)
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = icmp ne i32* %10, null
br i1 %11, label %18, label %12
12: ; preds = %2
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%14 = load i8*, i8** %3
%15 = call i32 @make_config_dir_name(i8* %13, i8* %14)
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %17, i32** %5
br label %18
18: ; preds = %12, %2
%19 = load i32*, i32** %5
ret i32* %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define noalias i32* @local_then_config_fopen(i8* %0, i8* nocapture %1) {
%3 = alloca [255 x i8]
%4 = tail call i32* @fopen(i8* %0, i8* %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = call i32 @make_config_dir_name(i8* %7, i8* %0)
%9 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %6, %2
%11 = phi i32* [ %4, %2 ], [ %9, %6 ]
ret i32* %11
}
/* Variables and functions */
unsigned int getpid();
unsigned int process_getpid() { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @process_getpid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @process_getpid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Putw(int, int);
extern void SetWidth(int width) { Putw(0x40, width); }


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

x86 assembly (clang, -O2):
<SetWidth>:
mov    %edi,%esi
mov    $0x40,%edi
jmp    1030 <Putw@plt>

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

LLVM IR (-O2):
define void @SetWidth(i32 %0) {
%2 = tail call i32 @Putw(i32 64, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M135_f(char *s) {
  debug("M135_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M135_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M135_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M135_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M135_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M135_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M135_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}