xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isxdigit(char);
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int hexlen(const char *str) {
  unsigned int sum = 0;
  while (1) {
    char chh = *str;
    if (!isxdigit(chh))
      break;
    str++;
    sum++;
  }
  do {
    if (0)
      printf("LEN: %x\n", sum);
  } while (0);
  return (sum);
}


x86 assembly (clang, -O0):
<hexlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%eax
jne    1143 <hexlen+0x33>
jmp    115d <hexlen+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hexlen+0x13>
jmp    1162 <hexlen+0x52>
jmp    1167 <hexlen+0x57>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexlen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isxdigit@plt>
add    $0x1,%rbx
add    $0x1,%ebp
test   %eax,%eax
jne    1120 <hexlen+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hexlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = phi i8* [ %0, %1 ], [ %8, %2 ]
%5 = load i8, i8* %4
%6 = tail call i32 @isxdigit(i8 signext %5)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = add i32 %3, 1
br i1 %7, label %10, label %2
10: ; preds = %2
ret i32 %3
}
unsigned np(unsigned v) {
  --v;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  ++v;
  return v;
}


x86 assembly (clang, -O0):
<np>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<np>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
shr    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @np(i32 %0) {
%2 = add i32 %0, -1
%3 = lshr i32 %2, 1
%4 = or i32 %3, %2
%5 = lshr i32 %4, 2
%6 = or i32 %5, %4
%7 = lshr i32 %6, 4
%8 = or i32 %7, %6
%9 = lshr i32 %8, 8
%10 = or i32 %9, %8
%11 = lshr i32 %10, 16
%12 = or i32 %11, %10
%13 = add i32 %12, 1
ret i32 %13
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int get_value_of_continuation_parameter(int k, double *val) {
  int *b, fail;
  fail = _ada_use_c2phc(189, &k, b, val, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @get_value_of_continuation_parameter(i32 %0, double* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 189, i32* %3, i32* undef, double* %1, i32 0)
ret i32 %4
}
void swap_pos(int *array, int pos1, int pos2) {
  int tmp = array[pos1];
  array[pos1] = array[pos2];
  array[pos2] = tmp;
}


x86 assembly (clang, -O0):
<swap_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_pos>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap_pos(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
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap_pos(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int test_imm_01int64_highword_reg(long long val) {
  return ((val >> 32) & (0x01 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_01int64_highword_reg>:
bt     $0x20,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_01int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 1
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_01int64_highword_reg(i64 %0) {
%2 = and i64 %0, 4294967296
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmotion_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xmotion.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xmotion_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmotion_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int streq(const char *s1, const char *s2) {
  if (s1 == s2)
    return 1;
  else if (!s1 || !s2)
    return 0;
  else
    return strcmp(s1, s2) == 0;
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <streq+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1178 <streq+0x68>
cmpq   $0x0,-0x10(%rbp)
je     1150 <streq+0x40>
cmpq   $0x0,-0x18(%rbp)
jne    115c <streq+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1178 <streq+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
cmp    %rsi,%rdi
je     1137 <streq+0x27>
xor    %eax,%eax
test   %rdi,%rdi
je     1136 <streq+0x26>
test   %rsi,%rsi
je     1136 <streq+0x26>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %1, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %13
}
void _Jv_ThrowAbstractMethodError() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_ThrowAbstractMethodError() {
ret void
}
int ptraceContinue(int a, int b) { return -1; }


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

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

LLVM IR (-O0):
define i32 @ptraceContinue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @ptraceContinue(i32 %0, i32 %1) {
ret i32 -1
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int remove(char const *);
int _nsntrace_unlink_cb(const char *fpath, const struct stat *sb, int typeflag,
                        struct FTW *ftwbuf) {
  int rv = remove(fpath);
  if (rv)
    perror(fpath);
  return rv;
}


x86 assembly (clang, -O0):
<_nsntrace_unlink_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1156 <_nsntrace_unlink_cb+0x36>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nsntrace_unlink_cb>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <remove@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113a <_nsntrace_unlink_cb+0x1a>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
jmp    1131 <_nsntrace_unlink_cb+0x11>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @_nsntrace_unlink_cb(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
%9 = alloca i32
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%10 = load i8*, i8** %5
%11 = call i32 @remove(i8* %10)
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load i8*, i8** %5
%16 = call i32 @perror(i8* %15)
br label %17
17: ; preds = %14, %4
%18 = load i32, i32* %9
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @_nsntrace_unlink_cb(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i32 @remove(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @perror(i8* %0)
br label %9
9: ; preds = %7, %4
ret i32 %5
}
void PDMR3AsyncCompletionBwMgrSetMaxForFile(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3AsyncCompletionBwMgrSetMaxForFile() {
ret void
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
#pragma omp parallel
  {
    printf("Hello, multithreaded world: thread %d of %d\n",
           omp_get_thread_num(), omp_get_num_threads());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Hello, multithreaded world: thread %d of %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @omp_get_thread_num()
%7 = call i32 (...) @omp_get_num_threads()
%8 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"Hello, multithreaded world: thread %d of %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 (...) @omp_get_num_threads()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
unsigned int djb2(unsigned char *str) {
  unsigned int hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <djb2+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <djb2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <djb2+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <djb2+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int sscanf(char const *, char *, int *, char *);
int /*<<< orphan*/ suicidef(char *, char const *);
int string_to_int(const char *s) {
  int v;
  char extra;
  if (sscanf(s, "%d%c", &v, &extra) != 1)
    suicidef("\"%s\" is not an integer", s);
  return v;
}


x86 assembly (clang, -O0):
<string_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0xd(%rbp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     115d <string_to_int+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <suicidef@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0xb(%rsp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     1152 <string_to_int+0x32>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <suicidef@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%c\00"
@.str.1 = [23 x i8] c"\22%s\22 is not an integer\00"
define i32 @string_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i8* %4)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @suicidef(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%c\00"
@.str.1 = [23 x i8] c"\22%s\22 is not an integer\00"
define i32 @string_to_int(i8* %0) {
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i8* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @suicidef(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}
int substract(int a, int b) { return a - b; }


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

x86 assembly (clang, -O2):
<substract>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @substract(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @substract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
size_t min(const size_t a, const size_t b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <min+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128AdcP__HplAtm128Adc__disableAdc();
void Atm128AdcP__HplAtm128Adc__disableAdc(void) {
  HplAtm128AdcP__HplAtm128Adc__disableAdc();
}


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

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

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

LLVM IR (-O2):
define void @Atm128AdcP__HplAtm128Adc__disableAdc() {
%1 = tail call i32 (...) @HplAtm128AdcP__HplAtm128Adc__disableAdc()
ret void
}
/* Type definitions */
struct Union {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Foo(struct Union *);
void Bar(struct Union *u) { Foo(u); }


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

x86 assembly (clang, -O2):
<Bar>:
jmp    1030 <Foo@plt>

LLVM IR (-O0):
%struct.Union = type { i32 }
define void @Bar(%struct.Union* %0) {
%2 = alloca %struct.Union*
store %struct.Union* %0, %struct.Union** %2
%3 = load %struct.Union*, %struct.Union** %2
%4 = call i32 @Foo(%struct.Union* %3)
ret void
}

LLVM IR (-O2):
%struct.Union = type { i32 }
define void @Bar(%struct.Union* %0) {
%2 = tail call i32 @Foo(%struct.Union* %0)
ret void
}
unsigned short unsignedshort_ignoring_longlongint(unsigned short x,
                                                  long long int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_longlongint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_longlongint(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_longlongint(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write_call_table();
int main(int argc, char *argv[]) {
  write_call_table();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <write_call_table@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <write_call_table@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @write_call_table()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @write_call_table()
%4 = tail call i32 @exit(i32 0)
unreachable
}
float min_f(float a, float b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<min_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min_f+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <min_f+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_f>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @min_f(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fftw_is_prime(int);
int fftw_next_prime(int n) {
  while (!fftw_is_prime(n))
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<fftw_next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fftw_is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <fftw_next_prime+0x28>
jmp    1146 <fftw_next_prime+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <fftw_next_prime+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftw_next_prime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <fftw_is_prime@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1120 <fftw_next_prime+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fftw_next_prime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @fftw_is_prime(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
void addspace(int *finalresult) {
  int mod;
  mod = *finalresult % 64;
  *finalresult = ((int)' ') + (mod - 10);
}


x86 assembly (clang, -O0):
<addspace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0xa,%ecx
add    $0x20,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addspace>:
mov    (%rdi),%eax
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x16,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @addspace(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = srem i32 %5, 64
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 10
%9 = add nsw i32 32, %8
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @addspace(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = srem i32 %2, 64
%4 = add nsw i32 %3, 22
store i32 %4, i32* %0
ret void
}
void network_write_buffer(int *var, int cnt) {}


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

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

LLVM IR (-O0):
define void @network_write_buffer(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @network_write_buffer(i32* nocapture %0, i32 %1) {
ret void
}
int cmp(const void *a, const void *b) {
  return (*(const int *)a) < (*(const int *)b);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @cmp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(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 = icmp slt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int is_variable_prefix(char c) {
  return ((c) == '_') ||
         (('a' <= (c) && (c) <= 'z') || ('A' <= (c) && (c) <= 'Z'));
}


x86 assembly (clang, -O0):
<is_variable_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     116e <is_variable_prefix+0x6e>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     113f <is_variable_prefix+0x3f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x3(%rbp)
jle    1168 <is_variable_prefix+0x68>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x4(%rbp)
jg     1162 <is_variable_prefix+0x62>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_variable_prefix>:
cmp    $0x5f,%dil
sete   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_variable_prefix(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 95
br i1 %5, label %26, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 97, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br i1 %13, label %24, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 65, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sle i32 %20, 90
br label %22
22: ; preds = %18, %14
%23 = phi i1 [ false, %14 ], [ %21, %18 ]
br label %24
24: ; preds = %22, %10
%25 = phi i1 [ true, %10 ], [ %23, %22 ]
br label %26
26: ; preds = %24, %1
%27 = phi i1 [ true, %1 ], [ %25, %24 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @is_variable_prefix(i8 signext %0) {
%2 = icmp eq i8 %0, 95
%3 = and i8 %0, -33
%4 = add i8 %3, -65
%5 = icmp ult i8 %4, 26
%6 = or i1 %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
long get_ticks();
void ms(int n) {
  long target;
  long this;
  target = get_ticks() + ((n + 1) << 5);
  while ((target - get_ticks()) > 0) {
  }
}


x86 assembly (clang, -O0):
<ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_ticks@plt>
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
shl    $0x5,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <get_ticks@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
cmp    $0x0,%rax
jle    115d <ms+0x4d>
jmp    1135 <ms+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ms>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_ticks@plt>
shl    $0x5,%ebx
add    $0x20,%ebx
movslq %ebx,%rbx
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_ticks@plt>
cmp    %rax,%rbx
jg     1130 <ms+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ms(i32 %0) {
%2 = tail call i64 (...) @get_ticks()
%3 = shl i32 %0, 5
%4 = add i32 %3, 32
%5 = sext i32 %4 to i64
%6 = add nsw i64 %2, %5
br label %7
7: ; preds = %7, %1
%8 = tail call i64 (...) @get_ticks()
%9 = icmp sgt i64 %6, %8
br i1 %9, label %7, label %10
10: ; preds = %7
ret void
}
void XPeekIfEvent() {}


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

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

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

LLVM IR (-O2):
define void @XPeekIfEvent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int errno;
char *realpath(char const *const, int /*<<< orphan*/ *);
char *strdup(char const *const);
char *xrealpath(const char *const p) {
  assert(p != NULL);
  char *rp = NULL;
  int tmp_errno = errno;
  if (!(rp = realpath(p, NULL)))
    rp = strdup(p);
  errno = tmp_errno;
  return rp;
}


x86 assembly (clang, -O0):
<xrealpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movq   $0x0,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <realpath@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    118a <xrealpath+0x5a>
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%ecx
mov    0x2e4c(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealpath>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    0x2e94(%rip),%r14
mov    (%r14),%ebp
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <realpath@plt>
test   %rax,%rax
jne    1166 <xrealpath+0x36>
mov    %rbx,%rdi
call   1050 <strdup@plt>
mov    %ebp,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i8* @xrealpath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
store i8* null, i8** %3
%9 = load i32, i32* @errno
store i32 %9, i32* %4
%10 = load i8*, i8** %2
%11 = call i8* @realpath(i8* %10, i32* null)
store i8* %11, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %16, label %13
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i8* @strdup(i8* %14)
store i8* %15, i8** %3
br label %16
16: ; preds = %13, %1
%17 = load i32, i32* %4
store i32 %17, i32* @errno
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@errno = global i32 0
define i8* @xrealpath(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* @errno
%6 = tail call i8* @realpath(i8* %0, i32* null)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = tail call i8* @strdup(i8* %0)
br label %10
10: ; preds = %8, %1
%11 = phi i8* [ %6, %1 ], [ %9, %8 ]
store i32 %5, i32* @errno
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ ej5b_1(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *host;
  if (argc < 2) {
    printf("usage: %s server_host\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  ej5b_1(host);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ej5b_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114f <main+0x1f>
mov    (%rsi),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <ej5b_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = call i32 @ej5b_1(i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @ej5b_1(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ atol(char *);
char *getenv(char *);
int internal_get_rank(void) {
  int rank = 0;
  char *r;
  if ((r = getenv("SLURM_PROCID")) != NULL) {
    rank = (int)atol(r);
  }
  return rank;
}


x86 assembly (clang, -O0):
<internal_get_rank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1155 <internal_get_rank+0x35>
mov    -0x10(%rbp),%rdi
call   1040 <atol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_get_rank>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113c <internal_get_rank+0x1c>
mov    %rax,%rdi
call   1040 <atol@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"SLURM_PROCID\00"
define i32 @internal_get_rank() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @atol(i8* %1)
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %3, %0
%7 = phi i32 [ %5, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
scalar_t__ writefd(int, int);
void WriteFd(int fd, int sendfd) {
  if (writefd(fd, sendfd) <= 0)
    err_sys("writefd() error");
}


x86 assembly (clang, -O0):
<WriteFd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <writefd@plt>
cmp    $0x0,%rax
jg     114f <WriteFd+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <err_sys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteFd>:
push   %rax
call   1040 <writefd@plt>
test   %rax,%rax
jle    112d <WriteFd+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <err_sys@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"writefd() error\00"
define void @WriteFd(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 i64 @writefd(i32 %5, i32 %6)
%8 = icmp sle i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @err_sys(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"writefd() error\00"
define void @WriteFd(i32 %0, i32 %1) {
%3 = tail call i64 @writefd(i32 %0, i32 %1)
%4 = icmp slt i64 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
cbuf31(f, n) { return (cbuf(f, n, 31)); }


x86 assembly (clang, -O0):
<cbuf31>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1f,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf31>:
mov    $0x1f,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf31(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 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 31)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf31(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 31)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Msp430AlarmC__1__Msp430TimerControl__disableEvents();
void Msp430AlarmC__1__Alarm__stop(void) {
  Msp430AlarmC__1__Msp430TimerControl__disableEvents();
}


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

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

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

LLVM IR (-O2):
define void @Msp430AlarmC__1__Alarm__stop() {
%1 = tail call i32 (...) @Msp430AlarmC__1__Msp430TimerControl__disableEvents()
ret void
}
float f2c(float f) { return (5.0f / 9.0f) * (f - 32.0f); }


x86 assembly (clang, -O0):
<f2c>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xeee(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xede(%rip),%xmm0
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2c>:
addss  0xef8(%rip),%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @f2c(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fmul float 0x3FE1C71C80000000, %4
ret float %5
}

LLVM IR (-O2):
define float @f2c(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fmul float %2, 0x3FE1C71C80000000
ret float %3
}
void INT_Excep_ICU_IRQ13(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ13() {
ret void
}
void dlog(int level, const char *format, ...) {}


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

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

LLVM IR (-O0):
define void @dlog(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @dlog(i32 %0, i8* nocapture %1, ...) {
ret void
}