xunge/DecIR huggingface dataset:
int foo() {
  volatile int *p;
  volatile int x;
  p = &x;
  *p = 3;
  return *p + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x3,-0x4(%rsp)
mov    -0x4(%rsp),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32*
%2 = alloca i32
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store volatile i32 3, i32* %3
%4 = load i32*, i32** %1
%5 = load volatile i32, i32* %4
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 3, i32* %1
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, 1
ret i32 %4
}
void VMSetError(void) {}


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

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

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

LLVM IR (-O2):
define void @VMSetError() {
ret void
}
int ptls_bcrypt_init() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @ptls_bcrypt_init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ counting_sort(int *, int);
int /*<<< orphan*/ dump(int *, int);
void counting_sort_test() {
  int test_data[10] = {3, 23, 98, 1, 27, 36, 52, 89, 76, 44};
  counting_sort(test_data, 10);
  dump(test_data, 10);
}


x86 assembly (clang, -O0):
<counting_sort_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <counting_sort@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <dump@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counting_sort_test>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <counting_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <dump@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.counting_sort_test.test_data = [10 x i32] [i32 3, i32 23, i32 98, i32 1, i32 27, i32 36, i32 52, i32 89, i32 76, i32 44]
define void @counting_sort_test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @counting_sort(i32* %3, i32 10)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @dump(i32* %5, i32 10)
ret void
}

LLVM IR (-O2):
@__const.counting_sort_test.test_data = [10 x i32] [i32 3, i32 23, i32 98, i32 1, i32 27, i32 36, i32 52, i32 89, i32 76, i32 44]
define void @counting_sort_test() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @counting_sort(i32* %3, i32 10)
%5 = call i32 @dump(i32* %3, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sla_galsup_(double *, double *, double *, double *);
void slaGalsup(double dl, double db, double *dsl, double *dsb) {
  double DL;
  double DB;
  double DSL;
  double DSB;
  DL = dl;
  DB = db;
  sla_galsup_(&DL, &DB, &DSL, &DSB);
  *dsl = DSL;
  *dsb = DSB;
}


x86 assembly (clang, -O0):
<slaGalsup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1030 <sla_galsup_@plt>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaGalsup>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <sla_galsup_@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @slaGalsup(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%13 = load double, double* %5
store double %13, double* %9
%14 = load double, double* %6
store double %14, double* %10
%15 = call i32 @sla_galsup_(double* %9, double* %10, double* %11, double* %12)
%16 = load double, double* %11
%17 = load double*, double** %7
store double %16, double* %17
%18 = load double, double* %12
%19 = load double*, double** %8
store double %18, double* %19
ret void
}

LLVM IR (-O2):
define void @slaGalsup(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
store double %0, double* %5
store double %1, double* %6
%13 = call i32 @sla_galsup_(double* %5, double* %6, double* %7, double* %8)
%14 = load double, double* %7
store double %14, double* %2
%15 = load double, double* %8
store double %15, double* %3
ret void
}
void test13(int x) {
  struct X {
    int a;
    int b : 10;
    int c;
  };
  struct X y = {.c = x};
}


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ax
and    $0xfc00,%ax
or     $0x0,%ax
mov    %ax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.X = type { i32, i16, i32 }
define void @test13(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.X
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.X, %struct.X* %3, i32 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.X, %struct.X* %3, i32 0, i32 1
%6 = load i16, i16* %5
%7 = and i16 %6, -1024
%8 = or i16 %7, 0
store i16 %8, i16* %5
%9 = getelementptr inbounds %struct.X, %struct.X* %3, i32 0, i32 2
%10 = load i32, i32* %2
store i32 %10, i32* %9
ret void
}

LLVM IR (-O2):
define void @test13(i32 %0) {
ret void
}
void __attribute__((__warning__(
    "curl_easy_getinfo expects a pointer to curl_off_t for this info")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_getinfo_err_curl_off_t(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_getinfo_err_curl_off_t() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
double maxs(double f1, double f2, double df) {
  double mins(double f1, double f2, double df);
  return (-mins(-f1, -f2, df));
}


x86 assembly (clang, -O0):
<maxs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <mins@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxs>:
push   %rax
movaps 0xee8(%rip),%xmm3
xorps  %xmm3,%xmm0
xorps  %xmm3,%xmm1
call   1030 <mins@plt>
xorps  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @maxs(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fneg double %7
%9 = load double, double* %5
%10 = fneg double %9
%11 = load double, double* %6
%12 = call double @mins(double %8, double %10, double %11)
%13 = fneg double %12
ret double %13
}

LLVM IR (-O2):
define double @maxs(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = fneg double %1
%6 = tail call double @mins(double %4, double %5, double %2)
%7 = fneg double %6
ret double %7
}
int __ev_ri2_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_ri2_changed() {
ret i32 0
}
int eg_val(int val) {
  union {
    unsigned short u;
    short s;
  } eg = {(unsigned short)((unsigned)(val + 0x8000) >> 16)};
  return eg.s;
}


x86 assembly (clang, -O0):
<eg_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8000,%eax
shr    $0x10,%eax
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_val>:
lea    0x8000(%rdi),%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
%union.anon = type { i16 }
define i32 @eg_val(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = bitcast %union.anon* %3 to i16*
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 32768
%7 = lshr i32 %6, 16
%8 = trunc i32 %7 to i16
store i16 %8, i16* %4
%9 = bitcast %union.anon* %3 to i16*
%10 = load i16, i16* %9
%11 = sext i16 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @eg_val(i32 %0) {
%2 = add nsw i32 %0, 32768
%3 = ashr i32 %2, 16
ret i32 %3
}
int cdrom_init(char *name) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @cdrom_init(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
unsigned int sqrt(unsigned int);
bool isPrimeNumber(unsigned int primeNumber) {
  for (unsigned int i = 2; i < sqrt(primeNumber); i++) {
    if (primeNumber % i == 0)
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<isPrimeNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jae    116d <isPrimeNumber+0x5d>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    115a <isPrimeNumber+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1174 <isPrimeNumber+0x64>
jmp    115f <isPrimeNumber+0x4f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <isPrimeNumber+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrimeNumber>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <sqrt@plt>
cmp    $0x3,%eax
jb     114a <isPrimeNumber+0x3a>
mov    $0x2,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ecx,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
test   %edx,%edx
je     114f <isPrimeNumber+0x3f>
add    $0x1,%ebp
mov    %ebx,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebp
jb     1130 <isPrimeNumber+0x20>
mov    $0x1,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isPrimeNumber(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 = %17, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @sqrt(i32 %7)
%9 = icmp ult i32 %6, %8
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = urem i32 %11, %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %2
br label %21
16: ; preds = %10
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
store i32 1, i32* %2
br label %21
21: ; preds = %20, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @isPrimeNumber(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp ugt i32 %2, 2
br i1 %3, label %7, label %12
4: ; preds = %7
%5 = tail call i32 @sqrt(i32 %0)
%6 = icmp ult i32 %11, %5
br i1 %6, label %7, label %12
7: ; preds = %1, %4
%8 = phi i32 [ %11, %4 ], [ 2, %1 ]
%9 = urem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw i32 %8, 1
br i1 %10, label %12, label %4
12: ; preds = %4, %7, %1
%13 = phi i32 [ 1, %1 ], [ 0, %7 ], [ 1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *,
                           int);
int /*<<< orphan*/ stderr;
char *strerror(int);
void report_errno(const char *msg, int errnum) {
  fprintf(stderr, "%s: %s (errno=%d)\n", msg, strerror(errnum), errnum);
}


x86 assembly (clang, -O0):
<report_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
mov    -0xc(%rbp),%r8d
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_errno>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2eb0(%rip),%rax
mov    (%rax),%ebp
mov    %esi,%edi
call   1040 <strerror@plt>
lea    0xec0(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %rax,%rcx
mov    %ebx,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"%s: %s (errno=%d)\0A\00"
define void @report_errno(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @strerror(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"%s: %s (errno=%d)\0A\00"
define void @report_errno(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i8* @strerror(i32 %1)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4, i32 %1)
ret void
}
int test_imm_77uint16_reg(unsigned short val) {
  return ((val) & (0x77 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_77uint16_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, 119
%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_77uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 119
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t rfcomm_event_channel_opened_get_server_channel(const uint8_t *event) {
  return event[11];
}


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

x86 assembly (clang, -O2):
<rfcomm_event_channel_opened_get_server_channel>:
mov    0x2c(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @rfcomm_event_channel_opened_get_server_channel(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 11
%3 = load i32, i32* %2
ret i32 %3
}
int hex_to_num(int ch) {
  if (ch >= 'a' && ch <= 'f')
    return ch - 'a' + 10;
  else if (ch >= 'A' && ch <= 'F')
    return ch - 'A' + 10;
  else if (ch >= '0' && ch <= '9')
    return ch - '0';
  else
    return -1;
}


x86 assembly (clang, -O0):
<hex_to_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <hex_to_num+0x2c>
cmpl   $0x66,-0x8(%rbp)
jg     112c <hex_to_num+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex_to_num+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1151 <hex_to_num+0x51>
cmpl   $0x46,-0x8(%rbp)
jg     1151 <hex_to_num+0x51>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex_to_num+0x7a>
cmpl   $0x30,-0x8(%rbp)
jl     1173 <hex_to_num+0x73>
cmpl   $0x39,-0x8(%rbp)
jg     1173 <hex_to_num+0x73>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex_to_num+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_num>:
mov    %edi,%eax
lea    -0x61(%rax),%ecx
cmp    $0x5,%ecx
ja     110e <hex_to_num+0xe>
add    $0xffffffa9,%eax
ret
lea    -0x41(%rax),%ecx
cmp    $0x5,%ecx
ja     111a <hex_to_num+0x1a>
add    $0xffffffc9,%eax
ret
add    $0xffffffd0,%eax
cmp    $0xa,%eax
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hex_to_num(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 102
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = add nsw i32 %11, 10
store i32 %12, i32* %2
br label %33
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 70
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 65
%22 = add nsw i32 %21, 10
store i32 %22, i32* %2
br label %33
23: ; preds = %16, %13
%24 = load i32, i32* %3
%25 = icmp sge i32 %24, 48
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* %3
%28 = icmp sle i32 %27, 57
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* %3
%31 = sub nsw i32 %30, 48
store i32 %31, i32* %2
br label %33
32: ; preds = %26, %23
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %29, %19, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hex_to_num(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nsw i32 %0, -87
br label %15
6: ; preds = %1
%7 = add i32 %0, -65
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = add nsw i32 %0, -55
br label %15
11: ; preds = %6
%12 = add i32 %0, -48
%13 = icmp ult i32 %12, 10
%14 = select i1 %13, i32 %12, i32 -1
br label %15
15: ; preds = %11, %9, %4
%16 = phi i32 [ %5, %4 ], [ %10, %9 ], [ %14, %11 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
main() { int fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @PF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = load i32, i32* @IPPROTO_TCP
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
ret i32 0
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @main() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
ret i32 0
}
void func9(int *ptr1, int *ptr2) {
  if (ptr1 || ptr2) {
    *ptr2 = 100;
    return;
  } else {
    *ptr1 = 200;
    return;
  }
  *ptr1 = 300;
  *ptr2 = 400;
}


x86 assembly (clang, -O0):
<func9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1122 <func9+0x22>
cmpq   $0x0,-0x10(%rbp)
je     1131 <func9+0x31>
mov    -0x10(%rbp),%rax
movl   $0x64,(%rax)
jmp    113b <func9+0x3b>
mov    -0x8(%rbp),%rax
movl   $0xc8,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func9>:
movl   $0x64,(%rsi)
ret

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

LLVM IR (-O2):
define void @func9(i32* readnone %0, i32* writeonly %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i32* %1, null
%5 = or i1 %3, %4
tail call void @llvm.assume(i1 %5)
store i32 100, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
int screenrefresh() {
  refresh();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @screenrefresh() {
%1 = call i32 (...) @refresh()
ret i32 0
}

LLVM IR (-O2):
define i32 @screenrefresh() {
%1 = tail call i32 (...) @refresh()
ret i32 0
}
int compare(const void *number1, const void *number2) {
  if (*(int *)number1 - *(int *)number2 == 0)
    return (*(int *)number1 + 1) - (*(int *)number2 + 1);
  return (*(int *)number1) - (*(int *)number2);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
cmp    $0x0,%eax
jne    113d <compare+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <compare+0x4c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myError() { printf("Wrong arguments!"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Wrong arguments!\00"
define void @myError() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Wrong arguments!\00"
define void @myError() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int max(int x, int y) { return x < y ? y : x; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
char *poller_name();
char *event_loop_poller_name() { return poller_name(); }


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

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

LLVM IR (-O0):
define i8* @event_loop_poller_name() {
%1 = call i8* (...) @poller_name()
ret i8* %1
}

LLVM IR (-O2):
define i8* @event_loop_poller_name() {
%1 = tail call i8* (...) @poller_name()
ret i8* %1
}
int stbir__max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<stbir__max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <stbir__max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <stbir__max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @stbir__max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int /*<<< orphan*/ FE_ALL_EXCEPT;
int /*<<< orphan*/ feraiseexcept(int);
int /*<<< orphan*/ fesetenv(int /*<<< orphan*/ const *);
int fetestexcept(int /*<<< orphan*/);
int feupdateenv(const fenv_t *e) {
  int x = fetestexcept(FE_ALL_EXCEPT);
  fesetenv(e);
  feraiseexcept(x);
  return 0;
}


x86 assembly (clang, -O0):
<feupdateenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <fetestexcept@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <fesetenv@plt>
mov    -0xc(%rbp),%edi
call   1040 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feupdateenv>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1030 <fetestexcept@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <fesetenv@plt>
mov    %ebp,%edi
call   1040 <feraiseexcept@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @feupdateenv(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* @FE_ALL_EXCEPT
%5 = call i32 @fetestexcept(i32 %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @fesetenv(i32* %6)
%8 = load i32, i32* %3
%9 = call i32 @feraiseexcept(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @feupdateenv(i32* %0) {
%2 = load i32, i32* @FE_ALL_EXCEPT
%3 = tail call i32 @fetestexcept(i32 %2)
%4 = tail call i32 @fesetenv(i32* %0)
%5 = tail call i32 @feraiseexcept(i32 %3)
ret i32 0
}
int add_int(int num1, int num2) { return num1 + num2; }


x86 assembly (clang, -O0):
<add_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_int>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_int(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double _atanh(double);
double atanh(double x) { return _atanh(x); }


x86 assembly (clang, -O0):
<atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <_atanh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanh>:
jmp    1030 <_atanh@plt>

LLVM IR (-O0):
define double @atanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @_atanh(double %3)
ret double %4
}

LLVM IR (-O2):
define double @atanh(double %0) {
%2 = tail call double @_atanh(double %0)
ret double %2
}
void speakup_savekey(unsigned char ch) {}


x86 assembly (clang, -O0):
<speakup_savekey>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @speakup_savekey(i8 zeroext %0) {
ret void
}
int parse_line() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @parse_line() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[1024];
  memset(str, 65, 10);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    $0x41,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    -0x410(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 65, i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
int get_XGraphicsExposeEvent_height(void *_p) {
  return (int)((XGraphicsExposeEvent *)_p)->height;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGraphicsExposeEvent_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGraphicsExposeEvent_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doPins(void) {
  printf("The pins command has been deprecated - sorry. Please use the\n");
  printf("  gpio readall\n");
  printf("command to get a list of the pinnouts for your Pi.\n");
}


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

x86 assembly (clang, -O2):
<doPins>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"The pins command has been deprecated - sorry. Please use the\0A\00"
@.str.1 = [16 x i8] c" gpio readall\0A\00"
@.str.2 = [52 x i8] c"command to get a list of the pinnouts for your Pi.\0A\00"
define void @doPins() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"The pins command has been deprecated - sorry. Please use the\00"
@str.3 = [15 x i8] c" gpio readall\00"
@str.4 = [51 x i8] c"command to get a list of the pinnouts for your Pi.\00"
define void @doPins() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.4, i64 0, i64 0))
ret void
}
void emit_nat16(struct processor_explicatory_state *process_state,
                struct modern_stream *stream, void *stream_state,
                struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_nat16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_nat16(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_nat16(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
void X509V3_EXT_REQ_add_nconf(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_REQ_add_nconf() {
ret void
}
char *_dl_strchr(const char *str, int c) {
  register char ch;
  do {
    if ((ch = *str) == c)
      return (char *)str;
    str++;
  } while (ch);
  return 0;
}


x86 assembly (clang, -O0):
<_dl_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x15(%rbp)
movsbl %al,%eax
cmp    -0x14(%rbp),%eax
jne    112d <_dl_strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <_dl_strchr+0x4b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpb   $0x0,-0x15(%rbp)
jne    110b <_dl_strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
cmp    %esi,%ecx
je     1121 <_dl_strchr+0x21>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <_dl_strchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @_dl_strchr(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
br label %7
7: ; preds = %18, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
store i8 %9, i8* %6
%10 = sext i8 %9 to i32
%11 = load i32, i32* %5
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %22
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
br label %18
18: ; preds = %15
%19 = load i8, i8* %6
%20 = icmp ne i8 %19, 0
br i1 %20, label %7, label %21
21: ; preds = %18
store i8* null, i8** %3
br label %22
22: ; preds = %21, %13
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @_dl_strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = icmp eq i8 %5, 0
br i1 %10, label %11, label %3
11: ; preds = %8, %3
%12 = phi i8* [ %4, %3 ], [ null, %8 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ tan(double);
int /*<<< orphan*/ tanf(float);
int /*<<< orphan*/ tanl(long double);
void uninitvar_tan(void) {
  float f;
  (void)tanf(f);
  double d;
  (void)tan(d);
  long double ld;
  (void)tanl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1030 <tanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <tan@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <tanl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_tan>:
sub    $0x18,%rsp
call   1030 <tanf@plt>
call   1050 <tan@plt>
call   1040 <tanl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_tan() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @tanf(float %4)
%6 = load double, double* %2
%7 = call i32 @tan(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @tanl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_tan() {
%1 = tail call i32 @tanf(float undef)
%2 = tail call i32 @tan(double undef)
%3 = tail call i32 @tanl(x86_fp80 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bitmap_clear_bit(unsigned long *, unsigned long);
int bitmap_is_bit_set(unsigned long *, unsigned long);
int bitmap_test_and_clear_bit(unsigned long *bitmap, unsigned long bit) {
  int result;
  result = bitmap_is_bit_set(bitmap, bit);
  bitmap_clear_bit(bitmap, bit);
  return result;
}


x86 assembly (clang, -O0):
<bitmap_test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <bitmap_is_bit_set@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <bitmap_clear_bit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_test_and_clear_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <bitmap_is_bit_set@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <bitmap_clear_bit@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bitmap_test_and_clear_bit(i64* %0, i64 %1) {
%3 = tail call i32 @bitmap_is_bit_set(i64* %0, i64 %1)
%4 = tail call i32 @bitmap_clear_bit(i64* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gpio_high(int, int);
int /*<<< orphan*/ gpio_input(int, int);
int /*<<< orphan*/ gpio_low(int, int);
int /*<<< orphan*/ gpio_output(int, int);
int /*<<< orphan*/ usleep(int);
void c2_reset(void) {
  gpio_input(4, 13);
  gpio_low(4, 11);
  usleep(20);
  gpio_output(4, 11);
  gpio_high(4, 11);
}


x86 assembly (clang, -O0):
<c2_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0xd,%esi
call   1030 <gpio_input@plt>
mov    $0x4,%edi
mov    $0xb,%esi
call   1040 <gpio_low@plt>
mov    $0x14,%edi
call   1070 <usleep@plt>
mov    $0x4,%edi
mov    $0xb,%esi
call   1050 <gpio_output@plt>
mov    $0x4,%edi
mov    $0xb,%esi
call   1060 <gpio_high@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2_reset>:
push   %rax
mov    $0x4,%edi
mov    $0xd,%esi
call   1030 <gpio_input@plt>
mov    $0x4,%edi
mov    $0xb,%esi
call   1040 <gpio_low@plt>
mov    $0x14,%edi
call   1070 <usleep@plt>
mov    $0x4,%edi
mov    $0xb,%esi
call   1050 <gpio_output@plt>
mov    $0x4,%edi
mov    $0xb,%esi
pop    %rax
jmp    1060 <gpio_high@plt>

LLVM IR (-O0):
define void @c2_reset() {
%1 = call i32 @gpio_input(i32 4, i32 13)
%2 = call i32 @gpio_low(i32 4, i32 11)
%3 = call i32 @usleep(i32 20)
%4 = call i32 @gpio_output(i32 4, i32 11)
%5 = call i32 @gpio_high(i32 4, i32 11)
ret void
}

LLVM IR (-O2):
define void @c2_reset() {
%1 = tail call i32 @gpio_input(i32 4, i32 13)
%2 = tail call i32 @gpio_low(i32 4, i32 11)
%3 = tail call i32 @usleep(i32 20)
%4 = tail call i32 @gpio_output(i32 4, i32 11)
%5 = tail call i32 @gpio_high(i32 4, i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void wratchet_display_message(const char *str) {
  printf("Wratchet: %s.\n", str);
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Wratchet: %s.\0A\00"
define void @wratchet_display_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct interface {
  int dummy;
};

/* Variables and functions */
struct interface *add_interface(char *);
scalar_t__ if_readlist_proc(char *);
struct interface *lookup_interface(char *name) {
  struct interface *ife = NULL;
  if (if_readlist_proc(name) < 0)
    return NULL;
  ife = add_interface(name);
  return ife;
}


x86 assembly (clang, -O0):
<lookup_interface>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <if_readlist_proc@plt>
cmp    $0x0,%rax
jge    1154 <lookup_interface+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1169 <lookup_interface+0x49>
mov    -0x10(%rbp),%rdi
call   1040 <add_interface@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_interface>:
push   %rbx
mov    %rdi,%rbx
call   1030 <if_readlist_proc@plt>
test   %rax,%rax
js     1137 <lookup_interface+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <add_interface@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.interface = type { i32 }
define %struct.interface* @lookup_interface(i8* %0) {
%2 = alloca %struct.interface*
%3 = alloca i8*
%4 = alloca %struct.interface*
store i8* %0, i8** %3
store %struct.interface* null, %struct.interface** %4
%5 = load i8*, i8** %3
%6 = call i64 @if_readlist_proc(i8* %5)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store %struct.interface* null, %struct.interface** %2
br label %13
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call %struct.interface* @add_interface(i8* %10)
store %struct.interface* %11, %struct.interface** %4
%12 = load %struct.interface*, %struct.interface** %4
store %struct.interface* %12, %struct.interface** %2
br label %13
13: ; preds = %9, %8
%14 = load %struct.interface*, %struct.interface** %2
ret %struct.interface* %14
}

LLVM IR (-O2):
%struct.interface = type { i32 }
define %struct.interface* @lookup_interface(i8* %0) {
%2 = tail call i64 @if_readlist_proc(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call %struct.interface* @add_interface(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi %struct.interface* [ %5, %4 ], [ null, %1 ]
ret %struct.interface* %7
}