xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _dgr(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _f2d(int);
int _fleq(int a, int b) { return !_dgr(_f2d(a), _f2d(b)); }


x86 assembly (clang, -O0):
<_fleq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_f2d@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_f2d@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <_dgr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fleq>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <_f2d@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <_f2d@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_dgr@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_fleq(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 = call i32 @_f2d(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @_f2d(i32 %7)
%9 = call i32 @_dgr(i32 %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_fleq(i32 %0, i32 %1) {
%3 = tail call i32 @_f2d(i32 %0)
%4 = tail call i32 @_f2d(i32 %1)
%5 = tail call i32 @_dgr(i32 %3, i32 %4)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ draw_field();
init_disp() {
  clear();
  draw_field();
}


x86 assembly (clang, -O0):
<init_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clear@plt>
mov    $0x0,%al
call   1030 <draw_field@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_disp>:
push   %rax
xor    %eax,%eax
call   1040 <clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <draw_field@plt>

LLVM IR (-O0):
define i32 @init_disp() {
%1 = alloca i32
%2 = call i32 (...) @clear()
%3 = call i32 (...) @draw_field()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @init_disp() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 (...) @draw_field()
ret i32 undef
}
void partition_sched_domains(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<partition_sched_domains>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<partition_sched_domains>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.partition_sched_domains = [24 x i8] c"partition_sched_domains\00"
define void @partition_sched_domains() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.partition_sched_domains, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.partition_sched_domains = [24 x i8] c"partition_sched_domains\00"
define void @partition_sched_domains() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.partition_sched_domains, i64 0, i64 0))
ret void
}
unsigned short int csum_tcpudp_magic(unsigned long saddr, unsigned long daddr,
                                     unsigned short len, unsigned short proto,
                                     unsigned int sum) {
  return ~from64to16(saddr + daddr + sum + ((unsigned long)ntohs(len) << 16) +
                     ((unsigned long)proto << 8));
}


x86 assembly (clang, -O0):
<csum_tcpudp_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cx,-0x12(%rbp)
mov    %ax,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movzwl -0x12(%rbp),%edi
mov    $0x0,%al
call   1040 <ntohs@plt>
mov    -0x20(%rbp),%rdi
cltq
shl    $0x10,%rax
add    %rax,%rdi
movzwl -0x14(%rbp),%eax
shl    $0x8,%rax
add    %rax,%rdi
mov    $0x0,%al
call   1030 <from64to16@plt>
xor    $0xffffffff,%eax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_tcpudp_magic>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdi,%rbx
add    %rsi,%rbx
mov    %r8d,%eax
add    %rax,%rbx
mov    %edx,%edi
xor    %eax,%eax
call   1040 <ntohs@plt>
cltq
shl    $0x10,%rax
mov    %ebp,%edi
shl    $0x8,%rdi
add    %rbx,%rdi
add    %rax,%rdi
xor    %eax,%eax
call   1030 <from64to16@plt>
not    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @csum_tcpudp_magic(i64 %0, i64 %1, i16 zeroext %2, i16 zeroext %3, i32 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
store i64 %0, i64* %6
store i64 %1, i64* %7
store i16 %2, i16* %8
store i16 %3, i16* %9
store i32 %4, i32* %10
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = add i64 %11, %12
%14 = load i32, i32* %10
%15 = zext i32 %14 to i64
%16 = add i64 %13, %15
%17 = load i16, i16* %8
%18 = zext i16 %17 to i32
%19 = call i32 (i32, ...) bitcast (i32 (...)* @ntohs to i32 (i32, ...)*)(i32 %18)
%20 = sext i32 %19 to i64
%21 = shl i64 %20, 16
%22 = add i64 %16, %21
%23 = load i16, i16* %9
%24 = zext i16 %23 to i64
%25 = shl i64 %24, 8
%26 = add i64 %22, %25
%27 = call i32 (i64, ...) bitcast (i32 (...)* @from64to16 to i32 (i64, ...)*)(i64 %26)
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i16
ret i16 %29
}

LLVM IR (-O2):
define zeroext i16 @csum_tcpudp_magic(i64 %0, i64 %1, i16 zeroext %2, i16 zeroext %3, i32 %4) {
%6 = add i64 %1, %0
%7 = zext i32 %4 to i64
%8 = add i64 %6, %7
%9 = zext i16 %2 to i32
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @ntohs to i32 (i32, ...)*)(i32 %9)
%11 = sext i32 %10 to i64
%12 = shl nsw i64 %11, 16
%13 = zext i16 %3 to i64
%14 = shl nuw nsw i64 %13, 8
%15 = add i64 %8, %14
%16 = add i64 %15, %12
%17 = tail call i32 (i64, ...) bitcast (i32 (...)* @from64to16 to i32 (i64, ...)*)(i64 %16)
%18 = trunc i32 %17 to i16
%19 = xor i16 %18, -1
ret i16 %19
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdefw(int v) { ngen("%s\t%d", "dw", v); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%d\00"
@.str.1 = [3 x i8] c"dw\00"
define void @cgdefw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int maxArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i[] = {1, 3, 5, 7, 9};
  printf("%d\n", maxArea(i, 5));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1040 <maxArea@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <maxArea@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.i = [5 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [5 x i32]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [5 x i32]* %5 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%8 = call i32 @maxArea(i32* %7, i32 5)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.i = [5 x i32] [i32 1, i32 3, i32 5, i32 7, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %3 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxArea(i32* %5, i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
long lmin(a, b)
long a, b;
{
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<lmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    1127 <lmin+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <lmin+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmin>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @lmin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void hmd_prep_right() {}


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

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

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

LLVM IR (-O2):
define void @hmd_prep_right() {
ret void
}
void ABGRToUVRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ABGRToUVRow_Any_NEON() {
ret void
}
unsigned char f47(unsigned char x, int y) {
  return (x >> y) | (x << (8 * sizeof(unsigned char) - y));
}


x86 assembly (clang, -O0):
<f47>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x8,%ecx
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f47>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @f47(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = sub i64 8, %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %10, %14
%16 = or i32 %8, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @f47(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Type definitions */
struct LILfloat {
  float f;
  unsigned int i;
};

/* Variables and functions */
unsigned int bswap_32(unsigned int);
float VSSwapHostFloatToLittle(float x) {
  union LILfloat {
    float f;
    unsigned int i;
  } l;
  l.f = x;
  l.i = (bswap_32(l.i));
  return l.f;
}


x86 assembly (clang, -O0):
<VSSwapHostFloatToLittle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bswap_32@plt>
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%union.LILfloat = type { float }
define float @VSSwapHostFloatToLittle(float %0) {
%2 = alloca float
%3 = alloca %union.LILfloat
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.LILfloat* %3 to float*
store float %4, float* %5
%6 = bitcast %union.LILfloat* %3 to i32*
%7 = load i32, i32* %6
%8 = call i32 @bswap_32(i32 %7)
%9 = bitcast %union.LILfloat* %3 to i32*
store i32 %8, i32* %9
%10 = bitcast %union.LILfloat* %3 to float*
%11 = load float, float* %10
ret float %11
}

LLVM IR (-O2):
define float @VSSwapHostFloatToLittle(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @bswap_32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *my_malloc(size_t);
int strlen(char const *);
char *my_strdup(const char *in) {
  size_t size = strlen(in) + 1;
  char *out = my_malloc(size);
  memcpy(out, in, size);
  return out;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <my_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <my_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @my_malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @my_malloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ test_case(int);
int main() {
  int tc;
  scanf("%d", &tc);
  for (int i = 1; i <= tc; i++)
    test_case(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1168 <main+0x48>
mov    -0xc(%rbp),%edi
call   1030 <test_case@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1150 <main+0x30>
xor    %ebx,%ebx
nop
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <test_case@plt>
cmp    0xc(%rsp),%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %7, %0
ret i32 0
7: ; preds = %0, %7
%8 = phi i32 [ %10, %7 ], [ 1, %0 ]
%9 = call i32 @test_case(i32 %8)
%10 = add nuw nsw i32 %8, 1
%11 = load i32, i32* %1
%12 = icmp slt i32 %8, %11
br i1 %12, label %7, label %6
}
/* Variables and functions */
int /*<<< orphan*/ strings_matrix();
int main(int argc, char *argv[]) {
  strings_matrix();
  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 <strings_matrix@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @strings_matrix()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @strings_matrix()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("test\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"test\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_int(int sig_no) { printf("Interupt.\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Interupt.\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"Interupt.\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void XkbAllocGeomOutlines() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocGeomOutlines() {
ret void
}
int find_pos(char c, char *str) {
  int i;
  for (i = 0; str[i]; i++) {
    if (str[i] == c)
      return (i);
  }
  return (0);
}


x86 assembly (clang, -O0):
<find_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <find_pos+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <find_pos+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <find_pos+0x64>
jmp    114f <find_pos+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <find_pos+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_pos>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1124 <find_pos+0x24>
nopl   0x0(%rax,%rax,1)
cmp    %dil,%cl
je     1124 <find_pos+0x24>
movzbl 0x1(%rsi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <find_pos+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @find_pos(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ 0, %9 ]
ret i32 %17
}
void pal_smmu_device_stop_monitor_iova(void *port) { return; }


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

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

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

LLVM IR (-O2):
define void @pal_smmu_device_stop_monitor_iova(i8* nocapture %0) {
ret void
}
main() {
  int i, a[5000000];
  for (i = 0; i < 5000000; i++) {
    a[i] = 0;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1312c90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4c4b40,-0x8(%rbp)
jge    1143 <main+0x43>
movslq -0x8(%rbp),%rax
movl   $0x0,-0x1312d10(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
add    $0x1312c90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5000000 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5000000
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [5000000 x i32], [5000000 x i32]* %3, i64 0, i64 %9
store i32 0, i32* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct rusage {
  int dummy;
};
typedef enum __rusage_who { ____Placeholder___rusage_who } __rusage_who;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getrusage(enum __rusage_who who, struct rusage *usage) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.rusage = type { i32 }
@ENOSYS = global i32 0
define i32 @__getrusage(i32 %0, %struct.rusage* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
int vde_chain_nm6_n_in(void) { return 4; }


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

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

LLVM IR (-O0):
define i32 @vde_chain_nm6_n_in() {
ret i32 4
}

LLVM IR (-O2):
define i32 @vde_chain_nm6_n_in() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("Usage: numc (input number) -s (input number system) -t "
         "(target-number-system) [-v]\n");
}


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

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

LLVM IR (-O0):
@.str = [84 x i8] c"Usage: numc (input number) -s (input number system) -t (target-number-system) [-v]\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [83 x i8] c"Usage: numc (input number) -s (input number system) -t (target-number-system) [-v]\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dcl_ac(int);
int /*<<< orphan*/ dcl_ad(int);
int /*<<< orphan*/ dcl_af(int);
int /*<<< orphan*/ dcl_ai(int);
int /*<<< orphan*/ dcl_all(int);
int /*<<< orphan*/ dcl_ap(int /*<<< orphan*/);
int /*<<< orphan*/ dcl_as(int);
int /*<<< orphan*/ dcl_ati(int);
int /*<<< orphan*/ dcl_av();
void test_1(void) {
  dcl_av();
  dcl_ac(1);
  dcl_as(2);
  dcl_ai(3);
  dcl_all(4);
  dcl_ati(5);
  dcl_af(6);
  dcl_ad(7);
  dcl_ap(0);
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <dcl_av@plt>
mov    $0x1,%edi
call   10a0 <dcl_ac@plt>
mov    $0x2,%edi
call   1090 <dcl_as@plt>
mov    $0x3,%edi
call   10b0 <dcl_ai@plt>
mov    $0x4,%edi
call   1030 <dcl_all@plt>
mov    $0x5,%edi
call   1040 <dcl_ati@plt>
mov    $0x6,%edi
call   1050 <dcl_af@plt>
mov    $0x7,%edi
call   1060 <dcl_ad@plt>
xor    %edi,%edi
call   1070 <dcl_ap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rax
xor    %eax,%eax
call   1080 <dcl_av@plt>
mov    $0x1,%edi
call   10a0 <dcl_ac@plt>
mov    $0x2,%edi
call   1090 <dcl_as@plt>
mov    $0x3,%edi
call   10b0 <dcl_ai@plt>
mov    $0x4,%edi
call   1030 <dcl_all@plt>
mov    $0x5,%edi
call   1040 <dcl_ati@plt>
mov    $0x6,%edi
call   1050 <dcl_af@plt>
mov    $0x7,%edi
call   1060 <dcl_ad@plt>
xor    %edi,%edi
pop    %rax
jmp    1070 <dcl_ap@plt>

LLVM IR (-O0):
define void @test_1() {
%1 = call i32 (...) @dcl_av()
%2 = call i32 @dcl_ac(i32 1)
%3 = call i32 @dcl_as(i32 2)
%4 = call i32 @dcl_ai(i32 3)
%5 = call i32 @dcl_all(i32 4)
%6 = call i32 @dcl_ati(i32 5)
%7 = call i32 @dcl_af(i32 6)
%8 = call i32 @dcl_ad(i32 7)
%9 = call i32 @dcl_ap(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_1() {
%1 = tail call i32 (...) @dcl_av()
%2 = tail call i32 @dcl_ac(i32 1)
%3 = tail call i32 @dcl_as(i32 2)
%4 = tail call i32 @dcl_ai(i32 3)
%5 = tail call i32 @dcl_all(i32 4)
%6 = tail call i32 @dcl_ati(i32 5)
%7 = tail call i32 @dcl_af(i32 6)
%8 = tail call i32 @dcl_ad(i32 7)
%9 = tail call i32 @dcl_ap(i32 0)
ret void
}
int exe(char *filename) {
  int int_num = 6;
  int tmp;
  __asm__("int $0x80" : "=a"(tmp) : "a"(int_num), "b"(filename));
  return tmp;
}


x86 assembly (clang, -O0):
<exe>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rbx
int    $0x80
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe>:
push   %rbx
mov    %rdi,%rbx
mov    $0x6,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @exe(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 6, i32* %3
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 asm "int $$0x80", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %5, i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @exe(i8* readnone %0) {
%2 = tail call i32 asm "int $$0x80", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 6, i8* %0)
ret i32 %2
}
void eat_ws(char *s, int *i) {
  while ((((s[*i]) == '\t') || ((s[*i]) == ' ')))
    (*i)++;
}


x86 assembly (clang, -O0):
<eat_ws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x11(%rbp)
je     1141 <eat_ws+0x41>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1151 <eat_ws+0x51>
jmp    1161 <eat_ws+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    110c <eat_ws+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_ws>:
movslq (%rsi),%rax
jmp    1116 <eat_ws+0x16>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
mov    %eax,(%rsi)
movzbl (%rdi,%rax,1),%ecx
cmp    $0x20,%cl
je     1110 <eat_ws+0x10>
cmp    $0x9,%cl
je     1110 <eat_ws+0x10>
ret

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

LLVM IR (-O2):
define void @eat_ws(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
br label %4
4: ; preds = %9, %2
%5 = phi i32 [ %10, %9 ], [ %3, %2 ]
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
switch i8 %8, label %11 [
i8 9, label %9
i8 32, label %9
]
9: ; preds = %4, %4
%10 = add nsw i32 %5, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ rr__write(int /*<<< orphan*/);
void rr_ref(int32_t refid) { rr__write(refid); }


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

x86 assembly (clang, -O2):
<rr_ref>:
jmp    1030 <rr__write@plt>

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

LLVM IR (-O2):
define void @rr_ref(i32 %0) {
%2 = tail call i32 @rr__write(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fesetround(int);
void set_fpu_rounding_mode(int mode) {
  int rnd_mode;
  switch (mode) {
  case 2:
    rnd_mode = 0;
    break;
  case 4:
    rnd_mode = 1;
    break;
  case 1:
    rnd_mode = 2;
    break;
  case 3:
    rnd_mode = 3;
    break;
  default:
    return;
  }
  fesetround(rnd_mode);
}


x86 assembly (clang, -O0):
<set_fpu_rounding_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1174 <set_fpu_rounding_mode+0x64>
mov    -0x10(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    1179 <set_fpu_rounding_mode+0x69>
movl   $0x1,-0x8(%rbp)
jmp    1179 <set_fpu_rounding_mode+0x69>
movl   $0x2,-0x8(%rbp)
jmp    1179 <set_fpu_rounding_mode+0x69>
movl   $0x3,-0x8(%rbp)
jmp    1179 <set_fpu_rounding_mode+0x69>
jmp    1181 <set_fpu_rounding_mode+0x71>
mov    -0x8(%rbp),%edi
call   1030 <fesetround@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_fpu_rounding_mode>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     112a <set_fpu_rounding_mode+0x1a>
movslq %edi,%rax
lea    0xede(%rip),%rcx
mov    (%rcx,%rax,4),%edi
jmp    1030 <fesetround@plt>
ret

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

LLVM IR (-O2):
@switch.table.set_fpu_rounding_mode = [4 x i32] [i32 2, i32 0, i32 3, i32 1]
define void @set_fpu_rounding_mode(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.set_fpu_rounding_mode, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @fesetround(i32 %7)
br label %9
9: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *progname) { printf("Usage: %s [-e] filename\n", progname); }


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: %s [-e] filename\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int pm_autosleep_lock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pm_autosleep_lock() {
ret i32 0
}
void cmp_ai_deinit(struct CmpAi *ai) { (void)ai; }


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

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

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

LLVM IR (-O2):
%struct.CmpAi = type opaque
define void @cmp_ai_deinit(%struct.CmpAi* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test34(__m64 a, __m64 b) { return _mm_add_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test34>:
jmp    1030 <_mm_add_pi16@plt>

LLVM IR (-O0):
define i32 @test34(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_add_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test34(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_pi16(i32 %0, i32 %1)
ret i32 %3
}
void Delay_reset(struct Delay *this) {}


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

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

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

LLVM IR (-O2):
%struct.Delay = type opaque
define void @Delay_reset(%struct.Delay* nocapture %0) {
ret void
}
void LedsP$Led0$clr(void) { ReverseGPIOP$0$Out$clr(); }


x86 assembly (clang, -O0):
<LedsP$Led0$clr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ReverseGPIOP$0$Out$clr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedsP$Led0$clr>:
xor    %eax,%eax
jmp    1030 <ReverseGPIOP$0$Out$clr@plt>

LLVM IR (-O0):
define void @"LedsP$Led0$clr"() {
%1 = call i32 (...) @"ReverseGPIOP$0$Out$clr"()
ret void
}

LLVM IR (-O2):
define void @"LedsP$Led0$clr"() {
%1 = tail call i32 (...) @"ReverseGPIOP$0$Out$clr"()
ret void
}
/* Variables and functions */
size_t util_strpcpy(char **, size_t, char const *);
size_t util_strscpy(char *dest, size_t size, const char *src) {
  char *s;
  s = dest;
  return util_strpcpy(&s, size, src);
}


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

x86 assembly (clang, -O2):
<util_strscpy>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <util_strpcpy@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @util_strscpy(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* %0, i8** %4
%6 = call i64 @util_strpcpy(i8** %4, i64 %1, i8* %2)
ret i64 %6
}
void selection_sort(double v[], int length) {
  void swapmin(double v[], int length);
  if (length > 1) {
    swapmin(v, length);
    selection_sort(v + 1, length - 1);
  }
}


x86 assembly (clang, -O0):
<selection_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1158 <selection_sort+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <swapmin@plt>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <selection_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selection_sort>:
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     113c <selection_sort+0x2c>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <swapmin@plt>
add    $0x8,%rbx
lea    -0x1(%r14),%eax
cmp    $0x2,%r14d
mov    %eax,%r14d
ja     1120 <selection_sort+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @selection_sort(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load double*, double** %3
%9 = load i32, i32* %4
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
br label %14
14: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @selection_sort(double* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = phi double* [ %7, %4 ], [ %0, %2 ]
tail call void @swapmin(double* %6, i32 %5)
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = add nsw i32 %5, -1
%9 = icmp ugt i32 %5, 2
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart2_write(int /*<<< orphan*/);
void sendMemArrayToEsp(const char *str, unsigned int len) {
  while (len--)
    uart2_write(*str++);
}


x86 assembly (clang, -O0):
<sendMemArrayToEsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     114f <sendMemArrayToEsp+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart2_write@plt>
jmp    111f <sendMemArrayToEsp+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendMemArrayToEsp>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <sendMemArrayToEsp+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <uart2_write@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <sendMemArrayToEsp+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @sendMemArrayToEsp(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 @uart2_write(i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
int XAddConnectionWatch() {}


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

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

LLVM IR (-O0):
define i32 @XAddConnectionWatch() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XAddConnectionWatch() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsprintf(char *, char const *, int /*<<< orphan*/);
int vsnprintf(char *restrict s, size_t n, const char *restrict fmt,
              va_list ap) {
  return vsprintf(s, fmt, ap);
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <vsprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vsprintf@plt>

LLVM IR (-O0):
define i32 @vsnprintf(i8* noalias %0, i64 %1, i8* noalias %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @vsprintf(i8* %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @vsnprintf(i8* noalias nocapture %0, i64 %1, i8* noalias nocapture %2, i32 %3) {
%5 = tail call i32 @vsprintf(i8* %0, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *strcat_r(const char *s1, const char *s2, char *buf) {
  strcpy(buf, s1);
  strcat(buf, s2);
  return buf;
}


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

x86 assembly (clang, -O2):
<strcat_r>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    %rdx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat_r(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %6
ret i8* %13
}

LLVM IR (-O2):
define i8* @strcat_r(i8* %0, i8* %1, i8* returned %2) {
%4 = tail call i32 @strcpy(i8* %2, i8* %0)
%5 = tail call i32 @strcat(i8* %2, i8* %1)
ret i8* %2
}