xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
unsigned long UARTParityModeGet(unsigned long ulBase) {
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          209);
    }
  };
  return ((*((volatile unsigned long *)(ulBase + 0x0000002C))) &
          (0x00000080 | 0x00000004 | 0x00000002));
}


x86 assembly (clang, -O0):
<UARTParityModeGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    114f <UARTParityModeGet+0x2f>
lea    0xebb(%rip),%rdi
mov    $0xd1,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
and    $0x86,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeGet>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    113e <UARTParityModeGet+0x1e>
lea    0xecc(%rip),%rdi
mov    $0xd1,%esi
call   1030 <AssertFailure@plt>
mov    0x2c(%rbx),%rax
and    $0x86,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define i64 @UARTParityModeGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 209)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = add i64 %9, 44
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 134
ret i64 %13
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
define i64 @UARTParityModeGet(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 209)
br label %6
6: ; preds = %4, %1
%7 = add i64 %0, 44
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 134
ret i64 %10
}
float points(int g1, int g2) {
  if (g1 > g2)
    return 3;
  else if (g1 == g2)
    return 3;
  else
    return 3;
}


x86 assembly (clang, -O0):
<points>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1128 <points+0x28>
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <points+0x53>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1146 <points+0x46>
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1153 <points+0x53>
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<points>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @points(i32 %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store float 3.000000e+00, float* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store float 3.000000e+00, float* %3
br label %16
15: ; preds = %10
store float 3.000000e+00, float* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load float, float* %3
ret float %17
}

LLVM IR (-O2):
define float @points(i32 %0, i32 %1) {
ret float 3.000000e+00
}
int samplestooffset(int s) { return s / 32 * 36 - 3; }


x86 assembly (clang, -O0):
<samplestooffset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
imul   $0x24,%eax,%eax
sub    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<samplestooffset>:
lea    0x1f(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x5,%eax
lea    (%rax,%rax,8),%eax
lea    -0x3(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @samplestooffset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 32
%5 = mul nsw i32 %4, 36
%6 = sub nsw i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @samplestooffset(i32 %0) {
%2 = sdiv i32 %0, 32
%3 = mul nsw i32 %2, 36
%4 = add nsw i32 %3, -3
ret i32 %4
}
/* Type definitions */
typedef char chtype;

/* Variables and functions */
char A_NORMAL;
int /*<<< orphan*/ report_nstr(char *);
void report_byte(chtype c) {
  chtype string[2];
  string[0] = c;
  string[1] = A_NORMAL | '\0';
  report_nstr(string);
}


x86 assembly (clang, -O0):
<report_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
mov    0x2ebd(%rip),%rax
movsbl (%rax),%eax
or     $0x0,%eax
mov    %al,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <report_nstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_byte>:
push   %rax
mov    %dil,0x6(%rsp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%al
mov    %al,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <report_nstr@plt>
pop    %rax
ret

LLVM IR (-O0):
@A_NORMAL = global i8 0
define void @report_byte(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %4, i8* %5
%6 = load i8, i8* @A_NORMAL
%7 = sext i8 %6 to i32
%8 = or i32 %7, 0
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %9, i8* %10
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%12 = call i32 @report_nstr(i8* %11)
ret void
}

LLVM IR (-O2):
@A_NORMAL = global i8 0
define void @report_byte(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = load i8, i8* @A_NORMAL
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %4, i8* %5
%6 = call i32 @report_nstr(i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ mkdir(char const *, int);
scalar_t__ optk_test_dir(char const *);
int optk_create_dir(const char *dirname) {
  if (optk_test_dir(dirname) > 0)
    return 0;
  return (mkdir(dirname, 0777) == 0) ? 1 : -1;
}


x86 assembly (clang, -O0):
<optk_create_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <optk_test_dir@plt>
cmp    $0x0,%rax
jle    114b <optk_create_dir+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1170 <optk_create_dir+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optk_create_dir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <optk_test_dir@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jle    1135 <optk_create_dir+0x15>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
neg    %rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @optk_create_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @optk_test_dir(i8* %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @mkdir(i8* %9, i32 511)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 -1
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @optk_create_dir(i8* %0) {
%2 = tail call i64 @optk_test_dir(i8* %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @mkdir(i8* %0, i32 511)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 1, i32 -1
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  printf("x = %d\n", x);
  int arr[2];
  arr[3] = 10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movl   $0xa,0x0(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
int mprotect(const void *addr, unsigned long long len, int prot) {
  printk("Write mprotect()\n");
  return -1;
}


x86 assembly (clang, -O0):
<mprotect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printk@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mprotect>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printk@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Write mprotect()\0A\00"
define i32 @mprotect(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [18 x i8] c"Write mprotect()\0A\00"
define i32 @mprotect(i8* nocapture readnone %0, i64 %1, i32 %2) {
%4 = tail call i32 @printk(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int test_imm_A7uint8_mem(unsigned char *val) {
  return ((*val) & (0xA7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A7uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xa7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A7uint8_mem>:
testb  $0xa7,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A7uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -89
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ islower(int);
void t_islower_0x65() {
  Assert_real((islower(101)),
              "/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/ctype/test_islower.c",
              510, ("islower should be 1 for e"));
}


x86 assembly (clang, -O0):
<t_islower_0x65>:
push   %rbp
mov    %rsp,%rbp
mov    $0x65,%edi
call   1030 <islower@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1fe,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x65>:
push   %rax
mov    $0x65,%edi
call   1030 <islower@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1fe,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for e\00"
define void @t_islower_0x65() {
%1 = call i32 @islower(i32 101)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 1 for e\00"
define void @t_islower_0x65() {
%1 = tail call i32 @islower(i32 101)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int intCmp(const void *va, const void *vb) {
  const int *a = va;
  const int *b = vb;
  int diff = *a - *b;
  if (diff < 0)
    return -1;
  else if (diff > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<intCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1141 <intCmp+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <intCmp+0x5e>
cmpl   $0x0,-0x2c(%rbp)
jle    1157 <intCmp+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <intCmp+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intCmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @intCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = icmp sgt i32 %7, -1
%11 = select i1 %10, i32 %9, i32 -1
ret i32 %11
}
int cfunc(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @cfunc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @cfunc() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, unsigned int);
void cachesync(unsigned v) { print("cachesync called %u\n", v); }


x86 assembly (clang, -O0):
<cachesync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cachesync>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <print@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"cachesync called %u\0A\00"
define void @cachesync(i32 %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CloseHandle(int);
void kiss_platform_serial_close(int handle) { CloseHandle(handle); }


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

x86 assembly (clang, -O2):
<kiss_platform_serial_close>:
jmp    1030 <CloseHandle@plt>

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

LLVM IR (-O2):
define void @kiss_platform_serial_close(i32 %0) {
%2 = tail call i32 @CloseHandle(i32 %0)
ret void
}
void XtVaAppCreateShell() {}


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

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

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

LLVM IR (-O2):
define void @XtVaAppCreateShell() {
ret void
}
void swap(int *a, int *b) {
  *a = 100;
  *b = 200;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xc8,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movl   $0x64,(%rdi)
movl   $0xc8,(%rsi)
ret

LLVM IR (-O0):
define void @swap(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
store i32 100, i32* %5
%6 = load i32*, i32** %4
store i32 200, i32* %6
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 100, i32* %0
store i32 200, i32* %1
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_bpcharcopyfunc(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_bpcharcopyfunc() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_bpcharcopyfunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR7F_set(void) { return U_WMRCORENONE_set("U_WMR7F"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR7F\00"
define i8* @U_WMR7F_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR7F\00"
define i8* @U_WMR7F_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, ...);
void hello(char *buffer, const char *name) {
  if (name == NULL)
    sprintf(buffer, "Hello, World!");
  else
    sprintf(buffer, "Hello, %s!", name);
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <hello+0x32>
mov    -0x8(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1158 <hello+0x48>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
test   %rsi,%rsi
je     1126 <hello+0x16>
mov    %rsi,%rdx
lea    0xeef(%rip),%rsi
xor    %eax,%eax
jmp    1030 <sprintf@plt>
movabs $0x21646c726f5720,%rax
mov    %rax,0x6(%rdi)
movabs $0x57202c6f6c6c6548,%rax
2c 20 57
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
@.str.1 = [11 x i8] c"Hello, %s!\00"
define void @hello(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
@.str.1 = [11 x i8] c"Hello, %s!\00"
define void @hello(i8* nocapture writeonly %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(14) %0, i8* align 1 dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 14, i1 false)
br label %7
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %5, %4
ret void
}
void auto_filetype_function(void) {}


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

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

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

LLVM IR (-O2):
define void @auto_filetype_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintError(char *);
int /*<<< orphan*/ exit(int);
void FatalPrintError(char *msg) {
  PrintError(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<FatalPrintError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PrintError@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<FatalPrintError>:
push   %rax
call   1030 <PrintError@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @FatalPrintError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @PrintError(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @FatalPrintError(i8* %0) {
%2 = tail call i32 @PrintError(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ i2c_init();
void eeprom_driver_init(void) { i2c_init(); }


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

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

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

LLVM IR (-O2):
define void @eeprom_driver_init() {
%1 = tail call i32 (...) @i2c_init()
ret void
}
/* Variables and functions */
double log10(double);
double Double_log10(double x) { return log10(x); }


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

x86 assembly (clang, -O2):
<Double_log10>:
jmp    1030 <log10@plt>

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

LLVM IR (-O2):
define double @Double_log10(double %0) {
%2 = tail call double @log10(double %0)
ret double %2
}
/* Variables and functions */
int shmdt(char *);
int w2h_shm_del(char *shm_addr) {
  int res;
  res = shmdt(shm_addr);
  if (res)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<w2h_shm_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <shmdt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     113e <w2h_shm_del+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <w2h_shm_del+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w2h_shm_del>:
push   %rax
call   1030 <shmdt@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @w2h_shm_del(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
%3 = icmp ne i32 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *getcwd(char *, int);
char *iposix_getcwd(char *path, int size) { return getcwd(path, size); }


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

x86 assembly (clang, -O2):
<iposix_getcwd>:
jmp    1030 <getcwd@plt>

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

LLVM IR (-O2):
define i8* @iposix_getcwd(i8* %0, i32 %1) {
%3 = tail call i8* @getcwd(i8* %0, i32 %1)
ret i8* %3
}
int xmlUCSIsArrows(int code) {
  return (((code >= 0x2190) && (code <= 0x21FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsArrows>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2190,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsArrows+0x26>
cmpl   $0x21ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsArrows>:
add    $0xffffde70,%edi
xor    %eax,%eax
cmp    $0x70,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsArrows(i32 %0) {
%2 = add i32 %0, -8592
%3 = icmp ult i32 %2, 112
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void echint(int *a, int *b) {
  printf("avant a,b : %d,%d\n", *a, *b);
  int *t;
  *t = *a;
  *a = *b;
  *b = *t;
  printf("apres a,b : %d,%d\n", *a, *b);
}


x86 assembly (clang, -O0):
<echint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echint>:
push   %rax
mov    (%rdi),%eax
mov    (%rsi),%edx
lea    0xee4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"avant a,b : %d,%d\0A\00"
@.str.1 = [19 x i8] c"apres a,b : %d,%d\0A\00"
define void @echint(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
store i32 %18, i32* %19
%20 = load i32*, i32** %3
%21 = load i32, i32* %20
%22 = load i32*, i32** %4
%23 = load i32, i32* %22
%24 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"avant a,b : %d,%d\0A\00"
define void @echint(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
unreachable
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *xopen(char const *, int, int);
void *output_fd_open(const char *path, const char *filter_prog,
                     const char *filter_prog_args) {
  assert(filter_prog == NULL);
  return xopen(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
}


x86 assembly (clang, -O0):
<output_fd_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
mov    0x2e8d(%rip),%rax
or     (%rax),%esi
mov    $0x1a4,%edx
call   1030 <xopen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_fd_open>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rsi,%rsi
sete   %dil
call   1040 <assert@plt>
mov    0x2e8f(%rip),%rax
mov    0x2eb8(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ea5(%rip),%rax
or     (%rax),%esi
mov    %rbx,%rdi
mov    $0x1a4,%edx
pop    %rbx
jmp    1030 <xopen@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i8* @output_fd_open(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %4
%12 = load i32, i32* @O_WRONLY
%13 = load i32, i32* @O_CREAT
%14 = or i32 %12, %13
%15 = load i32, i32* @O_TRUNC
%16 = or i32 %14, %15
%17 = call i8* @xopen(i8* %11, i32 %16, i32 420)
ret i8* %17
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i8* @output_fd_open(i8* %0, i8* readnone %1, i8* nocapture readnone %2) {
%4 = icmp eq i8* %1, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i32, i32* @O_WRONLY
%8 = load i32, i32* @O_CREAT
%9 = or i32 %8, %7
%10 = load i32, i32* @O_TRUNC
%11 = or i32 %9, %10
%12 = tail call i8* @xopen(i8* %0, i32 %11, i32 420)
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ func();
void bar(void) { func(); }


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

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

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

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @func()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int main() {
  while (1) {
    int x = 1;
    if (x)
      __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1137 <main+0x27>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_error@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @__VERIFIER_error()
br label %1
}
void memcpy4(unsigned char *dst) {}


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

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

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

LLVM IR (-O2):
define void @memcpy4(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t byte_swap32(uint32_t k) {
  return (k << 24) | ((k & 0xff00) << 8) | ((k >> 8) & 0xff00) | (k >> 24);
}


x86 assembly (clang, -O0):
<byte_swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_swap32>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @byte_swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = and i32 %5, 65280
%7 = shl i32 %6, 8
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = and i32 %10, 65280
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @byte_swap32(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int main(void) {
  char msg[80];
  while (fgets(msg, 80, stdin)) {
    encrypt(msg);
    printf("%s", msg);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    -0x60(%rbp),%rdi
call   1040 <encrypt@plt>
lea    -0x60(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    0x2ea8(%rip),%r15
mov    (%r15),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
je     1188 <main+0x58>
mov    %rsp,%rbx
lea    0xea1(%rip),%r14
nop
mov    %rbx,%rdi
call   1040 <encrypt@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i64 @fgets(i8* %4, i32 80, i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = call i32 @encrypt(i8* %9)
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i64 @fgets(i8* %2, i32 80, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = call i32 @encrypt(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = load i32, i32* @stdin
%10 = call i64 @fgets(i8* %2, i32 80, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int strerror_r(int, char *, size_t);
char *xsi_strerror(int errnum, char *buf, size_t buflen) {
  int rv;
  rv = strerror_r(errnum, buf, buflen);
  if (rv != 0) {
    if (buflen > 0) {
      buf[0] = '\0';
    }
  }
  return buf;
}


x86 assembly (clang, -O0):
<xsi_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strerror_r@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1157 <xsi_strerror+0x47>
cmpq   $0x0,-0x18(%rbp)
jbe    1152 <xsi_strerror+0x42>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1157 <xsi_strerror+0x47>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsi_strerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
call   1030 <strerror_r@plt>
test   %rbx,%rbx
je     112c <xsi_strerror+0x1c>
test   %eax,%eax
je     112c <xsi_strerror+0x1c>
movb   $0x0,(%r14)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @xsi_strerror(i32 %0, i8* returned %1, i64 %2) {
%4 = tail call i32 @strerror_r(i32 %0, i8* %1, i64 %2)
%5 = icmp ne i32 %4, 0
%6 = icmp ne i64 %2, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %9
8: ; preds = %3
store i8 0, i8* %1
br label %9
9: ; preds = %8, %3
ret i8* %1
}
int avx512f_os_support(void) {
  unsigned int eax, edx;
  __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(0));
  return (eax & 230) == 230;
}


x86 assembly (clang, -O0):
<avx512f_os_support>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
xgetbv
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xe6,%eax
cmp    $0xe6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<avx512f_os_support>:
xor    %ecx,%ecx
xgetbv
not    %eax
xor    %ecx,%ecx
test   $0xe6,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @avx512f_os_support() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = and i32 %6, 230
%8 = icmp eq i32 %7, 230
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @avx512f_os_support() {
%1 = tail call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = extractvalue { i32, i32 } %1, 0
%3 = and i32 %2, 230
%4 = icmp eq i32 %3, 230
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double log(double);
int freq_to_midi(double f) {
  int midi;
  midi = (int)(0.5 + 69.0 + 12.0 / log(2.0) * log(f / 440.0));
  return (midi);
}


x86 assembly (clang, -O0):
<freq_to_midi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef3(%rip),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xedb(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe98(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freq_to_midi>:
push   %rax
divsd  0xee7(%rip),%xmm0
call   1030 <log@plt>
mulsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @freq_to_midi(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = call double @log(double 2.000000e+00)
%5 = fdiv double 1.200000e+01, %4
%6 = load double, double* %2
%7 = fdiv double %6, 4.400000e+02
%8 = call double @log(double %7)
%9 = call double @llvm.fmuladd.f64(double %5, double %8, double 6.950000e+01)
%10 = fptosi double %9 to i32
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @freq_to_midi(double %0) {
%2 = fdiv double %0, 4.400000e+02
%3 = tail call double @log(double %2)
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x40314FF58BE0A23F, double 6.950000e+01)
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int util_api_file_exist(char *filename) {
  int ret;
  struct stat st;
  ret = stat(filename, &st);
  if (ret < 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<util_api_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1142 <util_api_file_exist+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <util_api_file_exist+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_api_file_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
not    %eax
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @util_api_file_exist(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.stat
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %5)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @util_api_file_exist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = xor i32 %4, -1
%6 = lshr i32 %5, 31
ret i32 %6
}
unsigned xrop3_24_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk1 = S ^ T;
  stk2 = T ^ D;
  stk1 = stk1 & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_24_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_24_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %ecx,%edx
xor    %eax,%edx
mov    %ecx,%edi
xor    $0xff,%edi
and    %edx,%edi
not    %ecx
or     %eax,%ecx
and    %edi,%ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_24_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %7
%26 = load i32, i32* %5
%27 = xor i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_24_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, %4
%8 = xor i32 %6, 255
%9 = and i32 %7, %8
%10 = xor i32 %6, -1
%11 = or i32 %4, %10
%12 = and i32 %9, %11
%13 = xor i32 %4, -1
%14 = and i32 %13, %5
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ a(int);
void *thread2(void *arg) {
  a(1);
  return 0;
}


x86 assembly (clang, -O0):
<thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <a@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread2>:
push   %rax
mov    $0x1,%edi
call   1030 <a@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thread2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @a(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread2(i8* nocapture readnone %0) {
%2 = tail call i32 @a(i32 1)
ret i8* null
}