xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, float *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, float);
float getspace(FILE *fp) {
  float delta;
  fseek(fp, SEEK_SET, sizeof(float));
  fscanf(fp, "%f", &delta);
  printf("%f\n", delta);
  return delta;
}


x86 assembly (clang, -O0):
<getspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getspace>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
call   1050 <fseek@plt>
lea    0xeae(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <fscanf@plt>
movss  0xc(%rsp),%xmm0
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define float @getspace(i32* nocapture %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i32 %4, i32 4)
%6 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %7)
%9 = load float, float* %2
ret float %9
}
void av_hmac_free() {}


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

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

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

LLVM IR (-O2):
define void @av_hmac_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ count_nibbles(int /*<<< orphan*/);
int /*<<< orphan*/ get_test_data(int /*<<< orphan*/);
void test_count_nibbles() { count_nibbles(get_test_data(0)); }


x86 assembly (clang, -O0):
<test_count_nibbles>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <get_test_data@plt>
mov    %eax,%edi
call   1030 <count_nibbles@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_count_nibbles() {
%1 = call i32 @get_test_data(i32 0)
%2 = call i32 @count_nibbles(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_count_nibbles() {
%1 = tail call i32 @get_test_data(i32 0)
%2 = tail call i32 @count_nibbles(i32 %1)
ret void
}
_Bool F5(_Bool B1, _Bool B2) {
  _Bool R = 0;
  if (!(B1 && B2))
    R = 1;
  return R;
}


x86 assembly (clang, -O0):
<F5>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
and    $0x1,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
movb   $0x0,-0x3(%rbp)
testb  $0x1,-0x1(%rbp)
je     112d <F5+0x2d>
testb  $0x1,-0x2(%rbp)
jne    1131 <F5+0x31>
movb   $0x1,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F5>:
mov    %edi,%eax
and    %esi,%eax
xor    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i1 @F5(i1 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = zext i1 %0 to i8
store i8 %6, i8* %3
%7 = zext i1 %1 to i8
store i8 %7, i8* %4
store i8 0, i8* %5
%8 = load i8, i8* %3
%9 = trunc i8 %8 to i1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %4
%12 = trunc i8 %11 to i1
br i1 %12, label %14, label %13
13: ; preds = %10, %2
store i8 1, i8* %5
br label %14
14: ; preds = %13, %10
%15 = load i8, i8* %5
%16 = trunc i8 %15 to i1
ret i1 %16
}

LLVM IR (-O2):
define zeroext i1 @F5(i1 zeroext %0, i1 zeroext %1) {
%3 = and i1 %0, %1
%4 = xor i1 %3, true
ret i1 %4
}
unsigned char digest_fold(const unsigned char *mdigest) {
  int i;
  unsigned char rval;
  rval = mdigest[0];
  for (i = 1; i < 16; i++) {
    rval = rval ^ mdigest[i];
  }
  return (rval);
}


x86 assembly (clang, -O0):
<digest_fold>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1145 <digest_fold+0x45>
movzbl -0xd(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <digest_fold+0x18>
movzbl -0xd(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digest_fold>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
pxor   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pxor   %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
pxor   %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrlw  $0x8,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @digest_fold(i8* nocapture %0) {
%2 = bitcast i8* %0 to <16 x i8>*
%3 = load <16 x i8>, <16 x i8>* %2
%4 = call i8 @llvm.vector.reduce.xor.v16i8(<16 x i8> %3)
ret i8 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint8_t chpl_bitops_rotr_8(uint8_t x, uint8_t n) {
  assert(n < 8);
  return (x >> n) | (x << (-n & (8 - 1)));
}


x86 assembly (clang, -O0):
<chpl_bitops_rotr_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x7,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chpl_bitops_rotr_8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x8,%esi
setl   %dil
call   1030 <assert@plt>
mov    %ebp,%eax
mov    %ebx,%ecx
sar    %cl,%eax
neg    %bl
and    $0x7,%bl
mov    %ebx,%ecx
shl    %cl,%ebp
or     %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @chpl_bitops_rotr_8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 8
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = ashr i32 %9, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
%15 = and i32 %14, 7
%16 = shl i32 %12, %15
%17 = or i32 %11, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @chpl_bitops_rotr_8(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 8
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = ashr i32 %0, %1
%7 = sub nsw i32 0, %1
%8 = and i32 %7, 7
%9 = shl i32 %0, %8
%10 = or i32 %9, %6
ret i32 %10
}
unsigned int ft_collatz_conjecture(unsigned int base) {
  if (base == 1)
    return (1);
  if ((base % 2) == 0)
    base = base / 2;
  else
    base = (base * 3) + 1;
  return (ft_collatz_conjecture(base));
}


x86 assembly (clang, -O0):
<ft_collatz_conjecture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <ft_collatz_conjecture+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1163 <ft_collatz_conjecture+0x53>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114e <ft_collatz_conjecture+0x3e>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <ft_collatz_conjecture+0x48>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_collatz_conjecture@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_collatz_conjecture>:
cmp    $0x1,%edi
je     1124 <ft_collatz_conjecture+0x24>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
shr    %eax
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%edi
cmove  %eax,%edi
cmp    $0x1,%edi
jne    1110 <ft_collatz_conjecture+0x10>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ft_collatz_conjecture(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %21
7: ; preds = %1
%8 = load i32, i32* %3
%9 = urem i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = udiv i32 %12, 2
store i32 %13, i32* %3
br label %18
14: ; preds = %7
%15 = load i32, i32* %3
%16 = mul i32 %15, 3
%17 = add i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %11
%19 = load i32, i32* %3
%20 = call i32 @ft_collatz_conjecture(i32 %19)
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %6
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @ft_collatz_conjecture(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ %0, %1 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = lshr i32 %4, 1
%8 = mul i32 %4, 3
%9 = add i32 %8, 1
%10 = select i1 %6, i32 %7, i32 %9
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %3
12: ; preds = %3, %1
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ logger(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ read_int8(char const *);
int read_mysql_longlong(const char *buf) {
  int64_t num = 0;
  num = read_int8(buf);
  logger(0, "LONG LONG INT: %ld\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<read_mysql_longlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_int8@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    %edi,%edi
lea    0xeb5(%rip),%rsi
call   1040 <logger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mysql_longlong>:
push   %rax
call   1030 <read_int8@plt>
lea    0xed3(%rip),%rsi
xor    %edi,%edi
mov    %eax,%edx
call   1040 <logger@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"LONG LONG INT: %ld\0A\00"
define i32 @read_mysql_longlong(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @read_int8(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @logger(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"LONG LONG INT: %ld\0A\00"
define i32 @read_mysql_longlong(i8* %0) {
%2 = tail call i32 @read_int8(i8* %0)
%3 = tail call i32 @logger(i32 0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
void foo590(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo590(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t list_meter_uint64_t(const void *el) {
  if (el) {
  }
  return sizeof(uint64_t);
}


x86 assembly (clang, -O0):
<list_meter_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <list_meter_uint64_t+0x18>
jmp    1118 <list_meter_uint64_t+0x18>
mov    $0x4,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @list_meter_uint64_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i64 4
}

LLVM IR (-O2):
define i64 @list_meter_uint64_t(i8* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ cc2400_init();
int /*<<< orphan*/ clock_start();
int /*<<< orphan*/ gpio_init();
void ubertooth_init() {
  gpio_init();
  cc2400_init();
  clock_start();
}


x86 assembly (clang, -O0):
<ubertooth_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <gpio_init@plt>
mov    $0x0,%al
call   1040 <cc2400_init@plt>
mov    $0x0,%al
call   1030 <clock_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubertooth_init>:
push   %rax
xor    %eax,%eax
call   1050 <gpio_init@plt>
xor    %eax,%eax
call   1040 <cc2400_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clock_start@plt>

LLVM IR (-O0):
define void @ubertooth_init() {
%1 = call i32 (...) @gpio_init()
%2 = call i32 (...) @cc2400_init()
%3 = call i32 (...) @clock_start()
ret void
}

LLVM IR (-O2):
define void @ubertooth_init() {
%1 = tail call i32 (...) @gpio_init()
%2 = tail call i32 (...) @cc2400_init()
%3 = tail call i32 (...) @clock_start()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_secure(void **p) {
  free(*p);
  *p = NULL;
}


x86 assembly (clang, -O0):
<free_secure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_secure>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @free_secure(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = call i32 @free(i8* %4)
%6 = load i8**, i8*** %2
store i8* null, i8** %6
ret void
}

LLVM IR (-O2):
define void @free_secure(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputPolarity(unsigned char, char);
void SetDirection(unsigned char Outputs, unsigned char Dir) {
  char Polarity;
  switch (Dir) {
  case 0x00:
    Polarity = -1;
    break;
  case 0x40:
    Polarity = 0;
    break;
  default:
    Polarity = 1;
    break;
  }
  OutputPolarity(Outputs, Polarity);
}


x86 assembly (clang, -O0):
<SetDirection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1149 <SetDirection+0x39>
jmp    1138 <SetDirection+0x28>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
je     1152 <SetDirection+0x42>
jmp    115b <SetDirection+0x4b>
movb   $0xff,-0x3(%rbp)
jmp    115f <SetDirection+0x4f>
movb   $0x0,-0x3(%rbp)
jmp    115f <SetDirection+0x4f>
movb   $0x1,-0x3(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movsbl -0x3(%rbp),%esi
call   1030 <OutputPolarity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetDirection>:
cmp    $0x40,%sil
setne  %al
cmp    $0x1,%esi
sbb    %ecx,%ecx
or     %al,%cl
movsbl %cl,%esi
jmp    1030 <OutputPolarity@plt>

LLVM IR (-O0):
define void @SetDirection(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
switch i32 %7, label %10 [
i32 0, label %8
i32 64, label %9
]
8: ; preds = %2
store i8 -1, i8* %5
br label %11
9: ; preds = %2
store i8 0, i8* %5
br label %11
10: ; preds = %2
store i8 1, i8* %5
br label %11
11: ; preds = %10, %9, %8
%12 = load i8, i8* %3
%13 = load i8, i8* %5
%14 = call i32 @OutputPolarity(i8 zeroext %12, i8 signext %13)
ret void
}

LLVM IR (-O2):
define void @SetDirection(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ne i8 %1, 64
%4 = zext i1 %3 to i8
%5 = icmp eq i8 %1, 0
%6 = select i1 %5, i8 -1, i8 %4
%7 = tail call i32 @OutputPolarity(i8 zeroext %0, i8 signext %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lrs_main(int, char **);
int main(int argc, char *argv[]) {
  lrs_main(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @lrs_main(i32 %0, i8** %1)
ret i32 0
}
int test_imm_C4uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xC4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C4uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xc4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4uint64_midword_reg>:
test   $0xc40000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C4uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 196
%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_C4uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12845056
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, const char *argv[]) {
  int a = 5;
  int b = 8;
  int c;
  c = a;
  a = b;
  b = c;
  printf("a=%d b=%d", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"a=%d b=%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8, i32 5)
ret i32 0
}
int test_imm_64uint16_reg(unsigned short val) {
  return ((val) & (-0x64 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_64uint16_reg>:
test   $0xff9c,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_64uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -100
%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_64uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -100
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage:\n"
          "RNALfold [-L span]\n"
          "         [-T temp] [-4] [-d[2|3]] [-noGU] [-noCloseGU]\n"
          "         [-noLP] [-P paramfile] [-nsp pairs] [-noconv]\n");
}


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

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

LLVM IR (-O0):
@.str = [137 x i8] c"usage:\0ARNALfold [-L span]\0A [-T temp] [-4] [-d[2|3]] [-noGU] [-noCloseGU]\0A [-noLP] [-P paramfile] [-nsp pairs] [-noconv]\0A\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [137 x i8] c"usage:\0ARNALfold [-L span]\0A [-T temp] [-4] [-d[2|3]] [-noGU] [-noCloseGU]\0A [-noLP] [-P paramfile] [-nsp pairs] [-noconv]\0A\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0))
ret void
}
void swap(int *a, int *b) {
  int t;
  t = *b;
  *b = *a;
  *a = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rsi),%eax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I_Quit();
__attribute__((noreturn)) void Command_Quit_f(void) { I_Quit(); }


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

x86 assembly (clang, -O2):
<Command_Quit_f>:
push   %rax
xor    %eax,%eax
call   1030 <I_Quit@plt>

LLVM IR (-O0):
define void @Command_Quit_f() {
%1 = call i32 (...) @I_Quit()
unreachable
}

LLVM IR (-O2):
define void @Command_Quit_f() {
%1 = tail call i32 (...) @I_Quit()
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bswap_32(uint32_t x) {
  return (((x & 0xff000000U) >> 24) | ((x & 0x00ff0000U) >> 8) |
          ((x & 0x0000ff00U) << 8) | ((x & 0x000000ffU) << 24));
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @bswap_32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, int, char const *,
                           char const *, int, char const *, char const *);
int write_file(char *line, const char *mode, int num, const char *user,
               const char *group, int size, const char *date,
               const char *fl_name) {
  sprintf(line, "%s %3d %-4s %-4s %8d %12s %s\r\n", mode, num, user, group,
          size, date, fl_name);
  return 0;
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%r11d
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
lea    0xea3(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <sprintf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
sub    $0x18,%rsp
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
movaps 0x20(%rsp),%xmm0
movups %xmm0,0x8(%rsp)
mov    %r9d,(%rsp)
lea    0xecc(%rip),%rsi
mov    %rax,%r9
call   1030 <sprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"%s %3d %-4s %-4s %8d %12s %s\0D\0A\00"
define i32 @write_file(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i32 %5, i8* %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i32 %2, i32* %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i32 %5, i32* %14
store i8* %6, i8** %15
store i8* %7, i8** %16
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i32, i32* %11
%20 = load i8*, i8** %12
%21 = load i8*, i8** %13
%22 = load i32, i32* %14
%23 = load i8*, i8** %15
%24 = load i8*, i8** %16
%25 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %19, i8* %20, i8* %21, i32 %22, i8* %23, i8* %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s %3d %-4s %-4s %8d %12s %s\0D\0A\00"
define i32 @write_file(i8* nocapture writeonly %0, i8* %1, i32 %2, i8* %3, i8* %4, i32 %5, i8* %6, i8* %7) {
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* %4, i32 %5, i8* %6, i8* %7)
ret i32 0
}
unsigned hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++) != '\0')
    hash = ((hash << 5) + hash) + c;
  return hash & (2048 - 1);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
and    $0x7ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1132 <hash+0x32>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x7ff,%eax
ret
mov    $0x505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %11 to i32
%16 = and i32 %15, 2047
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 1285, %1 ], [ %16, %14 ]
ret i32 %18
}
/* Variables and functions */
char *get_str(char *, int);
scalar_t__ strlen(char const *);
char get_char(char *line, int column_num) {
  const char *str = get_str(line, column_num);
  if (str && strlen(str) > 0)
    return str[0];
  else
    return '?';
}


x86 assembly (clang, -O0):
<get_char>:
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 <get_str@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116b <get_char+0x4b>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    116b <get_char+0x4b>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    116f <get_char+0x4f>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %rbp
push   %rbx
push   %rax
call   1040 <get_str@plt>
mov    $0x3f,%bpl
test   %rax,%rax
je     1143 <get_char+0x23>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    1143 <get_char+0x23>
mov    (%rbx),%bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @get_char(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 i8* @get_str(i8* %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = call i64 @strlen(i8* %13)
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8*, i8** %6
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
store i8 %19, i8* %3
br label %21
20: ; preds = %12, %2
store i8 63, i8* %3
br label %21
21: ; preds = %20, %16
%22 = load i8, i8* %3
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @get_char(i8* %0, i32 %1) {
%3 = tail call i8* @get_str(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i64 @strlen(i8* %3)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load i8, i8* %3
br label %10
10: ; preds = %2, %5, %8
%11 = phi i8 [ %9, %8 ], [ 63, %5 ], [ 63, %2 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void lostconn(int sig __attribute__((__unused__))) { exit(1); }


x86 assembly (clang, -O0):
<lostconn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @lostconn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @lostconn(i32 %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int q3(char c) {
  if (c == 'a') {
    printf("*** state 3 ***\n");
    return 2;
  } else if (c == 'b') {
    return 3;
  }
}


x86 assembly (clang, -O0):
<q3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jne    1143 <q3+0x33>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1161 <q3+0x51>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    115c <q3+0x4c>
movl   $0x3,-0x4(%rbp)
jmp    1161 <q3+0x51>
jmp    1161 <q3+0x51>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q3>:
mov    $0x3,%eax
cmp    $0x61,%dil
jne    1131 <q3+0x21>
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"*** state 3 ***\0A\00"
define i32 @q3(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 97
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 2, i32* %2
br label %15
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 98
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 3, i32* %2
br label %15
14: ; preds = %9
br label %15
15: ; preds = %7, %13, %14
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [16 x i8] c"*** state 3 ***\00"
define i32 @q3(i8 signext %0) {
%2 = icmp eq i8 %0, 97
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 2, %3 ], [ 3, %1 ]
ret i32 %6
}
int emac2_aframesreceivedok_set(unsigned int dev_id,
                                union emac2_aframesreceivedok_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac2_aframesreceivedok_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac2_aframesreceivedok_u = type opaque
define i32 @emac2_aframesreceivedok_set(i32 %0, %union.emac2_aframesreceivedok_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_aframesreceivedok_u*
store i32 %0, i32* %3
store %union.emac2_aframesreceivedok_u* %1, %union.emac2_aframesreceivedok_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_aframesreceivedok_u = type opaque
define i32 @emac2_aframesreceivedok_set(i32 %0, %union.emac2_aframesreceivedok_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
double sigmoid(double);
double ACTd(double X) {
  double s = sigmoid(X);
  return s * (1 - s);
}


x86 assembly (clang, -O0):
<ACTd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sigmoid@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ACTd>:
push   %rax
call   1030 <sigmoid@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ACTd(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @sigmoid(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fsub double 1.000000e+00, %7
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @ACTd(double %0) {
%2 = tail call double @sigmoid(double %0)
%3 = fsub double 1.000000e+00, %2
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printLong(char headerMessage[], long value) {
  printf("%s", headerMessage);
  printf("%ld\n", value);
}


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

x86 assembly (clang, -O2):
<printLong>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define void @printLong(i8* %0, i64 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %1)
ret void
}
int main() {
  int i;
  int j;
  int k;
  for (i = 0; i < 100000; i++)
    for (j = 0; j < 10000; j++)
      ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    1159 <main+0x59>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1146 <main+0x46>
jmp    1138 <main+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x26>
jmp    114b <main+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void charAscend(void *a, void *b) {
  char *first = (char *)a;
  char *second = (char *)b;
  char tmp = 0;
  if (*first > *second) {
    tmp = *first;
    *first = *second;
    *second = tmp;
  }
}


x86 assembly (clang, -O0):
<charAscend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movb   $0x0,-0x21(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    1154 <charAscend+0x54>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<charAscend>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jle    110c <charAscend+0xc>
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @charAscend(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i8 %4, i8* %0
store i8 %3, i8* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned int check_read(int, char *);
unsigned int inl(unsigned short int port) {
  return check_read((int)port, "inl");
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
lea    0xed6(%rip),%rsi
call   1030 <check_read@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"inl\00"
define i32 @inl(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = call i32 @check_read(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"inl\00"
define i32 @inl(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = tail call i32 @check_read(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void skipline(FILE *f) {
  while (fgetc(f) != '\n')
    ;
}


x86 assembly (clang, -O0):
<skipline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1136 <skipline+0x26>
jmp    111c <skipline+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipline>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1120 <skipline+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @skipline(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
br label %3
3: ; preds = %8, %1
%4 = load i32*, i32** %2
%5 = call signext i8 @fgetc(i32* %4)
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @skipline(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 @fgetc(i32* %0)
%4 = icmp eq i8 %3, 10
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
void *kmalloc(int bytes) {}


x86 assembly (clang, -O0):
<kmalloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @kmalloc(i32 %0) {
ret i8* undef
}
void reboot() {
  __asm__ __volatile__("cli");
  outPortB(0x64, 0xFE);
loop:
  __asm__ __volatile__("hlt");
  goto loop;
}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0x64,%edi
mov    $0xfe,%esi
mov    $0x0,%al
call   1030 <outPortB@plt>
hlt
jmp    1126 <reboot+0x16>

x86 assembly (clang, -O2):
<reboot>:
push   %rax
cli
mov    $0x64,%edi
mov    $0xfe,%esi
xor    %eax,%eax
call   1030 <outPortB@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
hlt
jmp    1130 <reboot+0x20>

LLVM IR (-O0):
define void @reboot() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outPortB to i32 (i32, i32, ...)*)(i32 100, i32 254)
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define void @reboot() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outPortB to i32 (i32, i32, ...)*)(i32 100, i32 254)
br label %2
2: ; preds = %2, %0
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %2
}
/* Variables and functions */
double strtod(char *, char **);
int getDouble(char *s, double *y) {
  char *endptr;
  *y = strtod(s, &endptr);
  if (*endptr > 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<getDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jle    1151 <getDouble+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1158 <getDouble+0x48>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDouble>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <strtod@plt>
movsd  %xmm0,(%rbx)
mov    0x8(%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
setle  %al
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getDouble(i8* %0, double* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call double @strtod(i8* %0, i8** %3)
store double %5, double* %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp slt i8 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}