xunge/DecIR huggingface dataset:
__float128 plm_dPlm(int l, int m, __float128 x) {
  int sign;
  __float128 value = plm_lndPlm(l, m, x, &sign);
  return sign * expq(value);
}


x86 assembly (clang, -O0):
<plm_dPlm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movaps %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movaps -0x20(%rbp),%xmm0
lea    -0x24(%rbp),%rdx
mov    $0x1,%al
mov    %al,-0x45(%rbp)
call   1030 <plm_lndPlm@plt>
mov    %eax,%edi
call   1180 <__floatsitf>
mov    -0x45(%rbp),%al
movaps %xmm0,-0x40(%rbp)
mov    -0x24(%rbp),%ecx
mov    %ecx,-0x44(%rbp)
movaps -0x40(%rbp),%xmm0
call   1040 <expq@plt>
mov    -0x44(%rbp),%edi
imul   %eax,%edi
call   1180 <__floatsitf>
add    $0x50,%rsp
pop    %rbp
ret
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<plm_dPlm>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rdx
mov    $0x1,%al
call   1030 <plm_lndPlm@plt>
mov    %eax,%edi
call   1160 <__floatsitf>
mov    0xc(%rsp),%ebx
mov    $0x1,%al
call   1040 <expq@plt>
imul   %eax,%ebx
mov    %ebx,%edi
call   1160 <__floatsitf>
add    $0x10,%rsp
pop    %rbx
ret
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

LLVM IR (-O0):
define fp128 @plm_dPlm(i32 %0, i32 %1, fp128 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca fp128
%7 = alloca i32
%8 = alloca fp128
store i32 %0, i32* %4
store i32 %1, i32* %5
store fp128 %2, fp128* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load fp128, fp128* %6
%12 = call i32 (i32, i32, fp128, i32*, ...) bitcast (i32 (...)* @plm_lndPlm to i32 (i32, i32, fp128, i32*, ...)*)(i32 %9, i32 %10, fp128 %11, i32* %7)
%13 = sitofp i32 %12 to fp128
store fp128 %13, fp128* %8
%14 = load i32, i32* %7
%15 = load fp128, fp128* %8
%16 = call i32 (fp128, ...) bitcast (i32 (...)* @expq to i32 (fp128, ...)*)(fp128 %15)
%17 = mul nsw i32 %14, %16
%18 = sitofp i32 %17 to fp128
ret fp128 %18
}

LLVM IR (-O2):
define fp128 @plm_dPlm(i32 %0, i32 %1, fp128 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 (i32, i32, fp128, i32*, ...) bitcast (i32 (...)* @plm_lndPlm to i32 (i32, i32, fp128, i32*, ...)*)(i32 %0, i32 %1, fp128 %2, i32* %4)
%7 = sitofp i32 %6 to fp128
%8 = load i32, i32* %4
%9 = call i32 (fp128, ...) bitcast (i32 (...)* @expq to i32 (fp128, ...)*)(fp128 %7)
%10 = mul nsw i32 %9, %8
%11 = sitofp i32 %10 to fp128
ret fp128 %11
}
unsigned char f87(unsigned char x, unsigned int y) {
  return (x << ((-y) & (8 - 1))) + (x >> y);
}


x86 assembly (clang, -O0):
<f87>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f87>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f87(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 = sub i32 0, %7
%9 = and i32 %8, 7
%10 = shl i32 %6, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i32, i32* %4
%14 = ashr i32 %12, %13
%15 = add nsw i32 %10, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @f87(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 0, %1
%5 = and i32 %4, 7
%6 = shl nuw nsw i32 %3, %5
%7 = lshr i32 %3, %1
%8 = add nuw nsw i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void hello() { assert(1); }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @hello() {
%1 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @hello() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
struct RadarParm {
  int dummy;
};
struct FitData {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int FitRead(int /*<<< orphan*/, struct RadarParm *, struct FitData *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int FitFread(FILE *fp, struct RadarParm *prm, struct FitData *fit) {
  return FitRead(fileno(fp), prm, fit);
}


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

x86 assembly (clang, -O2):
<FitFread>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <fileno@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <FitRead@plt>

LLVM IR (-O0):
%struct.RadarParm = type { i32 }
%struct.FitData = type { i32 }
define i32 @FitFread(i32* %0, %struct.RadarParm* %1, %struct.FitData* %2) {
%4 = alloca i32*
%5 = alloca %struct.RadarParm*
%6 = alloca %struct.FitData*
store i32* %0, i32** %4
store %struct.RadarParm* %1, %struct.RadarParm** %5
store %struct.FitData* %2, %struct.FitData** %6
%7 = load i32*, i32** %4
%8 = call i32 @fileno(i32* %7)
%9 = load %struct.RadarParm*, %struct.RadarParm** %5
%10 = load %struct.FitData*, %struct.FitData** %6
%11 = call i32 @FitRead(i32 %8, %struct.RadarParm* %9, %struct.FitData* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.RadarParm = type { i32 }
%struct.FitData = type { i32 }
define i32 @FitFread(i32* nocapture %0, %struct.RadarParm* %1, %struct.FitData* %2) {
%4 = tail call i32 @fileno(i32* %0)
%5 = tail call i32 @FitRead(i32 %4, %struct.RadarParm* %1, %struct.FitData* %2)
ret i32 %5
}
void lsmod_name(char *input_line, char *mod_name) {
  int i = 0;
  while (input_line[i] != ' ') {
    mod_name[i] = input_line[i];
    i++;
  }
  mod_name[i] = '\0';
}


x86 assembly (clang, -O0):
<lsmod_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     114c <lsmod_name+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <lsmod_name+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsmod_name>:
mov    (%rdi),%al
cmp    $0x20,%al
jne    110d <lsmod_name+0xd>
xor    %eax,%eax
movb   $0x0,(%rsi,%rax,1)
ret
xor    %ecx,%ecx
nop
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
cmp    $0x20,%al
jne    1110 <lsmod_name+0x10>
mov    %ecx,%eax
movb   $0x0,(%rsi,%rax,1)
ret

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

LLVM IR (-O2):
define void @lsmod_name(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 32
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
unsigned xrop3_196_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  return (stk1 & (~S)) | (D & S);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_196_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int init(int x) { printf("Initialize:%d\n", x); }


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

x86 assembly (clang, -O2):
<init>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Initialize:%d\0A\00"
define i32 @init(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
short mksym_i16() { return 0; }


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

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

LLVM IR (-O0):
define signext i16 @mksym_i16() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @mksym_i16() {
ret i16 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int str_equal(char *s1, char *s2) { return 0 == strcmp(s1, s2); }


x86 assembly (clang, -O0):
<str_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @str_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @str_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ lv;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
int read_be_uint32(FILE *fp, uint32_t *ptr) {
  uint32_t lv;
  if (fread(&lv, sizeof(lv), 1, fp) != 1) {
    return 1;
  }
  *ptr = ntohl(lv);
  return 0;
}


x86 assembly (clang, -O0):
<read_be_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x1c(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     115c <read_be_uint32+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <read_be_uint32+0x53>
mov    -0x1c(%rbp),%edi
call   1040 <ntohl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_be_uint32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x1,%ebp
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1154 <read_be_uint32+0x34>
mov    0x4(%rsp),%edi
call   1040 <ntohl@plt>
mov    %eax,(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_be_uint32(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fread(i32* %3, i32 4, i32 1, i32* %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = tail call i32 @ntohl(i32 %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
int SIGWINCH;
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exitapp();
int /*<<< orphan*/ refresh();
void handleinterupt(int signum) {
  if (signum == SIGWINCH) {
    endwin();
    refresh();
    clear();
    return;
  } else {
    exitapp();
  }
}


x86 assembly (clang, -O0):
<handleinterupt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
jne    1177 <handleinterupt+0x37>
mov    $0x0,%al
call   1040 <endwin@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1060 <clear@plt>
jmp    117e <handleinterupt+0x3e>
mov    $0x0,%al
call   1050 <exitapp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleinterupt>:
push   %rax
mov    0x2ea0(%rip),%rax
cmp    %edi,(%rax)
jne    1162 <handleinterupt+0x22>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <exitapp@plt>

LLVM IR (-O0):
@SIGWINCH = global i32 0
define void @handleinterupt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGWINCH
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 (...) @endwin()
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @clear()
br label %12
10: ; preds = %1
%11 = call i32 (...) @exitapp()
br label %12
12: ; preds = %6, %10
ret void
}

LLVM IR (-O2):
@SIGWINCH = global i32 0
define void @handleinterupt(i32 %0) {
%2 = load i32, i32* @SIGWINCH
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (...) @endwin()
%6 = tail call i32 (...) @refresh()
%7 = tail call i32 (...) @clear()
br label %10
8: ; preds = %1
%9 = tail call i32 (...) @exitapp()
br label %10
10: ; preds = %4, %8
ret void
}
int rl_vi_undo(count, key)
int count, key;
{ return (rl_undo_command(count, key)); }


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

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

LLVM IR (-O0):
define i32 @rl_vi_undo(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 (i32, i32, ...) bitcast (i32 (...)* @rl_undo_command to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rl_vi_undo(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_undo_command to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret i32 %3
}
int test_imm_13int16_reg(short val) {
  return ((val) & (0x13 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_13int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_13int16_reg>:
test   $0x13,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_13int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 19
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_13int16_reg(i16 signext %0) {
%2 = and i16 %0, 19
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int WriteInt32(char *, int, int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
int WriteString(char *ptr, int ofs, const char *src, int len) {
  ofs = WriteInt32(ptr, ofs, len);
  memcpy(ptr + ofs, src, len);
  return (ofs + len);
}


x86 assembly (clang, -O0):
<WriteString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <WriteInt32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %ecx,%edx
call   1030 <WriteInt32@plt>
movslq %eax,%rbp
add    %rbp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
add    %r15d,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WriteString(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %8
%12 = call i32 @WriteInt32(i8* %9, i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 @memcpy(i8* %16, i8* %17, i32 %18)
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = add nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @WriteString(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @WriteInt32(i8* %0, i32 %1, i32 %3)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i32 @memcpy(i8* %7, i8* %2, i32 %3)
%9 = add nsw i32 %5, %3
ret i32 %9
}
double sub_precise(double x, double y) { return (x - y); }


x86 assembly (clang, -O0):
<sub_precise>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_precise>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sub_precise(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @sub_precise(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
short signed int scale_data(short signed int data, double gain) {
  short signed int n_result = 0;
  double d_result = (double)data * gain;
  if (d_result < -32768.0) {
    d_result = -32768.0;
  }
  if (d_result > 32767.0) {
    d_result = 32767.0;
  }
  n_result = (short signed int)d_result;
  return n_result;
}


x86 assembly (clang, -O0):
<scale_data>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movsd  %xmm0,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
movswl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed0(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1148 <scale_data+0x48>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    116c <scale_data+0x6c>
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_data>:
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm0
maxsd  %xmm1,%xmm0
movsd  0xeec(%rip),%xmm1
minsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define signext i16 @scale_data(i16 signext %0, double %1) {
%3 = alloca i16
%4 = alloca double
%5 = alloca i16
%6 = alloca double
store i16 %0, i16* %3
store double %1, double* %4
store i16 0, i16* %5
%7 = load i16, i16* %3
%8 = sitofp i16 %7 to double
%9 = load double, double* %4
%10 = fmul double %8, %9
store double %10, double* %6
%11 = load double, double* %6
%12 = fcmp olt double %11, -3.276800e+04
br i1 %12, label %13, label %14
13: ; preds = %2
store double -3.276800e+04, double* %6
br label %14
14: ; preds = %13, %2
%15 = load double, double* %6
%16 = fcmp ogt double %15, 3.276700e+04
br i1 %16, label %17, label %18
17: ; preds = %14
store double 3.276700e+04, double* %6
br label %18
18: ; preds = %17, %14
%19 = load double, double* %6
%20 = fptosi double %19 to i16
store i16 %20, i16* %5
%21 = load i16, i16* %5
ret i16 %21
}

LLVM IR (-O2):
define signext i16 @scale_data(i16 signext %0, double %1) {
%3 = sitofp i16 %0 to double
%4 = fmul double %3, %1
%5 = fcmp olt double %4, -3.276800e+04
%6 = select i1 %5, double -3.276800e+04, double %4
%7 = fcmp ogt double %6, 3.276700e+04
%8 = select i1 %7, double 3.276700e+04, double %6
%9 = fptosi double %8 to i16
ret i16 %9
}
/* Variables and functions */
unsigned char spiSR(unsigned char);
unsigned char SPI1_ReadWrite(unsigned char writedat) { return spiSR(writedat); }


x86 assembly (clang, -O0):
<SPI1_ReadWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <spiSR@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI1_ReadWrite>:
jmp    1030 <spiSR@plt>

LLVM IR (-O0):
define zeroext i8 @SPI1_ReadWrite(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @spiSR(i8 zeroext %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @SPI1_ReadWrite(i8 zeroext %0) {
%2 = tail call zeroext i8 @spiSR(i8 zeroext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float soma(float x, float y) {
  float resultado = 0;
  resultado = x + y;
  printf("%2.f\n", resultado);
  return resultado;
}


x86 assembly (clang, -O0):
<soma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma>:
push   %rax
addss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%2.f\0A\00"
define float @soma(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %9)
%11 = load float, float* %5
ret float %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%2.f\0A\00"
define float @soma(float %0, float %1) {
%3 = fadd float %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %3)
ret float %3
}
void __DELETE_java_lang_Character(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_lang_Character(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_lang_Character(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int test_imm_3Fint16_mem(short *val) {
  return ((*val) & (-0x3F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Fint16_mem>:
movzwl (%rdi),%eax
test   $0xffc1,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -63
%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_3Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -63
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void StringMapChar(char *to, int from_c, int to_c) {
  while (*to) {
    if (*to == from_c)
      *to = to_c;
    to++;
  }
}


x86 assembly (clang, -O0):
<StringMapChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <StringMapChar+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1136 <StringMapChar+0x36>
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <StringMapChar+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringMapChar>:
mov    (%rdi),%al
test   %al,%al
je     1127 <StringMapChar+0x27>
add    $0x1,%rdi
jmp    111b <StringMapChar+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1127 <StringMapChar+0x27>
movsbl %al,%eax
cmp    %esi,%eax
jne    1110 <StringMapChar+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <StringMapChar+0x10>
ret

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

LLVM IR (-O2):
define void @StringMapChar(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3
%7 = trunc i32 %2 to i8
br label %8
8: ; preds = %6, %14
%9 = phi i8 [ %4, %6 ], [ %16, %14 ]
%10 = phi i8* [ %0, %6 ], [ %15, %14 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %14
13: ; preds = %8
store i8 %7, i8* %10
br label %14
14: ; preds = %13, %8
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %14, %3
ret void
}
char *RGMPdevname(void) { return ("Macintosh PICTURE output"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Macintosh PICTURE output\00"
define i8* @RGMPdevname() {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [25 x i8] c"Macintosh PICTURE output\00"
define i8* @RGMPdevname() {
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
bool stdlib_base_is_nan(const double x) { return (x != x); }


x86 assembly (clang, -O0):
<stdlib_base_is_nan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_is_nan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @stdlib_base_is_nan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @stdlib_base_is_nan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GETSTATIC_B();
void GETSTATIC_C() { GETSTATIC_B(); }


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

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

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

LLVM IR (-O2):
define void @GETSTATIC_C() {
%1 = tail call i32 (...) @GETSTATIC_B()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ singlyLL();
int main(void) {
  printf("Welcome, this program demonstrates the singly linked list\n");
  singlyLL();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"Welcome, this program demonstrates the singly linked list\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @singlyLL()
ret i32 0
}

LLVM IR (-O2):
@str = [58 x i8] c"Welcome, this program demonstrates the singly linked list\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @singlyLL()
ret i32 0
}
const double golden() { return 1.6148; }


x86 assembly (clang, -O0):
<golden>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<golden>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @golden() {
ret double 1.614800e+00
}

LLVM IR (-O2):
define double @golden() {
ret double 1.614800e+00
}
/* Variables and functions */
char *strchr(char const *, char);
char *NextLine(const char *InStream) {
  if (!(InStream = strchr(InStream, '\n'))) {
    return NULL;
  }
  if (*(InStream + 1) == '\0') {
    return NULL;
  }
  ++InStream;
  return (char *)InStream;
}


x86 assembly (clang, -O0):
<NextLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1145 <NextLine+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1177 <NextLine+0x67>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1163 <NextLine+0x53>
movq   $0x0,-0x8(%rbp)
jmp    1177 <NextLine+0x67>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextLine>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1136 <NextLine+0x26>
mov    %rax,%rcx
mov    %rax,%rdx
add    $0x1,%rdx
xor    %eax,%eax
cmpb   $0x0,0x1(%rcx)
cmovne %rdx,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @NextLine(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* null, i8* %5
br label %9
9: ; preds = %4, %1
%10 = phi i8* [ null, %1 ], [ %8, %4 ]
ret i8* %10
}
int AcceptNode(struct SyncUpdateData *ud) {}


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

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

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

LLVM IR (-O2):
%struct.SyncUpdateData = type opaque
define i32 @AcceptNode(%struct.SyncUpdateData* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_MD_CTX_md_data(int /*<<< orphan*/ *);
int SHA224_Init(int /*<<< orphan*/);
int init224(EVP_MD_CTX *ctx) { return SHA224_Init(EVP_MD_CTX_md_data(ctx)); }


x86 assembly (clang, -O0):
<init224>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <EVP_MD_CTX_md_data@plt>
mov    %eax,%edi
call   1040 <SHA224_Init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init224>:
push   %rax
call   1030 <EVP_MD_CTX_md_data@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <SHA224_Init@plt>

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

LLVM IR (-O2):
define i32 @init224(i32* %0) {
%2 = tail call i32 @EVP_MD_CTX_md_data(i32* %0)
%3 = tail call i32 @SHA224_Init(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t isprint32_t(const int32_t c) { return c >= 0x20 && c <= 0x7E; }


x86 assembly (clang, -O0):
<isprint32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint32_t+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint32_t>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint32_t(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint32_t(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
int getkey(when)
int when;
{ return getabkey(when, "", 0); }


x86 assembly (clang, -O0):
<getkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <getabkey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkey>:
lea    0xee9(%rip),%rsi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <getabkey@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @getkey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @getabkey to i32 (i32, i8*, i32, ...)*)(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @getkey(i32 %0) {
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @getabkey to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %2
}
int test_imm_18uint8_reg(unsigned char val) {
  return ((val) & (-0x18 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_18uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffe8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_18uint8_reg>:
test   $0xe8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_18uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -24
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_18uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -24
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ posix_memalign(void **, size_t, size_t);
void *aligned_alloc(size_t size, size_t alignment) {
  void *ptr;
  posix_memalign(&ptr, alignment, size);
  return ptr;
}


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

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

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

LLVM IR (-O2):
define i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @posix_memalign(i8** %3, i64 %1, i64 %0)
%6 = load i8*, i8** %3
ret i8* %6
}
/* Variables and functions */
int cislo(char *, int);
int datum(char *, int);
char zisti(char vstup[], int dlzka) {
  char odpoved;
  if (cislo(vstup, dlzka) == 1) {
    odpoved = 'c';
    return odpoved;
  } else if (datum(vstup, dlzka) == 1) {
    odpoved = 'd';
    return odpoved;
  } else {
    odpoved = 's';
    return odpoved;
  }
}


x86 assembly (clang, -O0):
<zisti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <cislo@plt>
cmp    $0x1,%eax
jne    1153 <zisti+0x33>
movb   $0x63,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1181 <zisti+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <datum@plt>
cmp    $0x1,%eax
jne    1177 <zisti+0x57>
movb   $0x64,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1181 <zisti+0x61>
movb   $0x73,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zisti>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <cislo@plt>
mov    %eax,%ecx
mov    $0x63,%al
cmp    $0x1,%ecx
je     1150 <zisti+0x30>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <datum@plt>
cmp    $0x1,%eax
mov    $0x64,%ecx
mov    $0x73,%eax
cmove  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @zisti(i8* %0, i32 %1) {
%3 = tail call i32 @cislo(i8* %0, i32 %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @datum(i8* %0, i32 %1)
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i8 100, i8 115
br label %9
9: ; preds = %5, %2
%10 = phi i8 [ 99, %2 ], [ %8, %5 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int, int);
int main() {
  int a = 3, b = 4;
  swap(3, 4);
  printf("%d% d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d% d\0A\00"
define i32 @main() {
%1 = tail call i32 @swap(i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Queue_new(int);
int /*<<< orphan*/ run_test(int /*<<< orphan*/);
int main(void) {
  if (!run_test(Queue_new(true)))
    return -1;
  if (!run_test(Queue_new(false)))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <Queue_new@plt>
mov    %eax,%edi
call   1030 <run_test@plt>
cmp    $0x0,%eax
jne    1155 <main+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <main+0x5f>
xor    %edi,%edi
call   1040 <Queue_new@plt>
mov    %eax,%edi
call   1030 <run_test@plt>
cmp    $0x0,%eax
jne    1178 <main+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <main+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <Queue_new@plt>
mov    %eax,%edi
call   1030 <run_test@plt>
test   %eax,%eax
je     114b <main+0x2b>
xor    %edi,%edi
call   1040 <Queue_new@plt>
mov    %eax,%edi
call   1030 <run_test@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Queue_new(i32 1)
%2 = tail call i32 @run_test(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i32 @Queue_new(i32 0)
%6 = tail call i32 @run_test(i32 %5)
%7 = icmp eq i32 %6, 0
%8 = sext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ -1, %0 ], [ %8, %4 ]
ret i32 %10
}