xunge/DecIR huggingface dataset:
int test_imm_B0int64_highword_reg(long long val) {
  return ((val >> 32) & (0xB0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B0int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xb0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B0int64_highword_reg>:
movabs $0xb000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B0int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 176
%6 = icmp ne i64 %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_B0int64_highword_reg(i64 %0) {
%2 = and i64 %0, 755914244096
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int xrdp_rdp_process_data_sync(struct xrdp_rdp *self) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.xrdp_rdp = type opaque
define i32 @xrdp_rdp_process_data_sync(%struct.xrdp_rdp* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int abs(short);
int icalrecurrencetype_day_day_of_week(short);
int icalrecurrencetype_day_position(short day) {
  int wd, pos;
  wd = icalrecurrencetype_day_day_of_week(day);
  pos = (abs(day) - wd) / 8 * ((day < 0) ? -1 : 1);
  return pos;
}


x86 assembly (clang, -O0):
<icalrecurrencetype_day_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1040 <icalrecurrencetype_day_day_of_week@plt>
mov    %eax,-0x8(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <abs@plt>
sub    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
movswl -0x2(%rbp),%esi
mov    $0x1,%ecx
mov    $0xffffffff,%edx
cmp    $0x0,%esi
cmovl  %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icalrecurrencetype_day_position>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <icalrecurrencetype_day_day_of_week@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <abs@plt>
sub    %ebp,%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x3,%eax
mov    %eax,%ecx
neg    %ecx
test   %bx,%bx
cmovs  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @icalrecurrencetype_day_position(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = call i32 @icalrecurrencetype_day_day_of_week(i16 signext %5)
store i32 %6, i32* %3
%7 = load i16, i16* %2
%8 = call i32 @abs(i16 signext %7)
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = sdiv i32 %10, 8
%12 = load i16, i16* %2
%13 = sext i16 %12 to i32
%14 = icmp slt i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -1, i32 1
%17 = mul nsw i32 %11, %16
store i32 %17, i32* %4
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @icalrecurrencetype_day_position(i16 signext %0) {
%2 = tail call i32 @icalrecurrencetype_day_day_of_week(i16 signext %0)
%3 = tail call i32 @abs(i16 signext %0)
%4 = sub nsw i32 %3, %2
%5 = sdiv i32 %4, 8
%6 = icmp slt i16 %0, 0
%7 = sub nsw i32 0, %5
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
unsigned xrop3_150_0_1(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;
  stk2 = T ^ S;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_150_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, 255
%9 = xor i32 %6, -1
%10 = or i32 %4, %9
%11 = and i32 %8, %10
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
struct udev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void log_stderr(struct udev *udev, int priority, const char *file, int line,
                const char *fn, const char *format, va_list args) {
  fprintf(stderr, "libudev: %s: ", fn);
  vfprintf(stderr, format, args);
}


x86 assembly (clang, -O0):
<log_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <vfprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_stderr>:
push   %rbp
push   %r14
push   %rbx
mov    %r9,%rbx
mov    %r8,%rdx
mov    0x20(%rsp),%ebp
mov    0x2eab(%rip),%r14
mov    (%r14),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <vfprintf@plt>

LLVM IR (-O0):
%struct.udev = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"libudev: %s: \00"
define void @log_stderr(%struct.udev* %0, i32 %1, i8* %2, i32 %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca %struct.udev*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store %struct.udev* %0, %struct.udev** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %12
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stderr
%19 = load i8*, i8** %13
%20 = load i32, i32* %14
%21 = call i32 @vfprintf(i32 %18, i8* %19, i32 %20)
ret void
}

LLVM IR (-O2):
%struct.udev = type { i32 }
@stderr = global i32 0
@.str = [14 x i8] c"libudev: %s: \00"
define void @log_stderr(%struct.udev* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3, i8* %4, i8* %5, i32 %6) {
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = load i32, i32* @stderr
%11 = tail call i32 @vfprintf(i32 %10, i8* %5, i32 %6)
ret void
}
int exact_square(int number) {
  int i, product = 0;
  for (i = 2; product <= number; i++) {
    product = i * i;
    if (product == number) {
      return 1;
    }
    if (product > number) {
      return 0;
    }
  }
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     116e <exact_square+0x6e>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1143 <exact_square+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116e <exact_square+0x6e>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    115b <exact_square+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    116e <exact_square+0x6e>
jmp    1160 <exact_square+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <exact_square+0x15>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
test   %edi,%edi
js     1131 <exact_square+0x31>
mov    $0x1,%eax
cmp    $0x4,%edi
je     1130 <exact_square+0x30>
mov    $0x4,%edx
mov    $0x3,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,%edx
jg     1132 <exact_square+0x32>
mov    %ecx,%edx
imul   %ecx,%edx
add    $0x1,%ecx
cmp    %edi,%edx
jne    1120 <exact_square+0x20>
ret
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = mul nsw i32 %12, %12
%7 = icmp eq i32 %6, %0
br i1 %7, label %13, label %8
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ 4, %3 ]
%10 = phi i32 [ %12, %5 ], [ 2, %3 ]
%11 = icmp sgt i32 %9, %0
%12 = add nuw nsw i32 %10, 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %3, %1
%14 = phi i32 [ undef, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}
int newval(int x) {
  static int div = 1;
  return (x / div++);
}


x86 assembly (clang, -O0):
<newval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2f10(%rip),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,0x2f05(%rip)
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<newval>:
mov    %edi,%eax
mov    0x2f18(%rip),%ecx
lea    0x1(%rcx),%edx
mov    %edx,0x2f0f(%rip)
cltd
idiv   %ecx
ret

LLVM IR (-O0):
@newval.div = internal global i32 1
define i32 @newval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @newval.div
%5 = add nsw i32 %4, 1
store i32 %5, i32* @newval.div
%6 = sdiv i32 %3, %4
ret i32 %6
}

LLVM IR (-O2):
@newval.div = internal unnamed_addr global i32 1
define i32 @newval(i32 %0) {
%2 = load i32, i32* @newval.div
%3 = add nsw i32 %2, 1
store i32 %3, i32* @newval.div
%4 = sdiv i32 %0, %2
ret i32 %4
}
_wait(p) int *p;
{
  long l = _Xwait();
  if (l == -1)
    return -1;
  if (p)
    *p = (l >> 16);
  return (int)l;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_Xwait@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    1140 <_wait+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <_wait+0x52>
cmpq   $0x0,-0x10(%rbp)
je     115b <_wait+0x4b>
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_Xwait@plt>
test   %rbx,%rbx
je     112c <_wait+0x1c>
cmp    $0xffffffff,%eax
je     112c <_wait+0x1c>
mov    %eax,%ecx
sar    $0x10,%ecx
mov    %ecx,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_wait(i32* writeonly %0) {
%2 = tail call i32 (...) @_Xwait()
%3 = icmp eq i32 %2, -1
%4 = icmp eq i32* %0, null
%5 = or i1 %4, %3
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = ashr i32 %2, 16
store i32 %7, i32* %0
br label %8
8: ; preds = %6, %1
ret i32 %2
}
void menu() {}


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

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

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

LLVM IR (-O2):
define void @menu() {
ret void
}
void DefaultFunction(unsigned char *RGBABuffer, int ImageWidth, int ImageHeight,
                     unsigned char *YBuffer, unsigned char *UBuffer,
                     unsigned char *VBuffer, int SrcPitch, int DstPitch) {
  char *CharPtr = 0;
  *CharPtr = 1;
}


x86 assembly (clang, -O0):
<DefaultFunction>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @DefaultFunction(i8* %0, i32 %1, i32 %2, i8* %3, i8* %4, i8* %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i32 %6, i32* %15
store i32 %7, i32* %16
store i8* null, i8** %17
%18 = load i8*, i8** %17
store i8 1, i8* %18
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp2435r_clear_last(uint8_t *header) { header[2] &= ~0x2; }


x86 assembly (clang, -O0):
<rtp2435r_clear_last>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
and    $0xfffffffd,%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435r_clear_last>:
andb   $0xfd,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @rtp2435r_clear_last(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = and i32 %3, -3
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void baz(int x) { printf("%d\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @baz(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SSD1780_send_cmd_with_val(int, unsigned char);
void KaDisp_scroll_vert_to_point(unsigned char display_offset_px) {
  SSD1780_send_cmd_with_val(0xD3, display_offset_px & 0x3F);
}


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

x86 assembly (clang, -O2):
<KaDisp_scroll_vert_to_point>:
mov    %edi,%esi
and    $0x3f,%esi
mov    $0xd3,%edi
jmp    1030 <SSD1780_send_cmd_with_val@plt>

LLVM IR (-O0):
define void @KaDisp_scroll_vert_to_point(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, 63
%6 = trunc i32 %5 to i8
%7 = call i32 @SSD1780_send_cmd_with_val(i32 211, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @KaDisp_scroll_vert_to_point(i8 zeroext %0) {
%2 = and i8 %0, 63
%3 = tail call i32 @SSD1780_send_cmd_with_val(i32 211, i8 zeroext %2)
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ list_empty(struct list *const);
int /*<<< orphan*/ list_pop(struct list *const);
void list_purge(struct list *const l) {
  while (!list_empty(l)) {
    free(list_pop(l));
  }
}


x86 assembly (clang, -O0):
<list_purge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <list_purge+0x2a>
jmp    116f <list_purge+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <list_pop@plt>
mov    %eax,%edi
call   1030 <free@plt>
jmp    113c <list_purge+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_purge>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1050 <list_empty@plt>
test   %eax,%eax
jne    115d <list_purge+0x2d>
mov    %rbx,%rdi
call   1040 <list_pop@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    %rbx,%rdi
jmp    1140 <list_purge+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_purge(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.list*, %struct.list** %2
%5 = call i32 @list_empty(%struct.list* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = load %struct.list*, %struct.list** %2
%10 = call i32 @list_pop(%struct.list* %9)
%11 = call i32 @free(i32 %10)
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_purge(%struct.list* %0) {
%2 = tail call i32 @list_empty(%struct.list* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = tail call i32 @list_pop(%struct.list* %0)
%6 = tail call i32 @free(i32 %5)
%7 = tail call i32 @list_empty(%struct.list* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %1
ret void
}
unsigned char char2pchar(unsigned char c) {
  if (c == 0x00)
    return '~';
  if (c == 0xFF)
    return 'X';
  if (c < ' ')
    return '.';
  if (c > 127)
    return '?';
  return c;
}


x86 assembly (clang, -O0):
<char2pchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1120 <char2pchar+0x20>
movb   $0x7e,-0x1(%rbp)
jmp    116a <char2pchar+0x6a>
movzbl -0x2(%rbp),%eax
cmp    $0xff,%eax
jne    1138 <char2pchar+0x38>
movb   $0x58,-0x1(%rbp)
jmp    116a <char2pchar+0x6a>
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jge    114e <char2pchar+0x4e>
movb   $0x2e,-0x1(%rbp)
jmp    116a <char2pchar+0x6a>
movzbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jle    1164 <char2pchar+0x64>
movb   $0x3f,-0x1(%rbp)
jmp    116a <char2pchar+0x6a>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2pchar>:
test   %edi,%edi
je     110d <char2pchar+0xd>
cmp    $0xff,%dil
jne    1110 <char2pchar+0x10>
mov    $0x58,%al
ret
mov    $0x7e,%al
ret
mov    $0x2e,%al
cmp    $0x20,%dil
jb     1127 <char2pchar+0x27>
test   %dil,%dil
movzbl %dil,%ecx
mov    $0x3f,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @char2pchar(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 126, i8* %2
br label %25
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 255
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 88, i8* %2
br label %25
13: ; preds = %8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = icmp slt i32 %15, 32
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 46, i8* %2
br label %25
18: ; preds = %13
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = icmp sgt i32 %20, 127
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 63, i8* %2
br label %25
23: ; preds = %18
%24 = load i8, i8* %3
store i8 %24, i8* %2
br label %25
25: ; preds = %23, %22, %17, %12, %7
%26 = load i8, i8* %2
ret i8 %26
}

LLVM IR (-O2):
define zeroext i8 @char2pchar(i8 zeroext %0) {
switch i8 %0, label %3 [
i8 0, label %8
i8 -1, label %2
]
2: ; preds = %1
br label %8
3: ; preds = %1
%4 = icmp ult i8 %0, 32
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp slt i8 %0, 0
%7 = select i1 %6, i8 63, i8 %0
br label %8
8: ; preds = %5, %3, %1, %2
%9 = phi i8 [ 88, %2 ], [ 126, %1 ], [ 46, %3 ], [ %7, %5 ]
ret i8 %9
}
const char *loader_UNKNOWN_get_type(void) { return "UNKNOWN"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"UNKNOWN\00"
define i8* @loader_UNKNOWN_get_type() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
__attribute__((always_)) unsigned char inb_local(int port) {
  unsigned char value;
  __asm__ __volatile__("in"
                       "b"
                       " %w1, %"
                       "b"
                       "0"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb_local>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_local>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb_local(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb_local(i32 %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double sin(double);
double Seno(double a) {
  printf("Enter a number: ");
  scanf("%lf", &a);
  return (sin(a));
}


x86 assembly (clang, -O0):
<Seno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Seno>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Seno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Seno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @sin(double %5)
ret double %6
}
void _items_cleanup(char **in_string, int in_count) {
  for (int i = 0; i < in_count; i++)
    if (in_string[i])
      free(in_string[i]);
  free(in_string);
}


x86 assembly (clang, -O0):
<_items_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <_items_cleanup+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <_items_cleanup+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    115b <_items_cleanup+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <_items_cleanup+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_items_cleanup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1149 <_items_cleanup+0x39>
mov    %esi,%r15d
xor    %ebx,%ebx
jmp    1139 <_items_cleanup+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1149 <_items_cleanup+0x39>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <_items_cleanup+0x20>
call   1030 <free@plt>
jmp    1130 <_items_cleanup+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_items_cleanup(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %14, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %14
%9 = phi i64 [ 0, %4 ], [ %15, %14 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %8
tail call void @free(i8* %11)
br label %14
14: ; preds = %8, %13
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %5
br i1 %16, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
int main() {
  setenv("FOO", "bar", 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"FOO\00"
@.str.1 = [4 x i8] c"bar\00"
define i32 @main() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
__attribute__((always_)) int dev_to_node(struct device *dev) { return -1; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @dev_to_node(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dev_to_node(%struct.device* nocapture readnone %0) {
ret i32 -1
}
int some_library_function() { return 1; }


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

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

LLVM IR (-O0):
define i32 @some_library_function() {
ret i32 1
}

LLVM IR (-O2):
define i32 @some_library_function() {
ret i32 1
}
/* Variables and functions */
scalar_t__ isdigit(char);
int countLeadingNondigits(const char *s) {
  int count = 0;
  char c;
  while ((c = *s++) != 0) {
    if (isdigit(c))
      break;
    ++count;
  }
  return count;
}


x86 assembly (clang, -O0):
<countLeadingNondigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1169 <countLeadingNondigits+0x59>
movsbl -0xd(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115b <countLeadingNondigits+0x4b>
jmp    1169 <countLeadingNondigits+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <countLeadingNondigits+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countLeadingNondigits>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113d <countLeadingNondigits+0x2d>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    113f <countLeadingNondigits+0x2f>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <countLeadingNondigits+0x10>
jmp    113f <countLeadingNondigits+0x2f>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @countLeadingNondigits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %8, %11 ], [ %0, %1 ]
%7 = phi i32 [ %12, %11 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i64 @isdigit(i8 signext %5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = add nuw nsw i32 %7, 1
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %4, %1
%16 = phi i32 [ 0, %1 ], [ %7, %4 ], [ %12, %11 ]
ret i32 %16
}
int putenv(char *x) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @putenv(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR83_set(void) { return U_WMRCORENONE_set("U_WMR83"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR83\00"
define i8* @U_WMR83_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR83\00"
define i8* @U_WMR83_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void jl_rj(unsigned char saut) {
  put8(0x7C);
  put8(saut);
}


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

x86 assembly (clang, -O2):
<jl_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0x7c,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @jl_rj(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @put8(i8 zeroext 124)
%4 = load i8, i8* %2
%5 = call i32 @put8(i8 zeroext %4)
ret void
}

LLVM IR (-O2):
define void @jl_rj(i8 zeroext %0) {
%2 = tail call i32 @put8(i8 zeroext 124)
%3 = tail call i32 @put8(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void die(char *error) {
  fprintf(stderr, "Error in command line: %s\n", error);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Error in command line: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Error in command line: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int apr_win32_init(int sock) {
  if (sock < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<apr_win32_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <apr_win32_init+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1124 <apr_win32_init+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<apr_win32_init>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @apr_win32_init(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", power(2, 4));
  printf("%d\n", power(2, 3));
  printf("%d\n", power(3, 3));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <power@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <power@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%esi
mov    %esi,%edi
call   1030 <power@plt>
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @power(i32 2, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @power(i32 2, i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @power(i32 3, i32 3)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int fibonacci(int n) {
  if (n < 2) {
    return n;
  }
  return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fibonacci+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibonacci+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fibonacci+0x10>
mov    %ebx,%ecx
jmp    1144 <fibonacci+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fibonacci+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ puts(char *);
void printUsage(const char *command) {
  printf("Usage: %s [OPTION] [file.IFF]\n\n", command);
  puts(
      "The command `iffpp' displays a textual representation of a given IFF "
      "file, which\n"
      "can be used for manual inspection of its contents. If no IFF file is "
      "specified,\n"
      "it reads an IFF file from the standard input.\n\n"
      "Options:\n"
      "  -c, --disable-check    Do not check the IFF file for validity\n"
      "  -h, --help             Shows the usage of this command to the user\n"
      "  -v, --version          Shows the version of this command to the user");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: %s [OPTION] [file.IFF]\0A\0A\00"
@.str.1 = [421 x i8] c"The command `iffpp' displays a textual representation of a given IFF file, which\0Acan be used for manual inspection of its contents. If no IFF file is specified,\0Ait reads an IFF file from the standard input.\0A\0AOptions:\0A -c, --disable-check Do not check the IFF file for validity\0A -h, --help Shows the usage of this command to the user\0A -v, --version Shows the version of this command to the user\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @puts(i8* getelementptr inbounds ([421 x i8], [421 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: %s [OPTION] [file.IFF]\0A\0A\00"
@.str.1 = [421 x i8] c"The command `iffpp' displays a textual representation of a given IFF file, which\0Acan be used for manual inspection of its contents. If no IFF file is specified,\0Ait reads an IFF file from the standard input.\0A\0AOptions:\0A -c, --disable-check Do not check the IFF file for validity\0A -h, --help Shows the usage of this command to the user\0A -v, --version Shows the version of this command to the user\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([421 x i8], [421 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ angular_cyl(double, double, double, double,
                               int /*<<< orphan*/);
void angular_cylinder(double h, double r1, double r2, double fa) {
  angular_cyl(h, r1, r2, fa, 0);
}


x86 assembly (clang, -O0):
<angular_cylinder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
xor    %edi,%edi
call   1030 <angular_cyl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angular_cylinder>:
xor    %edi,%edi
jmp    1030 <angular_cyl@plt>

LLVM IR (-O0):
define void @angular_cylinder(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call i32 @angular_cyl(double %9, double %10, double %11, double %12, i32 0)
ret void
}

LLVM IR (-O2):
define void @angular_cylinder(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @angular_cyl(double %0, double %1, double %2, double %3, i32 0)
ret void
}
void format_skeleton_wr_deinit(void) {}


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

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

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

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