xunge/DecIR huggingface dataset:
void h(int i) {
  if (i == 1) {
  ERROR:
    goto ERROR;
  } else {
  }
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    111b <h+0x1b>
jmp    1116 <h+0x16>
jmp    1116 <h+0x16>
jmp    1120 <h+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
cmp    $0x1,%edi
jne    1112 <h+0x12>
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <h+0x10>
ret

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

LLVM IR (-O2):
define void @h(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
int CHECK_OP3(unsigned char v) { return v == 0x38 || v == 0x3a; }


x86 assembly (clang, -O0):
<CHECK_OP3>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x38,%ecx
mov    %al,-0x2(%rbp)
je     1129 <CHECK_OP3+0x29>
movzbl -0x1(%rbp),%eax
cmp    $0x3a,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHECK_OP3>:
and    $0xfd,%dil
xor    %eax,%eax
cmp    $0x38,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @CHECK_OP3(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 56
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 58
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @CHECK_OP3(i8 zeroext %0) {
%2 = and i8 %0, -3
%3 = icmp eq i8 %2, 56
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t __strspn(char const *, char const *);
size_t strspn(const char *s1, const char *s2) { return __strspn(s1, s2); }


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

x86 assembly (clang, -O2):
<strspn>:
jmp    1030 <__strspn@plt>

LLVM IR (-O0):
define i64 @strspn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @__strspn(i8* %5, i8* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @strspn(i8* %0, i8* %1) {
%3 = tail call i64 @__strspn(i8* %0, i8* %1)
ret i64 %3
}
/* Variables and functions */
double exp(double);
int pow(double, int);
double df(double x) { return exp(-x) - x * exp(-x) + 3 * pow(x, 2); }


x86 assembly (clang, -O0):
<df>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  -0x10(%rbp),%xmm0
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<df>:
sub    $0x38,%rsp
movaps %xmm0,0x20(%rsp)
movaps 0xed0(%rip),%xmm1
xorps  %xmm0,%xmm1
movaps %xmm1,0x10(%rsp)
movaps %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
call   1030 <exp@plt>
movapd 0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm2,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @df(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @exp(double %4)
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fneg double %7
%9 = call double @exp(double %8)
%10 = fneg double %6
%11 = call double @llvm.fmuladd.f64(double %10, double %9, double %5)
%12 = load double, double* %2
%13 = call i32 @pow(double %12, i32 2)
%14 = mul nsw i32 3, %13
%15 = sitofp i32 %14 to double
%16 = fadd double %11, %15
ret double %16
}

LLVM IR (-O2):
define double @df(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = tail call double @exp(double %2)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double %3)
%6 = tail call i32 @pow(double %0, i32 2)
%7 = mul nsw i32 %6, 3
%8 = sitofp i32 %7 to double
%9 = fadd double %5, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, int);
void usage(char *argv[]) {
  printf("Use: %s [OPTIONS] [FILE]\n"
         "Watchdog timer test\n"
         "OPTIONS:\n"
         "\t-t N\tWatchdog timer timeout in seconds, default is %d\n"
         "\t-p N\tNumber of Watchdog timer pings, default is %d\n"
         "\t-w N\tReset wait timeout in seconds, default is %d\n"
         "\t-f\tPing forever flag, overrides -p option\n"
         "\t-s\tStop watchdog timer after last ping\n"
         "\t-h\tDypslay this help and exit\n"
         "FILE:\n"
         "\tWatchdog device node file, default is /dev/watchdog\n",
         argv[0], 5, 10, 5);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed6(%rip),%rdi
mov    $0x5,%r8d
mov    $0xa,%ecx
mov    %r8d,%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
mov    $0x5,%edx
mov    $0xa,%ecx
mov    $0x5,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [386 x i8] c"Use: %s [OPTIONS] [FILE]\0AWatchdog timer test\0AOPTIONS:\0A\09-t N\09Watchdog timer timeout in seconds, default is %d\0A\09-p N\09Number of Watchdog timer pings, default is %d\0A\09-w N\09Reset wait timeout in seconds, default is %d\0A\09-f\09Ping forever flag, overrides -p option\0A\09-s\09Stop watchdog timer after last ping\0A\09-h\09Dypslay this help and exit\0AFILE:\0A\09Watchdog device node file, default is /dev/watchdog\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([386 x i8], [386 x i8]* @.str, i64 0, i64 0), i8* %5, i32 5, i32 10, i32 5)
ret void
}

LLVM IR (-O2):
@.str = [386 x i8] c"Use: %s [OPTIONS] [FILE]\0AWatchdog timer test\0AOPTIONS:\0A\09-t N\09Watchdog timer timeout in seconds, default is %d\0A\09-p N\09Number of Watchdog timer pings, default is %d\0A\09-w N\09Reset wait timeout in seconds, default is %d\0A\09-f\09Ping forever flag, overrides -p option\0A\09-s\09Stop watchdog timer after last ping\0A\09-h\09Dypslay this help and exit\0AFILE:\0A\09Watchdog device node file, default is /dev/watchdog\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([386 x i8], [386 x i8]* @.str, i64 0, i64 0), i8* %2, i32 5, i32 10, i32 5)
ret void
}
int ft_strlen(char *s) {
  int i;
  i = 0;
  if (!s)
    return (i);
  while (s[i] != '\0')
    ++i;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1125 <ft_strlen+0x25>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <ft_strlen+0x53>
jmp    112a <ft_strlen+0x2a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <ft_strlen+0x4d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <ft_strlen+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
test   %rdi,%rdi
je     111d <ft_strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
char *_wilddog_strchar(const char *s1, const char c) {
  const char *p = NULL;
  for (p = s1; *p != 0; p++) {
    if (*p == c)
      return (char *)p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<_wilddog_strchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <_wilddog_strchar+0x64>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <_wilddog_strchar+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <_wilddog_strchar+0x6c>
jmp    1153 <_wilddog_strchar+0x53>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <_wilddog_strchar+0x1e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wilddog_strchar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <_wilddog_strchar+0x21>
mov    %rdi,%rax
nopl   0x0(%rax)
cmp    %sil,%cl
je     1123 <_wilddog_strchar+0x23>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <_wilddog_strchar+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @_wilddog_strchar(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ null, %2 ], [ null, %9 ], [ %7, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, size_t);
void get_architecture(char *arch, size_t len) { strncpy(arch, "x86_64", len); }


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

x86 assembly (clang, -O2):
<get_architecture>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"x86_64\00"
define void @get_architecture(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"x86_64\00"
define void @get_architecture(i8* %0, i64 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %1)
ret void
}
char *swapl(cp, n)
char *cp;
long n;
{
  char *p = cp;
  return p;
}


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

x86 assembly (clang, -O2):
<swapl>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @swapl(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
unsigned limit(unsigned value, unsigned lo, unsigned hi) {
  if (value < lo)
    value = lo;
  if (value > hi)
    value = hi;
  return value;
}


x86 assembly (clang, -O0):
<limit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    111f <limit+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1131 <limit+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit>:
mov    %edi,%eax
cmp    %esi,%edi
cmovb  %esi,%eax
cmp    %edx,%eax
cmova  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @limit(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp ugt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ exit_on_bad_errno();
int read(int /*<<< orphan*/, char *const, size_t const);
size_t retrying_read(char *const buf, const size_t buf_sz) {
  ssize_t sz;
  while ((sz = read(STDIN_FILENO, buf, buf_sz)) == -1)
    exit_on_bad_errno();
  return (size_t)sz;
}


x86 assembly (clang, -O0):
<retrying_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    115e <retrying_read+0x3e>
mov    $0x0,%al
call   1030 <exit_on_bad_errno@plt>
jmp    1130 <retrying_read+0x10>
movslq -0x14(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retrying_read>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eae(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <read@plt>
cmp    $0xffffffff,%eax
jne    115c <retrying_read+0x3c>
xor    %eax,%eax
call   1030 <exit_on_bad_errno@plt>
jmp    1140 <retrying_read+0x20>
cltq
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i64 @retrying_read(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %6
6: ; preds = %12, %2
%7 = load i32, i32* @STDIN_FILENO
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @read(i32 %7, i8* %8, i64 %9)
store i32 %10, i32* %5
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 (...) @exit_on_bad_errno()
br label %6
14: ; preds = %6
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i64 @retrying_read(i8* nocapture %0, i64 %1) {
%3 = load i32, i32* @STDIN_FILENO
%4 = tail call i32 @read(i32 %3, i8* %0, i64 %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = tail call i32 (...) @exit_on_bad_errno()
%8 = load i32, i32* @STDIN_FILENO
%9 = tail call i32 @read(i32 %8, i8* %0, i64 %1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
%12 = phi i32 [ %4, %2 ], [ %9, %6 ]
%13 = sext i32 %12 to i64
ret i64 %13
}
/* Type definitions */
struct iovec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pg_deliver_fn(unsigned int, struct iovec *, int, int);
void totemmrp_deliver_fn(unsigned int nodeid, struct iovec *iovec, int iov_len,
                         int endian_conversion_required) {
  pg_deliver_fn(nodeid, iovec, iov_len, endian_conversion_required);
}


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

x86 assembly (clang, -O2):
<totemmrp_deliver_fn>:
jmp    1030 <pg_deliver_fn@plt>

LLVM IR (-O0):
%struct.iovec = type { i32 }
define void @totemmrp_deliver_fn(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.iovec*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.iovec* %1, %struct.iovec** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.iovec*, %struct.iovec** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @pg_deliver_fn(i32 %9, %struct.iovec* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define void @totemmrp_deliver_fn(i32 %0, %struct.iovec* %1, i32 %2, i32 %3) {
%5 = tail call i32 @pg_deliver_fn(i32 %0, %struct.iovec* %1, i32 %2, i32 %3)
ret void
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};

/* Variables and functions */
int addattr_l(struct nlmsghdr *, int, int, char const *, scalar_t__);
scalar_t__ strlen(char const *);
int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *str) {
  return addattr_l(n, maxlen, type, str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<addattrstrz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    %rax,%r8
add    $0x1,%r8
call   1030 <addattr_l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addattrstrz>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbp
mov    %rcx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%r8
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <addattr_l@plt>

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define i32 @addattrstrz(%struct.nlmsghdr* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.nlmsghdr*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.nlmsghdr*, %struct.nlmsghdr** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = load i8*, i8** %8
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @addattr_l(%struct.nlmsghdr* %9, i32 %10, i32 %11, i8* %12, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define i32 @addattrstrz(%struct.nlmsghdr* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @addattr_l(%struct.nlmsghdr* %0, i32 %1, i32 %2, i8* %3, i64 %6)
ret i32 %7
}
/* Variables and functions */
scalar_t__ test_sat_parser_should_succeed(char *);
int test22(void) {
  return test_sat_parser_should_succeed("(a)") ||
         test_sat_parser_should_succeed("  (  a  )  ");
}


x86 assembly (clang, -O0):
<test22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <test_sat_parser_should_succeed@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    114c <test22+0x3c>
lea    0xec7(%rip),%rdi
call   1030 <test_sat_parser_should_succeed@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test22>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <test_sat_parser_should_succeed@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112c <test22+0x1c>
pop    %rcx
ret
lea    0xed1(%rip),%rdi
call   1030 <test_sat_parser_should_succeed@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"(a)\00"
@.str.1 = [12 x i8] c" ( a ) \00"
define i32 @test22() {
%1 = call i64 @test_sat_parser_should_succeed(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 @test_sat_parser_should_succeed(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"(a)\00"
@.str.1 = [12 x i8] c" ( a ) \00"
define i32 @test22() {
%1 = tail call i64 @test_sat_parser_should_succeed(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 @test_sat_parser_should_succeed(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
const char *load(FILE *fin) {
  const char *text = "LDA #0\n";
  return text;
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
lea    0xef9(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"LDA\0A\00"
define i8* @load(i32* nocapture readnone %0) {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
int dup_word(char **wp, char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dup_word(i8** nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int main() {
  char out = 0x55;
  __asm__("movb $0x7F, %%al; cmpb $0x80, %%al; seto %%al" : "=a"(out));
  return out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
mov    $0x7f,%al
cmp    $0x80,%al
seto   %al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x7f,%al
cmp    $0x80,%al
seto   %al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
%3 = call i8 asm "movb $$0x7F, %al; cmpb $$0x80, %al; seto %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "movb $$0x7F, %al; cmpb $$0x80, %al; seto %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = sext i8 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ inlined();
main() { inlined(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @inlined()
ret i32 0
}
int isPalindrome(unsigned long orig) {
  unsigned long reversed = 0, n = orig;
  while (n > 0) {
    reversed = reversed * 10 + n % 10;
    n /= 10;
  }
  return orig == reversed;
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    115c <isPalindrome+0x5c>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x20(%rbp),%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
jmp    1118 <isPalindrome+0x18>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1149 <isPalindrome+0x49>
movabs $0xcccccccccccccccd,%r8
cc cc cc
mov    %rdi,%rsi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rcx,%rcx,4),%r9
mov    %rsi,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rsi,%rcx
sub    %rax,%rcx
lea    (%rcx,%r9,2),%rcx
cmp    $0x9,%rsi
mov    %rdx,%rsi
ja     1120 <isPalindrome+0x20>
xor    %eax,%eax
cmp    %rdi,%rcx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isPalindrome(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %9, %3 ], [ %0, %1 ]
%5 = phi i64 [ %8, %3 ], [ 0, %1 ]
%6 = mul i64 %5, 10
%7 = urem i64 %4, 10
%8 = add i64 %7, %6
%9 = udiv i64 %4, 10
%10 = icmp ult i64 %4, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %8, %3 ]
%13 = icmp eq i64 %12, %0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void wl_log_stderr_handler(const char *fmt, va_list arg) {
  vfprintf(stderr, fmt, arg);
}


x86 assembly (clang, -O0):
<wl_log_stderr_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_log_stderr_handler>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
define void @wl_log_stderr_handler(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
void flush_or_die() {
  {
    if (!(!fflush(stdout))) {
      perror("error flushing stdout");
      exit(EXIT_FAILURE);
    }
  };
}


x86 assembly (clang, -O0):
<flush_or_die>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
cmp    $0x0,%eax
je     1165 <flush_or_die+0x35>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_or_die>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
test   %eax,%eax
jne    1145 <flush_or_die+0x15>
pop    %rax
ret
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"error flushing stdout\00"
@EXIT_FAILURE = global i32 0
define void @flush_or_die() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"error flushing stdout\00"
@EXIT_FAILURE = global i32 0
define void @flush_or_die() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
ret void
}
/* Type definitions */
struct efi_mount {
  int dummy;
};

/* Variables and functions */
int efi_check_mount_magic(struct efi_mount const *, int);
bool efi_check_mount(const struct efi_mount *efi_mount) {
  return efi_check_mount_magic(efi_mount, true);
}


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

x86 assembly (clang, -O2):
<efi_check_mount>:
mov    $0x1,%esi
jmp    1030 <efi_check_mount_magic@plt>

LLVM IR (-O0):
%struct.efi_mount = type { i32 }
define i32 @efi_check_mount(%struct.efi_mount* %0) {
%2 = alloca %struct.efi_mount*
store %struct.efi_mount* %0, %struct.efi_mount** %2
%3 = load %struct.efi_mount*, %struct.efi_mount** %2
%4 = call i32 @efi_check_mount_magic(%struct.efi_mount* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
%struct.efi_mount = type { i32 }
define i32 @efi_check_mount(%struct.efi_mount* %0) {
%2 = tail call i32 @efi_check_mount_magic(%struct.efi_mount* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ print_path(char *);
scalar_t__ process_args(int, char **);
int main(int argc, char **argv) {
  if (process_args(argc, argv)) {
    print_path(argv[0]);
  } else {
    print_help();
  }
  return 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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <process_args@plt>
cmp    $0x0,%rax
je     116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <print_path@plt>
jmp    1174 <main+0x44>
mov    $0x0,%al
call   1040 <print_help@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
call   1050 <process_args@plt>
test   %rax,%rax
je     1148 <main+0x18>
mov    (%rbx),%rdi
call   1030 <print_path@plt>
jmp    114f <main+0x1f>
xor    %eax,%eax
call   1040 <print_help@plt>
xor    %eax,%eax
pop    %rbx
ret

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i64 @process_args(i32 %6, i8** %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @print_path(i8* %13)
br label %17
15: ; preds = %2
%16 = call i32 (...) @print_help()
br label %17
17: ; preds = %15, %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @process_args(i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @print_path(i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @print_help()
br label %10
10: ; preds = %8, %5
ret i32 0
}
unsigned long TapeImage_ScaleTStates(unsigned long TStateCount) {
  return (TStateCount * ((40 << 16) / 35)) >> 16;
}


x86 assembly (clang, -O0):
<TapeImage_ScaleTStates>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x12492,-0x8(%rbp),%rax
shr    $0x10,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TapeImage_ScaleTStates>:
imul   $0x12492,%rdi,%rax
shr    $0x10,%rax
ret

LLVM IR (-O0):
define i64 @TapeImage_ScaleTStates(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 74898
%5 = lshr i64 %4, 16
ret i64 %5
}

LLVM IR (-O2):
define i64 @TapeImage_ScaleTStates(i64 %0) {
%2 = mul i64 %0, 74898
%3 = lshr i64 %2, 16
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ TestVarArg(char *, long double);
void TestPassVarLD(long double x) { TestVarArg("A", x); }


x86 assembly (clang, -O0):
<TestPassVarLD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xed3(%rip),%rdi
call   1030 <TestVarArg@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define void @TestPassVarLD(x86_fp80 %0) {
%2 = tail call i32 @TestVarArg(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), x86_fp80 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_set_stochastic_population(int const);
void NLOSSP(const int *pop) { nlopt_set_stochastic_population(*pop); }


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

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

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

LLVM IR (-O2):
define void @NLOSSP(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @nlopt_set_stochastic_population(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int first() {
  char mystring[3];
  mystring[0] = 'J';
  mystring[1] = 'a';
  printf("%s\n", mystring);
}


x86 assembly (clang, -O0):
<first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x4a,-0x7(%rbp)
movb   $0x61,-0x6(%rbp)
lea    -0x7(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first>:
push   %rax
movw   $0x614a,0x5(%rsp)
lea    0xee1(%rip),%rdi
lea    0x5(%rsp),%rsi
call   1030 <printf@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @first() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8 74, i8* %2
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
store i8 97, i8* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 undef
}
/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void cleanBuffer() {
  char buffer = fgetc(stdin);
  while (buffer != '\n' && buffer != EOF) {
    buffer = fgetc(stdin);
  }
}


x86 assembly (clang, -O0):
<cleanBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1151 <cleanBuffer+0x41>
movsbl -0x1(%rbp),%eax
mov    0x2e9a(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1161 <cleanBuffer+0x51>
jmp    1177 <cleanBuffer+0x67>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
jmp    1129 <cleanBuffer+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanBuffer>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     1140 <cleanBuffer+0x30>
mov    0x2eb2(%rip),%rbx
xchg   %ax,%ax
cmp    (%rbx),%al
je     1140 <cleanBuffer+0x30>
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    1130 <cleanBuffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i8 0
define void @cleanBuffer() {
%1 = alloca i8
%2 = load i32, i32* @stdin
%3 = call signext i8 @fgetc(i32 %2)
store i8 %3, i8* %1
br label %4
4: ; preds = %16, %0
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = load i8, i8* @EOF
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %10, %12
br label %14
14: ; preds = %8, %4
%15 = phi i1 [ false, %4 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i32, i32* @stdin
%18 = call signext i8 @fgetc(i32 %17)
store i8 %18, i8* %1
br label %4
19: ; preds = %14
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i8 0
define void @cleanBuffer() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @fgetc(i32 %1)
%3 = icmp ne i8 %2, 10
%4 = load i8, i8* @EOF
%5 = icmp ne i8 %2, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i32, i32* @stdin
%9 = tail call signext i8 @fgetc(i32 %8)
%10 = icmp ne i8 %9, 10
%11 = load i8, i8* @EOF
%12 = icmp ne i8 %9, %11
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret void
}
int int_size_is_32() {
  int set_msb = 1 << 31;
  int beyond_msb = set_msb << 1;
  return set_msb && !beyond_msb;
}


x86 assembly (clang, -O0):
<int_size_is_32>:
push   %rbp
mov    %rsp,%rbp
movl   $0x80000000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     112f <int_size_is_32+0x2f>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_size_is_32() {
%1 = alloca i32
%2 = alloca i32
store i32 -2147483648, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %7, %0
%12 = phi i1 [ false, %0 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @int_size_is_32() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ CHAR_MAX;
int isMax(int /*<<< orphan*/);
int main(int argc, const char *argv[]) {
  int c = isMax(CHAR_MAX);
  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    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <isMax@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <isMax@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@CHAR_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @CHAR_MAX
%4 = tail call i32 @isMax(i32 %3)
ret i32 0
}
void genbgtz_test() {}


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

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

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

LLVM IR (-O2):
define void @genbgtz_test() {
ret void
}
void glFinish(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glFinish() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_11727() {
  Assert_real((isqrt(11727) == 108),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1525, ("Integer square root of 11727 should be 108"));
}


x86 assembly (clang, -O0):
<t_sqrt_11727>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2dcf,%edi
call   1030 <isqrt@plt>
cmp    $0x6c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5f5,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_11727>:
push   %rax
mov    $0x2dcf,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x6c,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5f5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 11727 should be 108\00"
define void @t_sqrt_11727() {
%1 = call i32 @isqrt(i32 11727)
%2 = icmp eq i32 %1, 108
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1525, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 11727 should be 108\00"
define void @t_sqrt_11727() {
%1 = tail call i32 @isqrt(i32 11727)
%2 = icmp eq i32 %1, 108
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1525, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
char *get_time() {
  time_t curr_time;
  curr_time = time(0);
  char *p = ctime(&curr_time);
  p[strlen(p) - 1] = 0;
  return p;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_time() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i32 @time(i32 0)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32 0)
store i32 %3, i32* %1
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}