xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Send(int, char *, char *);
void _PING(int sock, char *sender, char *str) { Send(sock, "PONG %s\n", str); }


x86 assembly (clang, -O0):
<_PING>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xecf(%rip),%rsi
call   1030 <Send@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"PONG %s\0A\00"
define void @_PING(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = tail call i32 @Send(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
struct key {
  int dummy;
};

/* Variables and functions */
unsigned long le_key_k_offset(int, struct key *);
int le_key_version(struct key *);
int direct_is_left_mergeable(struct key *key, unsigned long bsize) {
  int version = le_key_version(key);
  return ((le_key_k_offset(version, key) & (bsize - 1)) != 1);
}


x86 assembly (clang, -O0):
<direct_is_left_mergeable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <le_key_version@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <le_key_k_offset@plt>
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x1,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_is_left_mergeable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <le_key_version@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <le_key_k_offset@plt>
add    $0xffffffffffffffff,%rbx
and    %rax,%rbx
xor    %eax,%eax
cmp    $0x1,%rbx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.key = type { i32 }
define i32 @direct_is_left_mergeable(%struct.key* %0, i64 %1) {
%3 = alloca %struct.key*
%4 = alloca i64
%5 = alloca i32
store %struct.key* %0, %struct.key** %3
store i64 %1, i64* %4
%6 = load %struct.key*, %struct.key** %3
%7 = call i32 @le_key_version(%struct.key* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load %struct.key*, %struct.key** %3
%10 = call i64 @le_key_k_offset(i32 %8, %struct.key* %9)
%11 = load i64, i64* %4
%12 = sub i64 %11, 1
%13 = and i64 %10, %12
%14 = icmp ne i64 %13, 1
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.key = type { i32 }
define i32 @direct_is_left_mergeable(%struct.key* %0, i64 %1) {
%3 = tail call i32 @le_key_version(%struct.key* %0)
%4 = tail call i64 @le_key_k_offset(i32 %3, %struct.key* %0)
%5 = add i64 %1, -1
%6 = and i64 %4, %5
%7 = icmp ne i64 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ isdigit(char const);
unsigned int atou(const char *s) {
  unsigned int i = 0;
  while (isdigit(*s)) {
    i = i * 10 + (*s++ - '0');
  }
  return i;
}


x86 assembly (clang, -O0):
<atou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115c <atou+0x4c>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <atou+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atou>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1153 <atou+0x43>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%r14,4),%eax
movsbl -0x1(%rbx),%ecx
lea    (%rcx,%rax,2),%r14d
add    $0xffffffd0,%r14d
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <atou+0x20>
jmp    1156 <atou+0x46>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @atou(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isdigit(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %13, %5 ], [ 0, %1 ]
%7 = phi i8* [ %9, %5 ], [ %0, %1 ]
%8 = mul i32 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = sext i8 %10 to i32
%12 = add i32 %8, -48
%13 = add i32 %12, %11
%14 = load i8, i8* %9
%15 = tail call i64 @isdigit(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
WINDOW *initscr() { return 0; }


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

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

LLVM IR (-O0):
define i32* @initscr() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @initscr() {
ret i32* null
}
int bitcount(unsigned x) {
  int b;
  for (b = 0; x != 0; x &= (x - 1)) {
    b++;
  }
  return b;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

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

/* Variables and functions */
int mutexattr_gettype(int /*<<< orphan*/ const *, int *);
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type) {
  return mutexattr_gettype(attr, type);
}


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

x86 assembly (clang, -O2):
<pthread_mutexattr_gettype>:
jmp    1030 <mutexattr_gettype@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_gettype(i32* %0, i32* %1) {
%3 = tail call i32 @mutexattr_gettype(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glp_assert_(char *, char *, int);
int strcmp(void const *, void const *);
int _glp_avl_strcmp(void *info, const void *key1, const void *key2) {
  ((void)((info == info) ||
          (glp_assert_(
               "info == info",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/PeterWolf-tw/NeoPraat/refs/"
               "heads/develop/external/glpk/glpavl.c",
               43),
           1)));
  return strcmp(key1, key2);
}


x86 assembly (clang, -O0):
<_glp_avl_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
je     1164 <_glp_avl_strcmp+0x44>
lea    0xeb2(%rip),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x2b,%edx
call   1040 <glp_assert_@plt>
mov    $0x1,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glp_avl_strcmp>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"info == info\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/PeterWolf-tw/NeoPraat/refs/heads/develop/external/glpk/glpavl.c\00"
define i32 @_glp_avl_strcmp(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** %4
%9 = icmp eq i8* %7, %8
br i1 %9, label %12, label %10
10: ; preds = %3
%11 = call i32 @glp_assert_(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0), i32 43)
br label %12
12: ; preds = %10, %3
%13 = phi i1 [ true, %3 ], [ true, %10 ]
%14 = zext i1 %13 to i32
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = call i32 @strcmp(i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @_glp_avl_strcmp(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %2)
ret i32 %4
}
int float_to_fixed(float num) {
  int decimal = (int)num << 14;
  int fraction = (1 << 14) * (num - (int)num);
  if ((num - (int)num) >= .5 && (num - (int)num) <= 1.0)
    fraction += 1;
  return decimal + fraction;
}


x86 assembly (clang, -O0):
<float_to_fixed>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
shl    $0xe,%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
subss  %xmm0,%xmm1
movss  0xee2(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1192 <float_to_fixed+0x92>
movss  -0x4(%rbp),%xmm0
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1192 <float_to_fixed+0x92>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_to_fixed>:
cvttss2si %xmm0,%eax
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
subss  %xmm1,%xmm0
movss  0xee9(%rip),%xmm1
mulss  %xmm0,%xmm1
ucomiss 0xee2(%rip),%xmm0
cvttss2si %xmm1,%esi
setae  %dl
movss  0xed7(%rip),%xmm1
ucomiss %xmm0,%xmm1
setae  %cl
and    %dl,%cl
movzbl %cl,%ecx
shl    $0xe,%eax
add    %esi,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @float_to_fixed(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fptosi float %5 to i32
%7 = shl i32 %6, 14
store i32 %7, i32* %3
%8 = load float, float* %2
%9 = load float, float* %2
%10 = fptosi float %9 to i32
%11 = sitofp i32 %10 to float
%12 = fsub float %8, %11
%13 = fmul float 1.638400e+04, %12
%14 = fptosi float %13 to i32
store i32 %14, i32* %4
%15 = load float, float* %2
%16 = load float, float* %2
%17 = fptosi float %16 to i32
%18 = sitofp i32 %17 to float
%19 = fsub float %15, %18
%20 = fpext float %19 to double
%21 = fcmp oge double %20, 5.000000e-01
br i1 %21, label %22, label %33
22: ; preds = %1
%23 = load float, float* %2
%24 = load float, float* %2
%25 = fptosi float %24 to i32
%26 = sitofp i32 %25 to float
%27 = fsub float %23, %26
%28 = fpext float %27 to double
%29 = fcmp ole double %28, 1.000000e+00
br i1 %29, label %30, label %33
30: ; preds = %22
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %33
33: ; preds = %30, %22, %1
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = add nsw i32 %34, %35
ret i32 %36
}

LLVM IR (-O2):
define i32 @float_to_fixed(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fsub float %0, %3
%5 = fmul float %4, 1.638400e+04
%6 = fptosi float %5 to i32
%7 = fcmp oge float %4, 5.000000e-01
%8 = fcmp ole float %4, 1.000000e+00
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
%11 = shl i32 %2, 14
%12 = add i32 %11, %6
%13 = add i32 %12, %10
ret i32 %13
}
long double __add_func(long double d1, long double d2) { return d1 + d2; }


x86 assembly (clang, -O0):
<__add_func>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__add_func>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
faddp  %st,%st(1)
ret

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

LLVM IR (-O2):
define x86_fp80 @__add_func(x86_fp80 %0, x86_fp80 %1) {
%3 = fadd x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_at_be8(void *, int, int);
int /*<<< orphan*/ write_be8(void *, int);
void write_be16(void *dest, uint16_t val) {
  write_be8(dest, val >> 8);
  write_at_be8(dest, val >> 0, sizeof(uint8_t));
}


x86 assembly (clang, -O0):
<write_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
call   1040 <write_be8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x0,%esi
mov    $0x4,%edx
call   1030 <write_at_be8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_be16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
sar    $0x8,%esi
call   1040 <write_be8@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write_at_be8@plt>

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

LLVM IR (-O2):
define void @write_be16(i8* %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = tail call i32 @write_be8(i8* %0, i32 %3)
%5 = tail call i32 @write_at_be8(i8* %0, i32 %1, i32 4)
ret void
}
int ijs_get_int(const char *p) {
  const unsigned char *up = (const unsigned char *)p;
  return (up[0] << 24) | (up[1] << 16) | (up[2] << 8) | up[3];
}


x86 assembly (clang, -O0):
<ijs_get_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ijs_get_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int test_imm_94int16_reg(short val) {
  return ((val) & (-0x94 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_94int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -148
%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_94int16_reg(i16 signext %0) {
%2 = and i16 %0, -148
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void zrtol(name, name2) char *name, *name2;
{ nzrtol(name, name2, 1, 0, 255); }


x86 assembly (clang, -O0):
<zrtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
mov    $0x0,%al
call   1030 <nzrtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zrtol>:
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
xor    %eax,%eax
jmp    1030 <nzrtol@plt>

LLVM IR (-O0):
define void @zrtol(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, i32, i32, i32, ...) bitcast (i32 (...)* @nzrtol to i32 (i8*, i8*, i32, i32, i32, ...)*)(i8* %5, i8* %6, i32 1, i32 0, i32 255)
ret void
}

LLVM IR (-O2):
define void @zrtol(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, i32, i32, ...) bitcast (i32 (...)* @nzrtol to i32 (i8*, i8*, i32, i32, i32, ...)*)(i8* %0, i8* %1, i32 1, i32 0, i32 255)
ret void
}
void f1(_Bool b) {
  switch (b) {
  case 3:
    break;
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%al
test   %al,%al
jne    1120 <f1+0x20>
jmp    111b <f1+0x1b>
jmp    1120 <f1+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1(i1 zeroext %0) {
%2 = alloca i8
%3 = zext i1 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = trunc i8 %4 to i1
%6 = zext i1 %5 to i32
switch i32 %6, label %8 [
i32 3, label %7
]
7: ; preds = %1
br label %8
8: ; preds = %1, %7
ret void
}

LLVM IR (-O2):
define void @f1(i1 zeroext %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int ssize_t;

/* Variables and functions */
int recvfrom(int, int /*<<< orphan*/ *, size_t, int, int /*<<< orphan*/,
             int /*<<< orphan*/);
int /*<<< orphan*/ settimer(int);
ssize_t timerd_read(int s, u_char *buf, size_t len, int sec, int flags) {
  ssize_t r = -1;
  settimer(sec);
  r = recvfrom(s, buf, len, flags, 0, 0);
  settimer(0);
  return (r);
}


x86 assembly (clang, -O0):
<timerd_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <settimer@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1040 <recvfrom@plt>
mov    %eax,-0x24(%rbp)
xor    %edi,%edi
call   1030 <settimer@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerd_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
mov    %ecx,%edi
call   1030 <settimer@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <recvfrom@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1030 <settimer@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @timerd_read(i32 %0, i32* %1, i64 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 -1, i32* %11
%12 = load i32, i32* %9
%13 = call i32 @settimer(i32 %12)
%14 = load i32, i32* %6
%15 = load i32*, i32** %7
%16 = load i64, i64* %8
%17 = load i32, i32* %10
%18 = call i32 @recvfrom(i32 %14, i32* %15, i64 %16, i32 %17, i32 0, i32 0)
store i32 %18, i32* %11
%19 = call i32 @settimer(i32 0)
%20 = load i32, i32* %11
ret i32 %20
}

LLVM IR (-O2):
define i32 @timerd_read(i32 %0, i32* %1, i64 %2, i32 %3, i32 %4) {
%6 = tail call i32 @settimer(i32 %3)
%7 = tail call i32 @recvfrom(i32 %0, i32* %1, i64 %2, i32 %4, i32 0, i32 0)
%8 = tail call i32 @settimer(i32 0)
ret i32 %7
}
/* Variables and functions */
int add(int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int i = 2, j;
  j = add(++i);
  printf("i = %d j = %d\n", i, j);
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"i = %d j = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 3, i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t cigar_int_to_len(uint32_t cigar_int) {
  uint32_t res = cigar_int >> 4;
  return res;
}


x86 assembly (clang, -O0):
<cigar_int_to_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cigar_int_to_len(i32 %0) {
%2 = ashr i32 %0, 4
ret i32 %2
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int add_int_data(struct buffer *, int, unsigned int);
int add_txspeed_avp(struct buffer *buf, unsigned int speed) {
  return add_int_data(buf, 24, speed);
}


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

x86 assembly (clang, -O2):
<add_txspeed_avp>:
mov    %esi,%edx
mov    $0x18,%esi
jmp    1030 <add_int_data@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @add_txspeed_avp(%struct.buffer* %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @add_int_data(%struct.buffer* %5, i32 24, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_txspeed_avp(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @add_int_data(%struct.buffer* %0, i32 24, i32 %1)
ret i32 %3
}
void crypto_hmac_update(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<crypto_hmac_update>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_hmac_update>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.crypto_hmac_update = [19 x i8] c"crypto_hmac_update\00"
define void @crypto_hmac_update() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.crypto_hmac_update, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.crypto_hmac_update = [19 x i8] c"crypto_hmac_update\00"
define void @crypto_hmac_update() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.crypto_hmac_update, i64 0, i64 0))
ret void
}
void pullphone(char *dn, char *str) {
  int i = 0;
  while (dn[i] != ',')
    str[i] = dn[i++];
  str[i] = 0x0;
}


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

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

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

LLVM IR (-O2):
define void @pullphone(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 44
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = add nuw nsw i64 %6, 1
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 %7, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 44
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %8, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t btoh_u16(uint16_t bigval) {
  union {
    uint16_t s;
    uint8_t b[2];
  } u1, u2;
  u1.s = bigval;
  u2.b[0] = u1.b[1];
  u2.b[1] = u1.b[0];
  return u2.s;
}


x86 assembly (clang, -O0):
<btoh_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define i32 @btoh_u16(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca %union.anon
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to [2 x i32]*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%9 = load i32, i32* %8
%10 = bitcast %union.anon* %4 to [2 x i32]*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
store i32 %9, i32* %11
%12 = bitcast %union.anon* %3 to [2 x i32]*
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%14 = load i32, i32* %13
%15 = bitcast %union.anon* %4 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
store i32 %14, i32* %16
%17 = bitcast %union.anon* %4 to i32*
%18 = load i32, i32* %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @btoh_u16(i32 %0) {
ret i32 undef
}
void aufs_inotify_destroy(struct inotify_watch *watch) { return; }


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

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

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

LLVM IR (-O2):
%struct.inotify_watch = type opaque
define void @aufs_inotify_destroy(%struct.inotify_watch* nocapture %0) {
ret void
}
void uartPutc(unsigned char ch) {
  while (1) {
    if (((*(volatile unsigned int *)(0x7F005010)) & 6) == 6)
      break;
  }
  (*(volatile unsigned int *)(0x7F005020)) = ch;
  return;
}


x86 assembly (clang, -O0):
<uartPutc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005010,%eax
mov    (%rax),%eax
and    $0x6,%eax
cmp    $0x6,%eax
jne    1122 <uartPutc+0x22>
jmp    1127 <uartPutc+0x27>
jmp    110a <uartPutc+0xa>
movzbl -0x1(%rbp),%ecx
mov    $0x7f005020,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uartPutc>:
mov    0x7f005010,%eax
not    %eax
test   $0x6,%al
jne    1100 <uartPutc>
movzbl %dil,%eax
mov    %eax,0x7f005020
ret

LLVM IR (-O0):
define void @uartPutc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %1, %8
%4 = load volatile i32, i32* inttoptr (i64 2130726928 to i32*)
%5 = and i32 %4, 6
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
store volatile i32 %11, i32* inttoptr (i64 2130726944 to i32*)
ret void
}

LLVM IR (-O2):
define void @uartPutc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 2130726928 to i32*)
%4 = and i32 %3, 6
%5 = icmp eq i32 %4, 6
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = zext i8 %0 to i32
store volatile i32 %7, i32* inttoptr (i64 2130726944 to i32*)
ret void
}
/* Variables and functions */
char *sm_request_pgp_id(const char *text) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @sm_request_pgp_id(i8* nocapture readnone %0) {
ret i8* null
}
void stringPutChar(void *p, char c) { *(*((char **)p))++ = c; }


x86 assembly (clang, -O0):
<stringPutChar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringPutChar>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define void @stringPutChar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %7
store i8 %5, i8* %8
ret void
}

LLVM IR (-O2):
define void @stringPutChar(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %3
store i8 %1, i8* %4
ret void
}
double umrechnung_euro_in_us_dollar(double betrag_in_euro,
                                    double umrechnungsfaktor) {
  double betrag_in_us_dollar = umrechnungsfaktor * betrag_in_euro;
  return betrag_in_us_dollar;
}


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

x86 assembly (clang, -O2):
<umrechnung_euro_in_us_dollar>:
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @umrechnung_euro_in_us_dollar(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
void display_set_pixel(unsigned int x, unsigned int y, unsigned int color) {
  volatile unsigned int *pixel =
      ((void *)((char *)(0x040000c0 << 2) + (0x00000100 << 2)));
  if (x < 640 && y < 480) {
    pixel[x + (y * 640)] = color;
  }
}


x86 assembly (clang, -O0):
<display_set_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x10000300,%eax
add    $0x400,%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x280,-0x4(%rbp)
jae    114e <display_set_pixel+0x4e>
cmpl   $0x1e0,-0x8(%rbp)
jae    114e <display_set_pixel+0x4e>
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   $0x280,-0x8(%rbp),%esi
add    %esi,%ecx
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_set_pixel>:
cmp    $0x27f,%edi
ja     111f <display_set_pixel+0x1f>
cmp    $0x1df,%esi
ja     111f <display_set_pixel+0x1f>
lea    (%rsi,%rsi,4),%eax
shl    $0x7,%eax
add    %edi,%eax
mov    %edx,0x10000700(,%rax,4)
ret

LLVM IR (-O0):
define void @display_set_pixel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32* bitcast (i8* getelementptr inbounds (i8, i8* inttoptr (i64 268436224 to i8*), i64 1024) to i32*), i32** %7
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 640
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp ult i32 %11, 480
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32, i32* %6
%15 = load i32*, i32** %7
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = mul i32 %17, 640
%19 = add i32 %16, %18
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %15, i64 %20
store volatile i32 %14, i32* %21
br label %22
22: ; preds = %13, %10, %3
ret void
}

LLVM IR (-O2):
define void @display_set_pixel(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, 640
%5 = icmp ult i32 %1, 480
%6 = and i1 %4, %5
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = mul nuw nsw i32 %1, 640
%9 = add nuw nsw i32 %8, %0
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 268437248 to i32*), i64 %10
store volatile i32 %2, i32* %11
br label %12
12: ; preds = %7, %3
ret void
}
int ft_isalnum(int c) {
  if ((c > 47 && c < 58) || (c > 64 && c < 91) || (c > 96 && c < 123))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2f,-0x8(%rbp)
jle    111b <ft_isalnum+0x1b>
cmpl   $0x3a,-0x8(%rbp)
jl     1143 <ft_isalnum+0x43>
cmpl   $0x40,-0x8(%rbp)
jle    112f <ft_isalnum+0x2f>
cmpl   $0x5b,-0x8(%rbp)
jl     1143 <ft_isalnum+0x43>
cmpl   $0x60,-0x8(%rbp)
jle    114f <ft_isalnum+0x4f>
cmpl   $0x7b,-0x8(%rbp)
jge    114f <ft_isalnum+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_isalnum+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 47
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 58
br i1 %8, label %21, label %9
9: ; preds = %6, %1
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 64
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 91
br i1 %14, label %21, label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 96
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 123
br i1 %20, label %21, label %22
21: ; preds = %18, %12, %6
store i32 1, i32* %2
br label %23
22: ; preds = %18, %15
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__7__GeneralIO__set();
void LedsP__Led0__set(void) { Msp430GpioC__7__GeneralIO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led0__set() {
%1 = tail call i32 (...) @Msp430GpioC__7__GeneralIO__set()
ret void
}
void test_one(int x) {
#pragma omp target teams distribute
  for (int i = 0; i < x; i++)
    ;
}


x86 assembly (clang, -O0):
<test_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <test_one+0x2d>
jmp    111f <test_one+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <test_one+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_one(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void local_action() {
  printf("Local action\n");
  sleep(1);
}


x86 assembly (clang, -O0):
<local_action>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_action>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Local action\0A\00"
define void @local_action() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Local action\00"
define void @local_action() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
double pow(double, double);
double vaporPressureIce(double t) { return (pow(10.0, -2663.5 / t + 12.537)); }


x86 assembly (clang, -O0):
<vaporPressureIce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vaporPressureIce>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @vaporPressureIce(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double -2.663500e+03, %3
%5 = fadd double %4, 1.253700e+01
%6 = call double @pow(double 1.000000e+01, double %5)
ret double %6
}

LLVM IR (-O2):
define double @vaporPressureIce(double %0) {
%2 = fdiv double 2.663500e+03, %0
%3 = fsub double 1.253700e+01, %2
%4 = tail call double @pow(double 1.000000e+01, double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int rdataerror(const char *s) {
  printf("%s¥n", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<rdataerror>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s\C2\A5n\00"
define i32 @rdataerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
double fabs(double);
uint8_t f64_nearly_equal(double a, double b, double margin) {
  return ((fabs((a - b)) < margin));
}


x86 assembly (clang, -O0):
<f64_nearly_equal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xedc(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f64_nearly_equal>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @f64_nearly_equal(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 = load double, double* %5
%9 = fsub double %7, %8
%10 = call double @llvm.fabs.f64(double %9)
%11 = load double, double* %6
%12 = fcmp olt double %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @f64_nearly_equal(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp olt double %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}