xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ grace(int /*<<< orphan*/);
int fn1(int i) {
  switch (i)
  case 1:
    if (i == 5)
      grace(0);
    else
      goto done;
done:;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    114c <fn1+0x3c>
jmp    112c <fn1+0x1c>
cmpl   $0x5,-0x8(%rbp)
jne    1142 <fn1+0x32>
xor    %edi,%edi
call   1030 <grace@plt>
jmp    1147 <fn1+0x37>
jmp    1151 <fn1+0x41>
jmp    114c <fn1+0x3c>
jmp    1151 <fn1+0x41>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
ret i32 undef
}
/* Type definitions */
struct set {
  int dummy;
};
struct remote {
  int dummy;
};

/* Variables and functions */
struct remote *add_remote(struct set *, char *);
struct remote *find_remote(struct set *, char *);
struct remote *acquire_remote(struct set *ss, char *name) {
  struct remote *rs;
  rs = find_remote(ss, name);
  if (rs) {
    return rs;
  }
  return add_remote(ss, name);
}


x86 assembly (clang, -O0):
<acquire_remote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <find_remote@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <acquire_remote+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <acquire_remote+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <add_remote@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acquire_remote>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <find_remote@plt>
test   %rax,%rax
je     113c <acquire_remote+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <add_remote@plt>

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

LLVM IR (-O2):
%struct.remote = type { i32 }
%struct.set = type { i32 }
define %struct.remote* @acquire_remote(%struct.set* %0, i8* %1) {
%3 = tail call %struct.remote* @find_remote(%struct.set* %0, i8* %1)
%4 = icmp eq %struct.remote* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call %struct.remote* @add_remote(%struct.set* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi %struct.remote* [ %6, %5 ], [ %3, %2 ]
ret %struct.remote* %8
}
int main(void) {
  int i = 0;
  i++, i = (i == 0) ? 42 : 89;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x59,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 42, i32 89
store i32 %8, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PWM3_2_DriverIRQHandler();
__attribute__((weak)) void PWM3_2_IRQHandler(void) {
  PWM3_2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM3_2_IRQHandler() {
%1 = call i32 (...) @PWM3_2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM3_2_IRQHandler() {
%1 = tail call i32 (...) @PWM3_2_DriverIRQHandler()
ret void
}
void Curl_ssl_close_all(struct SessionHandle *data) { (void)data; }


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

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

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

LLVM IR (-O2):
%struct.SessionHandle = type opaque
define void @Curl_ssl_close_all(%struct.SessionHandle* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ unlikely(int);
int rt_prio(int prio) {
  if (unlikely(prio < 100))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<rt_prio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <unlikely@plt>
cmp    $0x0,%rax
je     1142 <rt_prio+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <rt_prio+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_prio>:
push   %rax
xor    %eax,%eax
cmp    $0x64,%edi
setl   %al
mov    %eax,%edi
call   1030 <unlikely@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rt_prio(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 100
%6 = zext i1 %5 to i32
%7 = call i64 @unlikely(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @rt_prio(i32 %0) {
%2 = icmp slt i32 %0, 100
%3 = zext i1 %2 to i32
%4 = tail call i64 @unlikely(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help_default(void) {
  printf("\nOptions:\n -h, --help\n      Print detailed help screen.\n -V, "
         "--version\n      Print version information.\n -v, --verbose\n      "
         "Show details for command-line debugging.\n -t, --timeout=INTEGER\n   "
         "   Seconds before the check return with a timeout alert.\n     "
         "--eopt=[section][@file]\n      Read additional opts from section in "
         "ini-File.\n     --perfdata\n      Print performance data (if "
         "available).\n");
}


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

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

LLVM IR (-O0):
@.str = [393 x i8] c"\0AOptions:\0A -h, --help\0A Print detailed help screen.\0A -V, --version\0A Print version information.\0A -v, --verbose\0A Show details for command-line debugging.\0A -t, --timeout=INTEGER\0A Seconds before the check return with a timeout alert.\0A --eopt=[section][@file]\0A Read additional opts from section in ini-File.\0A --perfdata\0A Print performance data (if available).\0A\00"
define void @print_help_default() {
%1 = call i32 @printf(i8* getelementptr inbounds ([393 x i8], [393 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [392 x i8] c"\0AOptions:\0A -h, --help\0A Print detailed help screen.\0A -V, --version\0A Print version information.\0A -v, --verbose\0A Show details for command-line debugging.\0A -t, --timeout=INTEGER\0A Seconds before the check return with a timeout alert.\0A --eopt=[section][@file]\0A Read additional opts from section in ini-File.\0A --perfdata\0A Print performance data (if available).\00"
define void @print_help_default() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([392 x i8], [392 x i8]* @str, i64 0, i64 0))
ret void
}
int isBigEndian(void) {
  long one = 1;
  return !(*((char *)(&one)));
}


x86 assembly (clang, -O0):
<isBigEndian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isBigEndian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isBigEndian() {
ret i32 0
}
int cmp_float_decreasing(const void *a, const void *b) {
  const float *ia = (const float *)a;
  const float *ib = (const float *)b;
  if (*ia < *ib)
    return 1;
  else if (*ia > *ib)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp_float_decreasing>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1141 <cmp_float_decreasing+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1169 <cmp_float_decreasing+0x69>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    1162 <cmp_float_decreasing+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <cmp_float_decreasing+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_float_decreasing>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
neg    %ecx
ucomiss %xmm0,%xmm1
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_float_decreasing(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = fcmp ogt float %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int td_isascii(c)
int c;
{ return (c >= 0 && c < 128); }


x86 assembly (clang, -O0):
<td_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1123 <td_isascii+0x23>
cmpl   $0x80,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<td_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @td_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
int c_start(int argc, char *argv[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c_start(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void Tolower(q) char *q;
{
  char *s = q;
  while (*s) {
    *s = tolower((unsigned char)*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<Tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <Tolower+0x46>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <Tolower+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <Tolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <Tolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @Tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = zext i8 %5 to i32
%8 = tail call i32 @tolower(i32 %7)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int fork() { return syscall(10, 0, 0); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    $0xa,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @fork() {
%1 = call i32 @syscall(i32 10, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @fork() {
%1 = tail call i32 @syscall(i32 10, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
char *oauth_sign_hmac_sha1_raw(char const *, int /*<<< orphan*/, char const *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *oauth_sign_hmac_sha1(const char *m, const char *k) {
  return (oauth_sign_hmac_sha1_raw(m, strlen(m), k, strlen(k)));
}


x86 assembly (clang, -O0):
<oauth_sign_hmac_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
call   1040 <oauth_sign_hmac_sha1_raw@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oauth_sign_hmac_sha1>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <oauth_sign_hmac_sha1_raw@plt>

LLVM IR (-O0):
define i8* @oauth_sign_hmac_sha1(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i8* @oauth_sign_hmac_sha1_raw(i8* %5, i32 %7, i8* %8, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @oauth_sign_hmac_sha1(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i8* @oauth_sign_hmac_sha1_raw(i8* %0, i32 %3, i8* %1, i32 %4)
ret i8* %5
}
void default_cmpild_instr_callback(unsigned int val, int reg) {}


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

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

LLVM IR (-O0):
define void @default_cmpild_instr_callback(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 @default_cmpild_instr_callback(i32 %0, i32 %1) {
ret void
}
void ISR_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @ISR_Init() {
ret void
}
/* Variables and functions */
int find_max(int *, int);
int /*<<< orphan*/ printfdbg(char *, int);
void main_main() {
  int max_elem;
  int arr[5];
  arr[0] = 5;
  arr[1] = 54;
  arr[2] = 1;
  arr[3] = 94;
  arr[4] = 12;
  max_elem = find_max(arr, 5);
  printfdbg("%d\n", max_elem);
}


x86 assembly (clang, -O0):
<main_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x20(%rbp)
movl   $0x36,-0x1c(%rbp)
movl   $0x1,-0x18(%rbp)
movl   $0x5e,-0x14(%rbp)
movl   $0xc,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <find_max@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printfdbg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xc,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <find_max@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
call   1030 <printfdbg@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @main_main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
store i32 5, i32* %3
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
store i32 54, i32* %4
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
store i32 1, i32* %5
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
store i32 94, i32* %6
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
store i32 12, i32* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = call i32 @find_max(i32* %8, i32 5)
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = call i32 @printfdbg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main_main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = bitcast [5 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 5, i32 54, i32 1, i32 94>, <4 x i32>* %4
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 12, i32* %5
%6 = call i32 @find_max(i32* %3, i32 5)
%7 = call i32 @printfdbg(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
void TestDeclStmt() {
  int x = 0;
  int y, z;
}


x86 assembly (clang, -O0):
<TestDeclStmt>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @TestDeclStmt() {
ret void
}
void simtec_acknoledge_current_irq_level() {}


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

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

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

LLVM IR (-O2):
define void @simtec_acknoledge_current_irq_level() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int *, int *);
int main(void) {
  int a, b;
  printf("Enter the two numbers to be swapped :");
  scanf("%d%d", &a, &b);
  swap(&a, &b);
  printf("The swapped numbers are %d and %d.\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Enter the two numbers to be swapped :\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [36 x i8] c"The swapped numbers are %d and %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%6 = call i32 @swap(i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Enter the two numbers to be swapped :\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [36 x i8] c"The swapped numbers are %d and %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = call i32 @swap(i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char const *, char const *, int);
void my_assert_fail(char const *cond, char const *file, int line) {
  die("assert fail: '%s' %s:%i\n", cond, file, line);
}


x86 assembly (clang, -O0):
<my_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_assert_fail>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <die@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"assert fail: '%s' %s:%i\0A\00"
define void @my_assert_fail(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @die(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_runner_init(char *);
void test_case_begin(char *description) { test_runner_init(description); }


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

x86 assembly (clang, -O2):
<test_case_begin>:
jmp    1030 <test_runner_init@plt>

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

LLVM IR (-O2):
define void @test_case_begin(i8* %0) {
%2 = tail call i32 @test_runner_init(i8* %0)
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_default(void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_default>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_default(i8** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int EINTR;
scalar_t__ close(int);
int errno;
int sancus_close(int fd) {
  while (1) {
    if (close(fd) == 0)
      return 0;
    else if (errno != EINTR)
      return -errno;
  }
}


x86 assembly (clang, -O0):
<sancus_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jne    1139 <sancus_close+0x29>
movl   $0x0,-0x4(%rbp)
jmp    116e <sancus_close+0x5e>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
je     1164 <sancus_close+0x54>
xor    %eax,%eax
mov    0x2e86(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <sancus_close+0x5e>
jmp    1169 <sancus_close+0x59>
jmp    111b <sancus_close+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
test   %rax,%rax
je     1148 <sancus_close+0x38>
mov    (%r14),%eax
cmp    (%r15),%eax
je     1130 <sancus_close+0x20>
neg    %eax
jmp    114a <sancus_close+0x3a>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i32 0
@EINTR = global i32 0
define i32 @sancus_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
br label %4
4: ; preds = %1, %17
%5 = load i32, i32* %3
%6 = call i64 @close(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
store i32 0, i32* %2
br label %18
9: ; preds = %4
%10 = load i32, i32* @errno
%11 = load i32, i32* @EINTR
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* @errno
%15 = sub nsw i32 0, %14
store i32 %15, i32* %2
br label %18
16: ; preds = %9
br label %17
17: ; preds = %16
br label %4
18: ; preds = %13, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@errno = global i32 0
@EINTR = global i32 0
define i32 @sancus_close(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i64 @close(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = load i32, i32* @EINTR
%8 = icmp eq i32 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = sub nsw i32 0, %6
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ %10, %9 ], [ 0, %2 ]
ret i32 %12
}
void pthread_rwlock_init() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlock_init() {
ret void
}
int isunary(int tok) {
  return (tok == '!') | (tok == '~') | (tok == 12) | (tok == 13) | (tok == 27);
}


x86 assembly (clang, -O0):
<isunary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x7e,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpl   $0xc,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpl   $0xd,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpl   $0x1b,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isunary>:
cmp    $0x21,%edi
sete   %al
cmp    $0x7e,%edi
sete   %cl
or     %al,%cl
mov    %edi,%eax
and    $0xfffffffe,%eax
cmp    $0xc,%eax
sete   %al
or     %cl,%al
cmp    $0x1b,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isunary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 33
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 126
%8 = zext i1 %7 to i32
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 12
%12 = zext i1 %11 to i32
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 13
%16 = zext i1 %15 to i32
%17 = or i32 %13, %16
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 27
%20 = zext i1 %19 to i32
%21 = or i32 %17, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @isunary(i32 %0) {
%2 = icmp eq i32 %0, 33
%3 = icmp eq i32 %0, 126
%4 = or i1 %2, %3
%5 = and i32 %0, -2
%6 = icmp eq i32 %5, 12
%7 = or i1 %6, %4
%8 = icmp eq i32 %0, 27
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int __u16;

/* Variables and functions */
int cec_is_unregistered(__u16 log_addr_mask) {
  return log_addr_mask & (1 << 15);
}


x86 assembly (clang, -O0):
<cec_is_unregistered>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_is_unregistered>:
mov    %edi,%eax
and    $0x8000,%eax
ret

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

LLVM IR (-O2):
define i32 @cec_is_unregistered(i32 %0) {
%2 = and i32 %0, 32768
ret i32 %2
}
int chr_isalpha(const char c) {
  return ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'));
}


x86 assembly (clang, -O0):
<chr_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <chr_isalpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <chr_isalpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <chr_isalpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %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):
<chr_isalpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @chr_isalpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned short mus_little_endian_unsigned_short(unsigned char *inp) {
  unsigned short o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[1];
  outp[1] = inp[0];
  return (o);
}


x86 assembly (clang, -O0):
<mus_little_endian_unsigned_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_little_endian_unsigned_short>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @mus_little_endian_unsigned_short(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i16* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @mus_little_endian_unsigned_short(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = load i8, i8* %0
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %3 to i16
%8 = or i16 %6, %7
ret i16 %8
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (!(r <= 0)) {
    rand();
    y = rand();
    x = 42;
  } else {
    y = rand();
    x = 7;
  }
  return x;
}


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 <rand@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1157 <main+0x47>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
jmp    1168 <main+0x58>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
test   %ebx,%ebx
jle    1133 <main+0x23>
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
pop    %rbx
ret
mov    $0x7,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp slt i32 %3, 1
%5 = tail call i32 (...) @rand()
br i1 %4, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 42, %6 ], [ 7, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
__attribute__((always_)) void auto_closeint(int **x) {
  if ((x) && (*x)) {
    close(**(int **)x);
  }
}


x86 assembly (clang, -O0):
<auto_closeint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <auto_closeint+0x33>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1143 <auto_closeint+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<auto_closeint>:
test   %rdi,%rdi
je     1124 <auto_closeint+0x14>
mov    (%rdi),%rax
test   %rax,%rax
je     1124 <auto_closeint+0x14>
mov    (%rax),%edi
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @auto_closeint(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* %4
%8 = tail call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %3, %1
ret void
}
int main() {
  int a, b, c;
  if (a) {
    b = 0;
    c = 0;
    goto A;
  }
A:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    112d <main+0x2d>
jmp    112d <main+0x2d>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %3
store i32 0, i32* %4
br label %9
8: ; preds = %0
br label %9
9: ; preds = %8, %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void security_skb_recv_datagram(struct sk_buff *skb, struct sock *sk,
                                unsigned flags) {}


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

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
%struct.sock = type opaque
define void @security_skb_recv_datagram(%struct.sk_buff* %0, %struct.sock* %1, i32 %2) {
%4 = alloca %struct.sk_buff*
%5 = alloca %struct.sock*
%6 = alloca i32
store %struct.sk_buff* %0, %struct.sk_buff** %4
store %struct.sock* %1, %struct.sock** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
%struct.sock = type opaque
define void @security_skb_recv_datagram(%struct.sk_buff* nocapture %0, %struct.sock* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setUtility(int /*<<< orphan*/, int, int /*<<< orphan*/);
void solveSet(int set[]) {
  int i, rem = 0;
  for (i = 0; i < 8; ++i)
    rem += set[i];
  setUtility(0, rem, 0);
}


x86 assembly (clang, -O0):
<solveSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1153 <solveSet+0x43>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <solveSet+0x1a>
mov    -0x10(%rbp),%esi
xor    %edx,%edx
mov    %edx,%edi
call   1030 <setUtility@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solveSet>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
paddd  %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
paddd  %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%esi
xor    %edi,%edi
xor    %edx,%edx
jmp    1030 <setUtility@plt>

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

LLVM IR (-O2):
define void @solveSet(i32* nocapture %0) {
%2 = bitcast i32* %0 to <8 x i32>*
%3 = load <8 x i32>, <8 x i32>* %2
%4 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %3)
%5 = tail call i32 @setUtility(i32 0, i32 %4, i32 0)
ret void
}
int GetOutputLength(unsigned long lInputLong) {
  unsigned long lVal = lInputLong % 8;
  if (lVal != 0)
    return lInputLong + 8 - lVal;
  else
    return lInputLong;
}


x86 assembly (clang, -O0):
<GetOutputLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1133 <GetOutputLength+0x33>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
sub    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    113a <GetOutputLength+0x3a>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetOutputLength>:
lea    0x8(%rdi),%eax
and    $0xfffffff8,%eax
test   $0x7,%dil
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @GetOutputLength(i64 %0) {
%2 = and i64 %0, 7
%3 = icmp eq i64 %2, 0
%4 = add i64 %0, 8
%5 = and i64 %4, 4294967288
%6 = select i1 %3, i64 %0, i64 %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ DMA_Error_DriverIRQHandler();
__attribute__((weak)) void DMA_Error_IRQHandler(void) {
  DMA_Error_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA_Error_IRQHandler() {
%1 = call i32 (...) @DMA_Error_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA_Error_IRQHandler() {
%1 = tail call i32 (...) @DMA_Error_DriverIRQHandler()
ret void
}
void *memq_enqueue(void *mem, void *link, void **tail) {
  *((void **)*tail) = link;
  *((void **)*tail + 1) = mem;
  *tail = link;
  return link;
}


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

x86 assembly (clang, -O2):
<memq_enqueue>:
mov    %rsi,%rax
mov    (%rdx),%rcx
mov    %rsi,(%rcx)
mov    (%rdx),%rcx
mov    %rdi,0x8(%rcx)
mov    %rsi,(%rdx)
ret

LLVM IR (-O0):
define i8* @memq_enqueue(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** %5
%8 = load i8**, i8*** %6
%9 = load i8*, i8** %8
%10 = bitcast i8* %9 to i8**
store i8* %7, i8** %10
%11 = load i8*, i8** %4
%12 = load i8**, i8*** %6
%13 = load i8*, i8** %12
%14 = bitcast i8* %13 to i8**
%15 = getelementptr inbounds i8*, i8** %14, i64 1
store i8* %11, i8** %15
%16 = load i8*, i8** %5
%17 = load i8**, i8*** %6
store i8* %16, i8** %17
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @memq_enqueue(i8* %0, i8* returned %1, i8** nocapture %2) {
%4 = bitcast i8** %2 to i8***
%5 = load i8**, i8*** %4
store i8* %1, i8** %5
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
store i8* %0, i8** %7
store i8* %1, i8** %2
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  if (1 != 1)
    abort();
  if (2 != 2)
    abort();
  if (3 != 3)
    abort();
  if (4 != 4)
    abort();
  if (5 != 5)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}