xunge/DecIR huggingface dataset:
int test_any_odd_one(unsigned x) {
  int mask = 1 << 1;
  while (mask) {
    if (x & mask)
      return 1;
    mask <<= 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<test_any_odd_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <test_any_odd_one+0x41>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1133 <test_any_odd_one+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1148 <test_any_odd_one+0x48>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <test_any_odd_one+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_any_odd_one>:
xor    %eax,%eax
test   $0xaaaaaaaa,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @test_any_odd_one(i32 %0) {
%2 = and i32 %0, -1431655766
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ext2_bit_set(uint32_t *btbl, uint32_t bit_num) {
  int byte = (bit_num >> 5);
  int bit = (bit_num & 0x1F);
  btbl[byte] |= (1 << bit);
}


x86 assembly (clang, -O0):
<ext2_bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2_bit_set>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x5,%eax
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @ext2_bit_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 5
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 31
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = shl i32 1, %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = or i32 %17, %12
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @ext2_bit_set(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %5
store i32 %9, i32* %7
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t rtp_get_int_ssrc(const uint8_t *p_rtp) {
  return (p_rtp[8] << 24) | (p_rtp[9] << 16) | (p_rtp[10] << 8) | p_rtp[11];
}


x86 assembly (clang, -O0):
<rtp_get_int_ssrc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x24(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0x2c(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_get_int_ssrc>:
mov    0x20(%rdi),%eax
mov    0x24(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x28(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x2c(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @rtp_get_int_ssrc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
%6 = shl i32 %5, 24
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 9
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 10
%14 = load i32, i32* %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 11
%19 = load i32, i32* %18
%20 = or i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @rtp_get_int_ssrc(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i32, i32* %0, i64 9
%6 = load i32, i32* %5
%7 = shl i32 %6, 16
%8 = or i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 10
%10 = load i32, i32* %9
%11 = shl i32 %10, 8
%12 = or i32 %8, %11
%13 = getelementptr inbounds i32, i32* %0, i64 11
%14 = load i32, i32* %13
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 11);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xb,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0xb,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 11)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 11)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int set_target_hyperplane_sections(int i) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(62, &i, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<set_target_hyperplane_sections>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x3e,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_target_hyperplane_sections>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3e,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @set_target_hyperplane_sections(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 62, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @set_target_hyperplane_sections(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 62, i32* %2, i32* undef, double* undef)
ret i32 %3
}
unsigned short int _ldecomp(unsigned char *ptr) {
  unsigned short int i;
  i = 0xc0 ^ ptr[0];
  i <<= 8;
  i |= ptr[1];
  if (i >= 4096)
    i = 4095;
  return i;
}


x86 assembly (clang, -O0):
<_ldecomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xc0,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x1000,%eax
jl     114a <_ldecomp+0x4a>
movw   $0xfff,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ldecomp>:
movzbl (%rdi),%eax
xor    $0xc0,%eax
mov    %eax,%ecx
shl    $0x8,%ecx
movzbl 0x1(%rdi),%edx
or     %ecx,%edx
cmp    $0x10,%al
mov    $0xfff,%eax
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @_ldecomp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = xor i8 %2, -64
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i16
%9 = or i16 %5, %8
%10 = icmp ugt i8 %3, 15
%11 = select i1 %10, i16 4095, i16 %9
ret i16 %11
}
void *FF_CreateSemaphore(void) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @FF_CreateSemaphore() {
ret i8* undef
}
double add_df(double *p, double *q) {
  double d1 = *p;
  double d2 = *q;
  __asm__("# reg %x0, %x1" : "+v"(d1), "+v"(d2));
  return d1 + d2;
}


x86 assembly (clang, -O0):
<add_df>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_df>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add_df(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = load double, double* %7
store double %8, double* %5
%9 = load double*, double** %4
%10 = load double, double* %9
store double %10, double* %6
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call { double, double } asm "# reg ${0:x}, ${1:x}", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(double %11, double %12)
%14 = extractvalue { double, double } %13, 0
%15 = extractvalue { double, double } %13, 1
store double %14, double* %5
store double %15, double* %6
%16 = load double, double* %5
%17 = load double, double* %6
%18 = fadd double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @add_df(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call { double, double } asm "# reg ${0:x}, ${1:x}", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(double %3, double %4)
%6 = extractvalue { double, double } %5, 0
%7 = extractvalue { double, double } %5, 1
%8 = fadd double %6, %7
ret double %8
}
/* Variables and functions */
unsigned int bitswap(unsigned int, unsigned int);
void build_bitinverse(unsigned *bitinverse, unsigned size_log2) {
  unsigned i;
  unsigned size = 1 << size_log2;
  for (i = 0; i < size; i++)
    bitinverse[i] = bitswap(i, size_log2);
}


x86 assembly (clang, -O0):
<build_bitinverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1164 <build_bitinverse+0x54>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <bitswap@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <build_bitinverse+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_bitinverse>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbp),%ebx
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <bitswap@plt>
mov    %ebp,%edx
mov    %r15d,%ecx
shr    %cl,%edx
mov    %eax,(%r14,%rbx,4)
add    $0x1,%ebp
test   %edx,%edx
je     1130 <build_bitinverse+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @build_bitinverse(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 1, %7
store i32 %8, i32* %6
store i32 0, i32* %5
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %24
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = call i32 @bitswap(i32 %14, i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %5
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
store i32 %16, i32* %20
br label %21
21: ; preds = %13
%22 = load i32, i32* %5
%23 = add i32 %22, 1
store i32 %23, i32* %5
br label %9
24: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_bitinverse(i32* nocapture writeonly %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %8, %3 ]
%5 = tail call i32 @bitswap(i32 %4, i32 %1)
%6 = zext i32 %4 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %5, i32* %7
%8 = add i32 %4, 1
%9 = lshr i32 %8, %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %3
ret void
}
/* Variables and functions */
int strtol(unsigned char *, int /*<<< orphan*/ *, int);
int ParseStreamTag(unsigned char *arg) { return strtol(arg, NULL, 16); }


x86 assembly (clang, -O0):
<ParseStreamTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParseStreamTag>:
xor    %esi,%esi
mov    $0x10,%edx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i32 @ParseStreamTag(i8* nocapture %0) {
%2 = tail call i32 @strtol(i8* nocapture %0, i32* null, i32 16)
ret i32 %2
}
short ftgeti2(entry, kw)
char *entry;
struct Keyword *kw;
{
  char temp[30];
  if (ftgetc(entry, kw, temp, 30))
    return ((short)atof(temp));
  else
    return ((short)0);
}


x86 assembly (clang, -O0):
<ftgeti2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1040 <ftgetc@plt>
cmp    $0x0,%eax
je     1165 <ftgeti2+0x45>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <atof@plt>
mov    %ax,-0x2(%rbp)
jmp    116b <ftgeti2+0x4b>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftgeti2>:
push   %rbx
sub    $0x20,%rsp
xor    %ebx,%ebx
mov    %rsp,%rdx
mov    $0x1e,%ecx
xor    %eax,%eax
call   1040 <ftgetc@plt>
test   %eax,%eax
je     1146 <ftgeti2+0x26>
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <atof@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.Keyword = type opaque
define signext i16 @ftgeti2(i8* %0, %struct.Keyword* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca %struct.Keyword*
%6 = alloca [30 x i8]
store i8* %0, i8** %4
store %struct.Keyword* %1, %struct.Keyword** %5
%7 = load i8*, i8** %4
%8 = load %struct.Keyword*, %struct.Keyword** %5
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, %struct.Keyword*, i8*, i32, ...) bitcast (i32 (...)* @ftgetc to i32 (i8*, %struct.Keyword*, i8*, i32, ...)*)(i8* %7, %struct.Keyword* %8, i8* %9, i32 30)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %13)
%15 = trunc i32 %14 to i16
store i16 %15, i16* %3
br label %17
16: ; preds = %2
store i16 0, i16* %3
br label %17
17: ; preds = %16, %12
%18 = load i16, i16* %3
ret i16 %18
}

LLVM IR (-O2):
%struct.Keyword = type opaque
define signext i16 @ftgeti2(i8* %0, %struct.Keyword* %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, %struct.Keyword*, i8*, i32, ...) bitcast (i32 (...)* @ftgetc to i32 (i8*, %struct.Keyword*, i8*, i32, ...)*)(i8* %0, %struct.Keyword* %1, i8* %4, i32 30)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @atof to i32 (i8*, ...)*)(i8* %4)
%9 = trunc i32 %8 to i16
br label %10
10: ; preds = %2, %7
%11 = phi i16 [ %9, %7 ], [ 0, %2 ]
ret i16 %11
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
int ensure_file_path(char *file_path) {
  char command[256];
  sprintf(command, "mkdir -p $(dirname %s)", file_path);
  system(command);
}


x86 assembly (clang, -O0):
<ensure_file_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_file_path>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"mkdir -p $(dirname %s)\00"
define i32 @ensure_file_path(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [256 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = call i32 @system(i8* %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [23 x i8] c"mkdir -p $(dirname %s)\00"
define i32 @ensure_file_path(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surface_data(int, char *);
void fgmvwrite_surface_data_(int *nverts, char *nodeids) {
  gmvwrite_surface_data(*nverts, nodeids);
}


x86 assembly (clang, -O0):
<fgmvwrite_surface_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmvwrite_surface_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_surface_data_>:
mov    (%rdi),%edi
jmp    1030 <gmvwrite_surface_data@plt>

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

LLVM IR (-O2):
define void @fgmvwrite_surface_data_(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @gmvwrite_surface_data(i32 %3, i8* %1)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int htonl(int);
int htons(int);
uint64_t htonll(uint64_t x) {
  if (htons(1) == 1)
    return x;
  uint32_t lo = (x & 0xFFFFFFFF00000000) >> 32;
  uint32_t hi = x & 0x00000000FFFFFFFF;
  uint64_t nlo = htonl(lo);
  uint64_t nhi = htonl(hi);
  return nhi << 32 | nlo;
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <htons@plt>
cmp    $0x1,%eax
jne    1149 <htonll+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <htonll+0x70>
movslq -0x8(%rbp),%rax
movabs $0xffffffff00000000,%rcx
ff ff ff
and    %rcx,%rax
shr    $0x20,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <htons@plt>
cmp    $0x1,%eax
je     1143 <htonll+0x23>
mov    %ebx,%edi
sar    $0x1f,%edi
call   1040 <htonl@plt>
mov    %ebx,%edi
call   1040 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @htonll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
%8 = call i32 @htons(i32 1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %28
12: ; preds = %1
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = and i64 %14, -4294967296
%16 = lshr i64 %15, 32
%17 = trunc i64 %16 to i32
store i32 %17, i32* %4
%18 = load i32, i32* %3
%19 = and i32 %18, -1
store i32 %19, i32* %5
%20 = load i32, i32* %4
%21 = call i32 @htonl(i32 %20)
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = call i32 @htonl(i32 %22)
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = shl i32 %24, 32
%26 = load i32, i32* %6
%27 = or i32 %25, %26
store i32 %27, i32* %2
br label %28
28: ; preds = %12, %10
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @htonll(i32 returned %0) {
%2 = tail call i32 @htons(i32 1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = ashr i32 %0, 31
%6 = tail call i32 @htonl(i32 %5)
%7 = tail call i32 @htonl(i32 %0)
br label %8
8: ; preds = %1, %4
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ S_IRGRP;
int /*<<< orphan*/ S_IROTH;
int /*<<< orphan*/ S_IRUSR;
int _is_file_rwx(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                 int /*<<< orphan*/);
int _is_file_readable(char *pathname) {
  return _is_file_rwx(pathname, S_IRUSR, S_IRGRP, S_IROTH);
}


x86 assembly (clang, -O0):
<_is_file_readable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
mov    0x2e9f(%rip),%rax
mov    (%rax),%ecx
call   1030 <_is_file_rwx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_file_readable>:
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <_is_file_rwx@plt>

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @_is_file_readable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRUSR
%5 = load i32, i32* @S_IRGRP
%6 = load i32, i32* @S_IROTH
%7 = call i32 @_is_file_rwx(i8* %3, i32 %4, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
define i32 @_is_file_readable(i8* %0) {
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IRGRP
%4 = load i32, i32* @S_IROTH
%5 = tail call i32 @_is_file_rwx(i8* %0, i32 %2, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int recv(int, void *, int, int);
int recibeXtra(int sockConexion, void *datos, int numDatos, int xtra) {
  int rc = recv(sockConexion, datos, numDatos, xtra);
  return rc;
}


x86 assembly (clang, -O0):
<recibeXtra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <recv@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recibeXtra>:
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @recibeXtra(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @recv(i32 %10, i8* %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @recibeXtra(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
char *getenv(char *);
const char *pts_get_tmpdir(void) {
  const char *tmpdir_env;
  tmpdir_env = getenv("TMPDIR");
  return tmpdir_env ? tmpdir_env : "/tmp";
}


x86 assembly (clang, -O0):
<pts_get_tmpdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <pts_get_tmpdir+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <pts_get_tmpdir+0x40>
lea    0xec0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1150 <pts_get_tmpdir+0x40>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pts_get_tmpdir>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"TMPDIR\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @pts_get_tmpdir() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8*, i8** %1
br label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"TMPDIR\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i8* @pts_get_tmpdir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
void g_key_file_get_string() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_get_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_cst();
void test_return_cst() { return_cst(); }


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

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

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

LLVM IR (-O2):
define void @test_return_cst() {
%1 = tail call i32 (...) @return_cst()
ret void
}
/* Variables and functions */
unsigned long long UINT_MAX;
unsigned long long str2ull(char const *);
size_t wet_str2size(const char *s) {
  size_t ret;
  unsigned long long n;
  n = str2ull(s);
  if (n > UINT_MAX)
    ret = UINT_MAX;
  else
    ret = (size_t)n;
  return ret;
}


x86 assembly (clang, -O0):
<wet_str2size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str2ull@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2eb4(%rip),%rcx
cmp    (%rcx),%rax
jbe    1150 <wet_str2size+0x40>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1158 <wet_str2size+0x48>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wet_str2size>:
push   %rax
call   1030 <str2ull@plt>
mov    0x2ecb(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rcx,%rax
cmova  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@UINT_MAX = global i64 0
define i64 @wet_str2size(i8* %0) {
%2 = tail call i64 @str2ull(i8* %0)
%3 = load i64, i64* @UINT_MAX
%4 = icmp ugt i64 %2, %3
%5 = select i1 %4, i64 %3, i64 %2
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char const *);
void send_status(FILE *client, int code, const char *reason_phrase) {
  fprintf(client, "HTTP/1.1 %d %s\r\n", code, reason_phrase);
}


x86 assembly (clang, -O0):
<send_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_status>:
mov    %rdx,%rcx
mov    %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"HTTP/1.1 %d %s\0D\0A\00"
define void @send_status(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"HTTP/1.1 %d %s\0D\0A\00"
define void @send_status(i32* nocapture %0, i32 %1, i8* %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2)
ret void
}
/* Type definitions */
struct bitstream_elmt_t {
  int dummy;
};

/* Variables and functions */
unsigned int _read_bits(struct bitstream_elmt_t *, int, int /*<<< orphan*/);
unsigned int bitstream_peak(struct bitstream_elmt_t *bs, int bits) {
  unsigned int value;
  value = _read_bits(bs, bits, 0);
  return value;
}


x86 assembly (clang, -O0):
<bitstream_peak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <_read_bits@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitstream_peak>:
xor    %edx,%edx
jmp    1030 <_read_bits@plt>

LLVM IR (-O0):
%struct.bitstream_elmt_t = type { i32 }
define i32 @bitstream_peak(%struct.bitstream_elmt_t* %0, i32 %1) {
%3 = alloca %struct.bitstream_elmt_t*
%4 = alloca i32
%5 = alloca i32
store %struct.bitstream_elmt_t* %0, %struct.bitstream_elmt_t** %3
store i32 %1, i32* %4
%6 = load %struct.bitstream_elmt_t*, %struct.bitstream_elmt_t** %3
%7 = load i32, i32* %4
%8 = call i32 @_read_bits(%struct.bitstream_elmt_t* %6, i32 %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.bitstream_elmt_t = type { i32 }
define i32 @bitstream_peak(%struct.bitstream_elmt_t* %0, i32 %1) {
%3 = tail call i32 @_read_bits(%struct.bitstream_elmt_t* %0, i32 %1, i32 0)
ret i32 %3
}
int fun556() { return 556; }


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

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

LLVM IR (-O0):
define i32 @fun556() {
ret i32 556
}

LLVM IR (-O2):
define i32 @fun556() {
ret i32 556
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void printBit(FILE *fp, int n) {
  int i;
  for (i = 31; i >= 0; i--) {
    int b = (n >> i) & 0x1;
    fprintf(fp, "%d", b);
  }
}


x86 assembly (clang, -O0):
<printBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1f,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     115f <printBit+0x4f>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printBit+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBit>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x1f,%ebp
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r14d,%edx
mov    %ebp,%ecx
shr    %cl,%edx
and    $0x1,%edx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0xffffffff,%ebp
jb     1130 <printBit+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @printBit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 31, i32* %5
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = ashr i32 %11, %12
%14 = and i32 %13, 1
store i32 %14, i32* %6
%15 = load i32*, i32** %3
%16 = load i32, i32* %6
%17 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printBit(i32* nocapture %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 31, %2 ], [ %8, %3 ]
%5 = lshr i32 %1, %4
%6 = and i32 %5, 1
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nsw i32 %4, -1
%9 = icmp eq i32 %4, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
int is_digit(int c) { return c >= 48 && c <= 57; }


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

x86 assembly (clang, -O2):
<is_digit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_digit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void doasm(asmtype) int asmtype;
{ puttoken(asmtype ? "#asm" : "#endasm"); }


x86 assembly (clang, -O0):
<doasm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee0(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <puttoken@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doasm>:
test   %edi,%edi
lea    0xeec(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
jmp    1030 <puttoken@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"#asm\00"
@.str.1 = [8 x i8] c"#endasm\00"
define void @doasm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puttoken to i32 (i8*, ...)*)(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"#asm\00"
@.str.1 = [8 x i8] c"#endasm\00"
define void @doasm(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puttoken to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char const *, char const *, char const *);
int /*<<< orphan*/ xexit(int);
void fatal(const char *s1, const char *s2, const char *s3) {
  error(s1, s2, s3);
  xexit(1);
}


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

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <error@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <xexit@plt>

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

LLVM IR (-O2):
define void @fatal(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @error(i8* %0, i8* %1, i8* %2)
%5 = tail call i32 @xexit(i32 1)
ret void
}
int indexOf(char needle, char *hayStack) {
  char *iter = hayStack;
  int index = 0;
  while (*iter) {
    if (*iter == needle) {
      return index;
    }
    index++;
    iter++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<indexOf>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <indexOf+0x62>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <indexOf+0x48>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <indexOf+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <indexOf+0x1d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexOf>:
mov    (%rsi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <indexOf+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,%dl
je     1123 <indexOf+0x23>
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <indexOf+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @indexOf(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %13, %10 ], [ %3, %2 ]
%7 = phi i32 [ %11, %10 ], [ 0, %2 ]
%8 = phi i8* [ %12, %10 ], [ %1, %2 ]
%9 = icmp eq i8 %6, %0
br i1 %9, label %15, label %10
10: ; preds = %5
%11 = add nuw nsw i32 %7, 1
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %10, %2
%16 = phi i32 [ -1, %2 ], [ -1, %10 ], [ %7, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned int const);
int /*<<< orphan*/ release_global_memory();
void graceful_exit(const unsigned int exit_code) {
  release_global_memory();
  exit(exit_code);
}


x86 assembly (clang, -O0):
<graceful_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <release_global_memory@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<graceful_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <release_global_memory@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @graceful_exit(i32 %0) {
%2 = tail call i32 (...) @release_global_memory()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void leds_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @leds_deinit() {
ret void
}
void set_bit(int nr, volatile void *addr) {
  int mask;
  volatile int *a = addr;
  a += nr >> 5;
  mask = 1 << (nr & 0x1f);
  *a |= mask;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x5,%eax
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %edx,(%rsi,%rax,4)
ret

LLVM IR (-O0):
define void @set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %6
%9 = load i32, i32* %3
%10 = ashr i32 %9, 5
%11 = load i32*, i32** %6
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i32, i32* %11, i64 %12
store i32* %13, i32** %6
%14 = load i32, i32* %3
%15 = and i32 %14, 31
%16 = shl i32 1, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i32*, i32** %6
%19 = load volatile i32, i32* %18
%20 = or i32 %19, %17
store volatile i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @set_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 5
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %3, i64 %5
%7 = and i32 %0, 31
%8 = shl nuw i32 1, %7
%9 = load volatile i32, i32* %6
%10 = or i32 %9, %8
store volatile i32 %10, i32* %6
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double calc_cpu_time(struct timeval *tvp) {
  return ((double)tvp->tv_sec + (double)tvp->tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<calc_cpu_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_cpu_time>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @calc_cpu_time(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %6, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @calc_cpu_time(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %8, %4
ret double %9
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int compose_linear(uint16_t width, uint16_t height, int i, int j) {
  return (j * width + i);
}


x86 assembly (clang, -O0):
<compose_linear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compose_linear>:
imul   %ecx,%edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @compose_linear(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @compose_linear(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %0
%6 = add nsw i32 %5, %2
ret i32 %6
}