xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bitmap_LittleEndToINT16(unsigned char *pByteArray) {
  uint16_t intValue;
  intValue = 0;
  intValue = (uint16_t)pByteArray[0];
  intValue = intValue | ((uint16_t)pByteArray[1] << 8);
  return intValue;
}


x86 assembly (clang, -O0):
<bitmap_LittleEndToINT16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_LittleEndToINT16>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @bitmap_LittleEndToINT16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stub(int, char *, char *, char *, char *);
int main() {
  stub(1, "ab", "bc", "cx", (char *)0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xebd(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <stub@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xed0(%rip),%rcx
mov    $0x1,%edi
xor    %r8d,%r8d
call   1030 <stub@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ab\00"
@.str.1 = [3 x i8] c"bc\00"
@.str.2 = [3 x i8] c"cx\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @stub(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* null)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"ab\00"
@.str.1 = [3 x i8] c"bc\00"
@.str.2 = [3 x i8] c"cx\00"
define i32 @main() {
%1 = tail call i32 @stub(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* null)
%2 = tail call i32 @exit(i32 0)
unreachable
}
void g_strlcpy() {}


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

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

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

LLVM IR (-O2):
define void @g_strlcpy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_usage(const char *progname) {
  fprintf(stderr,
          "Usage: %s [MODE] [FILE] ...\n"
          " -o, --output <outfile>\n"
          " -d, --dump <infile>\n"
          " -s, --search <key> <infile>\n"
          " -w, --searchwild <key> <infile>\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [136 x i8] c"Usage: %s [MODE] [FILE] ...\0A -o, --output <outfile>\0A -d, --dump <infile>\0A -s, --search <key> <infile>\0A -w, --searchwild <key> <infile>\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [136 x i8] c"Usage: %s [MODE] [FILE] ...\0A -o, --output <outfile>\0A -d, --dump <infile>\0A -s, --search <key> <infile>\0A -w, --searchwild <key> <infile>\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
double my_fabs(double x) { return (x < 0.0) ? -x : x; }


x86 assembly (clang, -O0):
<my_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <my_fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <my_fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @my_fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @my_fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int htab_ulong_cmp(const void *data1, const void *data2) {
  const unsigned long *v1 = data1;
  const unsigned long *v2 = data2;
  return (*v1) - (*v2);
}


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

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

LLVM IR (-O0):
define i32 @htab_ulong_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = sub i64 %12, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @htab_ulong_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_RenderingControl_SetBrightness(void *);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned short);
void UPnPRenderingControl_SetBrightness(void *upnptoken,
                                        unsigned int InstanceID,
                                        unsigned short DesiredBrightness) {
  printf("Invoke: UPnPRenderingControl_SetBrightness(%u,%u);\r\n", InstanceID,
         DesiredBrightness);
  UPnPResponse_RenderingControl_SetBrightness(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPRenderingControl_SetBrightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec0(%rip),%rdi
movzwl -0xe(%rbp),%edx
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <UPnPResponse_RenderingControl_SetBrightness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPRenderingControl_SetBrightness>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UPnPResponse_RenderingControl_SetBrightness@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Invoke: UPnPRenderingControl_SetBrightness(%u,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetBrightness(i8* %0, i32 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i32, i32* %5
%8 = load i16, i16* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %7, i16 zeroext %8)
%10 = load i8*, i8** %4
%11 = call i32 @UPnPResponse_RenderingControl_SetBrightness(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Invoke: UPnPRenderingControl_SetBrightness(%u,%u);\0D\0A\00"
define void @UPnPRenderingControl_SetBrightness(i8* %0, i32 %1, i16 zeroext %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 %1, i16 zeroext %2)
%5 = tail call i32 @UPnPResponse_RenderingControl_SetBrightness(i8* %0)
ret void
}
int is_prime(int n) {
  int i;
  for (i = 2; i < n / 2; i++)
    if (n % i == 0)
      break;
  return i >= n / 2 ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jge    1154 <is_prime+0x54>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1141 <is_prime+0x41>
jmp    1154 <is_prime+0x54>
jmp    1146 <is_prime+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <is_prime+0xe>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%edx
mov    %eax,%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovge %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    %edi,%r8d
shr    $0x1f,%r8d
add    %edi,%r8d
sar    %r8d
mov    $0x2,%esi
cmp    $0x6,%edi
jl     1142 <is_prime+0x42>
cmp    $0x4,%r8d
mov    $0x3,%ecx
cmovge %r8d,%ecx
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1142 <is_prime+0x42>
add    $0x1,%esi
cmp    %esi,%ecx
jne    1130 <is_prime+0x30>
mov    %ecx,%esi
xor    %eax,%eax
cmp    %r8d,%esi
setge  %al
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 2
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %19
9: ; preds = %4
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
br label %19
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %14, %4
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 2
%23 = icmp sge i32 %20, %22
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = icmp sgt i32 %0, 5
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = call i32 @llvm.smax.i32(i32 %2, i32 3)
br label %6
6: ; preds = %4, %10
%7 = phi i32 [ %11, %10 ], [ 2, %4 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = add nuw nsw i32 %7, 1
%12 = icmp eq i32 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %10, %6, %1
%14 = phi i32 [ 2, %1 ], [ %7, %6 ], [ %5, %10 ]
%15 = icmp sge i32 %14, %2
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char *, int);
int __test_same() {
  void;
  if ((memcmp("foo", "foo", 4)) == (0))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<__test_same>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rsi
mov    $0x4,%edx
mov    %rsi,%rdi
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    1141 <__test_same+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1148 <__test_same+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_same>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rdi,%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i32 @__test_same() {
%1 = alloca i32
%2 = call i32 @memcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i32 @__test_same() {
%1 = tail call i32 @memcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int ispunct(int c) {
  return (c >= 0x21 && c <= 0x2F) || (c >= 0x3A && c <= 0x40) ||
         (c >= 0x5B && c <= 0x60) || (c >= 0x7B && c <= 0x7E);
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x21,-0x4(%rbp)
jl     1120 <ispunct+0x20>
mov    $0x1,%al
cmpl   $0x2f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x3a,-0x4(%rbp)
jl     1139 <ispunct+0x39>
mov    $0x1,%al
cmpl   $0x40,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
cmpl   $0x5b,-0x4(%rbp)
jl     1152 <ispunct+0x52>
mov    $0x1,%al
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1171 <ispunct+0x71>
xor    %eax,%eax
cmpl   $0x7b,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     116b <ispunct+0x6b>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
paddd  0xeef(%rip),%xmm0
pxor   0xef7(%rip),%xmm0
movdqa 0xeff(%rip),%xmm1
pcmpgtd %xmm0,%xmm1
movmskps %xmm1,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 33
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 47
br i1 %7, label %28, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 58
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 64
br i1 %13, label %28, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 91
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 96
br i1 %19, label %28, label %20
20: ; preds = %17, %14
%21 = load i32, i32* %2
%22 = icmp sge i32 %21, 123
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sle i32 %24, 126
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br label %28
28: ; preds = %26, %17, %11, %5
%29 = phi i1 [ true, %17 ], [ true, %11 ], [ true, %5 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add <4 x i32> %3, <i32 -123, i32 -91, i32 -33, i32 -58>
%5 = icmp ult <4 x i32> %4, <i32 4, i32 6, i32 15, i32 7>
%6 = bitcast <4 x i1> %5 to i4
%7 = icmp ne i4 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_new_method_return(void *call, void **m) {
  return -EINVAL;
}


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

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

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_new_method_return(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
double InterpretSiPrefixValue(char const *, char **);
double SiPrefixToDoubleInterval(const char *string, const double interval) {
  char *q;
  double value;
  value = InterpretSiPrefixValue(string, &q);
  if (*q == '%')
    value *= interval / 100.0;
  return (value);
}


x86 assembly (clang, -O0):
<SiPrefixToDoubleInterval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <InterpretSiPrefixValue@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    115e <SiPrefixToDoubleInterval+0x4e>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SiPrefixToDoubleInterval>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rsi
call   1030 <InterpretSiPrefixValue@plt>
mov    0x10(%rsp),%rax
cmpb   $0x25,(%rax)
jne    1140 <SiPrefixToDoubleInterval+0x30>
movsd  0x8(%rsp),%xmm1
divsd  0xec4(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @SiPrefixToDoubleInterval(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%7 = load i8*, i8** %3
%8 = call double @InterpretSiPrefixValue(i8* %7, i8** %5)
store double %8, double* %6
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 37
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load double, double* %4
%15 = fdiv double %14, 1.000000e+02
%16 = load double, double* %6
%17 = fmul double %16, %15
store double %17, double* %6
br label %18
18: ; preds = %13, %2
%19 = load double, double* %6
ret double %19
}

LLVM IR (-O2):
define double @SiPrefixToDoubleInterval(i8* %0, double %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call double @InterpretSiPrefixValue(i8* %0, i8** %3)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 37
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = fdiv double %1, 1.000000e+02
%11 = fmul double %10, %5
br label %12
12: ; preds = %9, %2
%13 = phi double [ %11, %9 ], [ %5, %2 ]
ret double %13
}
int sum_digits(int n) {
  int sum = 0;
  while (n != 0) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <sum_digits+0x3c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sum_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_digits>:
xor    %eax,%eax
test   %edi,%edi
je     113b <sum_digits+0x3b>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <sum_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @sum_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = add nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
int betoFn(int x, int y) { return 2 * x * x + 25 * y * y; }


x86 assembly (clang, -O0):
<betoFn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   -0x4(%rbp),%eax
imul   $0x19,-0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<betoFn>:
imul   %edi,%edi
imul   %esi,%esi
lea    (%rsi,%rsi,4),%eax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @betoFn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 2, %5
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = mul nsw i32 25, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = add nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @betoFn(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = mul nsw i32 %3, %0
%5 = mul nsw i32 %1, 25
%6 = mul nsw i32 %5, %1
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printIntArray(int *arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("arr[%d] is: %d\n", i, arr[i]);
  }
}


x86 assembly (clang, -O0):
<printIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <printIntArray+0x4a>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printIntArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIntArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <printIntArray+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printIntArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"arr[%d] is: %d\0A\00"
define void @printIntArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"arr[%d] is: %d\0A\00"
define void @printIntArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int labs(long);
long get_chest_n(long dun_lev) {
  long d_lev, div;
  long dn, n;
  d_lev = labs(dun_lev) - 5;
  if (d_lev < 0)
    d_lev = 0;
  div = 100 - 5;
  dn = 8 - 4;
  n = 4 + (dn * d_lev / div);
  if (n > 8)
    n = 8;
  return n;
}


x86 assembly (clang, -O0):
<get_chest_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
sub    $0x5,%eax
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1141 <get_chest_n+0x31>
movq   $0x0,-0x10(%rbp)
movq   $0x5f,-0x18(%rbp)
movq   $0x4,-0x20(%rbp)
mov    -0x20(%rbp),%rax
imul   -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x8,-0x28(%rbp)
jle    117b <get_chest_n+0x6b>
movq   $0x8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_chest_n>:
push   %rax
call   1030 <labs@plt>
add    $0xfffffffb,%eax
cltq
xor    %ecx,%ecx
test   %rax,%rax
cmovns %rax,%rcx
shl    $0x2,%rcx
movabs $0x58ed2308158ed231,%rdx
23 ed 58
mov    %rcx,%rax
mul    %rdx
sub    %rdx,%rcx
shr    %rcx
add    %rdx,%rcx
shr    $0x6,%rcx
cmp    $0x4,%rcx
mov    $0x4,%eax
cmovb  %rcx,%rax
add    $0x4,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_chest_n(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = call i32 @labs(i64 %7)
%9 = sub nsw i32 %8, 5
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = load i64, i64* %3
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i64 0, i64* %3
br label %14
14: ; preds = %13, %1
store i64 95, i64* %4
store i64 4, i64* %5
%15 = load i64, i64* %5
%16 = load i64, i64* %3
%17 = mul nsw i64 %15, %16
%18 = load i64, i64* %4
%19 = sdiv i64 %17, %18
%20 = add nsw i64 4, %19
store i64 %20, i64* %6
%21 = load i64, i64* %6
%22 = icmp sgt i64 %21, 8
br i1 %22, label %23, label %24
23: ; preds = %14
store i64 8, i64* %6
br label %24
24: ; preds = %23, %14
%25 = load i64, i64* %6
ret i64 %25
}

LLVM IR (-O2):
define i64 @get_chest_n(i64 %0) {
%2 = tail call i32 @labs(i64 %0)
%3 = add nsw i32 %2, -5
%4 = sext i32 %3 to i64
%5 = icmp sgt i64 %4, 0
%6 = select i1 %5, i64 %4, i64 0
%7 = shl nuw nsw i64 %6, 2
%8 = udiv i64 %7, 95
%9 = icmp ult i64 %8, 4
%10 = select i1 %9, i64 %8, i64 4
%11 = add nuw nsw i64 %10, 4
ret i64 %11
}
long __VERIFIER_nondet_long(void) {
  long l;
  { return (l); }
}


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

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

LLVM IR (-O0):
define i64 @__VERIFIER_nondet_long() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @__VERIFIER_nondet_long() {
ret i64 undef
}
/* Variables and functions */
int rand();
int get_random(int min, int max) { return rand() % (max - min) + min; }


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_random(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_random(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void putch_color(char c, char attrib) { putchar(c); }


x86 assembly (clang, -O0):
<putch_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch_color>:
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @putch_color(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @putchar(i8 signext %5)
ret void
}

LLVM IR (-O2):
define void @putch_color(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @putchar(i8 signext %0)
ret void
}
__attribute__((no)) int divby5(int i) { return i % 5 == 0; }


x86 assembly (clang, -O0):
<divby5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<divby5>:
imul   $0xcccccccd,%edi,%ecx
add    $0x19999999,%ecx
xor    %eax,%eax
cmp    $0x33333333,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @divby5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 5
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @divby5(i32 %0) {
%2 = srem i32 %0, 5
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int filewidth(char *filename) {
  FILE *f = fopen(filename, "rb");
  unsigned char info[54];
  fread(info, sizeof(unsigned char), 54, f);
  int width = *(int *)&info[18];
  fclose(f);
  return width;
}


x86 assembly (clang, -O0):
<filewidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x36,%edx
call   1030 <fread@plt>
mov    -0x3e(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x54(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filewidth>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x36,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    0x12(%rsp),%ebp
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32 @filewidth(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [54 x i8]
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %3
%8 = getelementptr inbounds [54 x i8], [54 x i8]* %4, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i32 @fread(i8* %8, i32 1, i32 54, i32* %9)
%11 = getelementptr inbounds [54 x i8], [54 x i8]* %4, i64 0, i64 18
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @filewidth(i8* nocapture %0) {
%2 = alloca [54 x i8]
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [54 x i8], [54 x i8]* %2, i64 0, i64 0
%5 = call i32 @fread(i8* %4, i32 1, i32 54, i32* %3)
%6 = getelementptr inbounds [54 x i8], [54 x i8]* %2, i64 0, i64 18
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @fclose(i32* %3)
ret i32 %8
}
void PWMStart(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000044))) |= 0x00008000;
}


x86 assembly (clang, -O0):
<PWMStart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x44(%rax),%rcx
or     $0x8000,%rcx
mov    %rcx,0x44(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMStart>:
orq    $0x1,(%rdi)
orq    $0x8000,0x44(%rdi)
ret

LLVM IR (-O0):
define void @PWMStart(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
store volatile i64 %7, i64* %5
%8 = load i64, i64* %2
%9 = add i64 %8, 68
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 32768
store volatile i64 %12, i64* %10
ret void
}

LLVM IR (-O2):
define void @PWMStart(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = or i64 %3, 1
store volatile i64 %4, i64* %2
%5 = add i64 %0, 68
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = or i64 %7, 32768
store volatile i64 %8, i64* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sat_clause_new(int /*<<< orphan*/ *);
void sat_clause_new_cb(void) { sat_clause_new(NULL); }


x86 assembly (clang, -O0):
<sat_clause_new_cb>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <sat_clause_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_clause_new_cb>:
xor    %edi,%edi
jmp    1030 <sat_clause_new@plt>

LLVM IR (-O0):
define void @sat_clause_new_cb() {
%1 = call i32 @sat_clause_new(i32* null)
ret void
}

LLVM IR (-O2):
define void @sat_clause_new_cb() {
%1 = tail call i32 @sat_clause_new(i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ mktime(struct tm *);
struct tm Time_from_UTC(struct tm *cdate) {
  time_t tdate;
  tdate = mktime(cdate);
  return (*localtime(&tdate));
}


x86 assembly (clang, -O0):
<Time_from_UTC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Time_from_UTC>:
push   %rax
call   1040 <mktime@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @Time_from_UTC(%struct.tm* %0) {
%2 = alloca %struct.tm
%3 = alloca %struct.tm*
%4 = alloca i32
store %struct.tm* %0, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = call i32 @mktime(%struct.tm* %5)
store i32 %6, i32* %4
%7 = call %struct.tm* @localtime(i32* %4)
%8 = bitcast %struct.tm* %2 to i8*
%9 = bitcast %struct.tm* %7 to i8*
%10 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @Time_from_UTC(%struct.tm* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @mktime(%struct.tm* %0)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
void RTSocketGetPeerAddress(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSocketGetPeerAddress() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void display_array(int A[], int start, int end) {
  start--;
  while (start < end)
    printf("%d  %d \n", start, A[++start]);
}


x86 assembly (clang, -O0):
<display_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    115e <display_array+0x4e>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <display_array+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_array>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1158 <display_array+0x48>
mov    %edx,%r15d
mov    %esi,%ebp
add    $0xffffffff,%ebp
movslq %ebp,%rax
lea    (%rdi,%rax,4),%rbx
add    $0x4,%rbx
lea    0xecb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
add    $0x4,%rbx
cmp    %ebp,%r15d
jne    1140 <display_array+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d \0A\00"
define void @display_array(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* %5
%8 = add nsw i32 %7, -1
store i32 %8, i32* %5
br label %9
9: ; preds = %13, %3
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %15, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %20)
br label %9
22: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d \0A\00"
define void @display_array(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = add i32 %1, -1
%7 = sext i32 %6 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %10, %8 ]
%10 = add nsw i64 %9, 1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = trunc i64 %9 to i32
%14 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %12)
%15 = trunc i64 %10 to i32
%16 = icmp eq i32 %15, %2
br i1 %16, label %17, label %8
17: ; preds = %8, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int main() {
  char buf[16];
  printf("Going into endless loop, are you sure (y/n)?\n");
  read(0, buf, sizeof(buf) - 1);
  if (buf[0] == 'y' || buf[0] == 'Y') {
    while (1)
      ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0xf,%edx
call   1040 <read@plt>
movsbl -0x20(%rbp),%eax
cmp    $0x79,%eax
je     1165 <main+0x45>
movsbl -0x20(%rbp),%eax
cmp    $0x59,%eax
jne    116f <main+0x4f>
jmp    116a <main+0x4a>
jmp    116a <main+0x4a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0xf,%edx
call   1040 <read@plt>
mov    (%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
jne    1152 <main+0x32>
nopl   0x0(%rax,%rax,1)
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Going into endless loop, are you sure (y/n)?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 15)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 121
br i1 %9, label %15, label %10
10: ; preds = %0
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 89
br i1 %14, label %15, label %17
15: ; preds = %10, %0
br label %16
16: ; preds = %15, %16
br label %16
17: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@str = [45 x i8] c"Going into endless loop, are you sure (y/n)?\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%4 = call i32 @read(i32 0, i8* %2, i32 15)
%5 = load i8, i8* %2
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 89
br i1 %7, label %8, label %9
8: ; preds = %0, %8
br label %8
9: ; preds = %0
ret i32 0
}
void RTSemRWRequestWriteNoResume(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWRequestWriteNoResume() {
ret void
}
/* Variables and functions */
double mymax(double, int /*<<< orphan*/);
double Bcity(double Value, double Press) {
  double Bcity = Value;
  Press += 0.0;
  Bcity = mymax(Bcity, 0);
  return Bcity;
}


x86 assembly (clang, -O0):
<Bcity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
xor    %edi,%edi
call   1030 <mymax@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bcity>:
xor    %edi,%edi
jmp    1030 <mymax@plt>

LLVM IR (-O0):
define double @Bcity(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
store double %6, double* %5
%7 = load double, double* %4
%8 = fadd double %7, 0.000000e+00
store double %8, double* %4
%9 = load double, double* %5
%10 = call double @mymax(double %9, i32 0)
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @Bcity(double %0, double %1) {
%3 = tail call double @mymax(double %0, i32 0)
ret double %3
}
void ff_get_unscaled_swscale_aarch64() {}


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

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

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

LLVM IR (-O2):
define void @ff_get_unscaled_swscale_aarch64() {
ret void
}
/* Variables and functions */
int sqrt1(int);
int sqrt2(int x) { return sqrt1(x); }


x86 assembly (clang, -O0):
<sqrt2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sqrt1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt2>:
jmp    1030 <sqrt1@plt>

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

LLVM IR (-O2):
define i32 @sqrt2(i32 %0) {
%2 = tail call i32 @sqrt1(i32 %0)
ret i32 %2
}
void relax(void) { __asm__ __volatile__("pause" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @relax() {
tail call void asm sideeffect "pause", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int __raw_readw(int);
int /*<<< orphan*/ __raw_writeb(int, int);
int /*<<< orphan*/ __raw_writew(int, int);
extern void mmcif_update_progress(int nr) {
  __raw_writew(__raw_readw(0xa4050158) & ~(1 << 1), 0xa4050158);
  __raw_writeb(1 << (nr - 1), 0xa405012c);
}


x86 assembly (clang, -O0):
<mmcif_update_progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa4050158,%edi
call   1040 <__raw_readw@plt>
mov    %eax,%edi
and    $0xfffffffd,%edi
mov    $0xa4050158,%esi
call   1030 <__raw_writew@plt>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edi
shl    %cl,%edi
mov    $0xa405012c,%esi
call   1050 <__raw_writeb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmcif_update_progress>:
push   %rbx
mov    %edi,%ebx
mov    $0xa4050158,%edi
call   1040 <__raw_readw@plt>
and    $0xfffffffd,%eax
mov    %eax,%edi
mov    $0xa4050158,%esi
call   1030 <__raw_writew@plt>
add    $0xff,%bl
mov    $0x1,%edi
mov    %ebx,%ecx
shl    %cl,%edi
mov    $0xa405012c,%esi
pop    %rbx
jmp    1050 <__raw_writeb@plt>

LLVM IR (-O0):
define void @mmcif_update_progress(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @__raw_readw(i32 -1543175848)
%4 = and i32 %3, -3
%5 = call i32 @__raw_writew(i32 %4, i32 -1543175848)
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = shl i32 1, %7
%9 = call i32 @__raw_writeb(i32 %8, i32 -1543175892)
ret void
}

LLVM IR (-O2):
define void @mmcif_update_progress(i32 %0) {
%2 = tail call i32 @__raw_readw(i32 -1543175848)
%3 = and i32 %2, -3
%4 = tail call i32 @__raw_writew(i32 %3, i32 -1543175848)
%5 = add nsw i32 %0, -1
%6 = shl nuw i32 1, %5
%7 = tail call i32 @__raw_writeb(i32 %6, i32 -1543175892)
ret void
}
void back(char *hotel_current) { *hotel_current = '\0'; }


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

x86 assembly (clang, -O2):
<back>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @back(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}