xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xa9() {
  Assert_real((isodigit(169) == 0),
              "/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_isodigit.c",
              850, ("isodigit should be 0 for 0xa9"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xa9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa9,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x352,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xa9>:
push   %rax
mov    $0xa9,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x352,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa9\00"
define void @t_isodigit_0xa9() {
%1 = call i64 @isodigit(i32 169)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa9\00"
define void @t_isodigit_0xa9() {
%1 = tail call i64 @isodigit(i32 169)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ charToString(char);
int /*<<< orphan*/ test(int /*<<< orphan*/, char *);
void testCharToString(void) { test(charToString('x'), "x"); }


x86 assembly (clang, -O0):
<testCharToString>:
push   %rbp
mov    %rsp,%rbp
mov    $0x78,%edi
call   1030 <charToString@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCharToString>:
push   %rax
mov    $0x78,%edi
call   1030 <charToString@plt>
lea    0xece(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"x\00"
define void @testCharToString() {
%1 = call i32 @charToString(i8 signext 120)
%2 = call i32 @test(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"x\00"
define void @testCharToString() {
%1 = tail call i32 @charToString(i8 signext 120)
%2 = tail call i32 @test(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void writecb(struct bufferevent *bev, void *conn_) {}


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

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

LLVM IR (-O0):
%struct.bufferevent = type opaque
define void @writecb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type opaque
define void @writecb(%struct.bufferevent* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf4(int f, int n) { return (cbuf(f, n, 4)); }


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

x86 assembly (clang, -O2):
<cbuf4>:
mov    $0x4,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf4(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 4)
ret i32 %3
}
int secure_storage_init(void) { return -1; }


x86 assembly (clang, -O0):
<secure_storage_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @secure_storage_init() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @secure_storage_init() {
ret i32 -1
}
/* Variables and functions */
double ltlg1(double, double);
double rtlg1(double a, double x) { return 1.0 - ltlg1(a, x); }


x86 assembly (clang, -O0):
<rtlg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <ltlg1@plt>
movaps %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtlg1>:
push   %rax
call   1030 <ltlg1@plt>
movsd  0xee2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rtlg1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @ltlg1(double %5, double %6)
%8 = fsub double 1.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @rtlg1(double %0, double %1) {
%3 = tail call double @ltlg1(double %0, double %1)
%4 = fsub double 1.000000e+00, %3
ret double %4
}
void rop3_210_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_210_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_210_1_0>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
and    %sil,%r8b
mov    %esi,%eax
not    %al
and    %al,%cl
xor    %dl,%cl
and    %al,%cl
or     %r8b,%cl
mov    %cl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_210_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
%8 = and i8 %5, %1
%9 = and i8 %7, %4
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
void omap_bandgap_prepare_for_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_bandgap_prepare_for_idle() {
ret void
}
unsigned long long __round_up_pow2(unsigned int a) {
  return 1ull << (sizeof(a) * 8 - __builtin_clz(a));
}


x86 assembly (clang, -O0):
<__round_up_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cltq
mov    $0x20,%ecx
sub    %rax,%rcx
mov    $0x1,%eax
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__round_up_pow2>:
bsr    %edi,%ecx
xor    $0x1f,%ecx
add    $0x20,%ecx
neg    %ecx
mov    $0x1,%eax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @__round_up_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sext i32 %4 to i64
%6 = sub i64 32, %5
%7 = shl i64 1, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @__round_up_pow2(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = sub nuw nsw i32 32, %2
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
ret i64 %5
}
/* Variables and functions */
void *excl_dlrealloc(void *, size_t);
void *realloc(void *ptr, size_t sz) { return excl_dlrealloc(ptr, sz); }


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

x86 assembly (clang, -O2):
<realloc>:
jmp    1030 <excl_dlrealloc@plt>

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

LLVM IR (-O2):
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @excl_dlrealloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int print_usage(char *name) {
  printf("Usage: %s shellcode program [-h -v]\n", name);
  return 0;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: %s shellcode program [-h -v]\0A\00"
define i32 @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: %s shellcode program [-h -v]\0A\00"
define i32 @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct tm {
  int dummy;
};

/* Variables and functions */
size_t __wcsftime_l(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ const *,
                    struct tm const *, int /*<<< orphan*/);
size_t wcsftime(wchar_t *restrict wcs, size_t n, const wchar_t *restrict f,
                const struct tm *restrict tm) {
  return __wcsftime_l(wcs, n, f, tm, 0);
}


x86 assembly (clang, -O0):
<wcsftime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <__wcsftime_l@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsftime>:
xor    %r8d,%r8d
jmp    1030 <__wcsftime_l@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @wcsftime(i32* noalias %0, i64 %1, i32* noalias %2, %struct.tm* noalias %3) {
%5 = tail call i64 @__wcsftime_l(i32* %0, i64 %1, i32* %2, %struct.tm* %3, i32 0)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  char *s = "A\tX";
  if (s[0] != 'A' || s[1] != '\t' || s[2] != 'X' || s[3])
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jne    116d <main+0x5d>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x9,%eax
jne    116d <main+0x5d>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x58,%eax
jne    116d <main+0x5d>
mov    -0x10(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x0,%eax
je     1174 <main+0x64>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"A\09X\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 65
br i1 %7, label %26, label %8
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 9
br i1 %13, label %26, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 88
br i1 %19, label %26, label %20
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %20, %14, %8, %0
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
ushort my_htons(ushort hostshort) { return htons(hostshort); }


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

x86 assembly (clang, -O2):
<my_htons>:
jmp    1030 <htons@plt>

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

LLVM IR (-O2):
define i32 @my_htons(i32 %0) {
%2 = tail call i32 @htons(i32 %0)
ret i32 %2
}
extern void libvampsdk_v_2_6_present(void) {}


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

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

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

LLVM IR (-O2):
define void @libvampsdk_v_2_6_present() {
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float asinhf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<asinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @asinhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @asinhf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
int funcA1(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<funcA1>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @funcA1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @funcA1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void structSample2() {
  struct A {
    int a;
    char b;
    short c;
  };
  struct B {
    char b;
    int a;
    short c;
  };
  printf("sizeof(A)=%d\n", sizeof(struct A));
  printf("sizeof(B)=%d\n", sizeof(struct B));
}


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

x86 assembly (clang, -O2):
<structSample2>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0xc,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"sizeof(A)=%d\0A\00"
@.str.1 = [14 x i8] c"sizeof(B)=%d\0A\00"
define void @structSample2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"sizeof(A)=%d\0A\00"
@.str.1 = [14 x i8] c"sizeof(B)=%d\0A\00"
define void @structSample2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 12)
ret void
}
int main() {
  int x = 0, y = 0, N;
  while (1) {
    if (x) {
      x += 2;
      y++;
    } else {
      x += 4;
      y = y;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ sbi_ecall_sbi_putchar(int);
void console_putc(int chr) { sbi_ecall_sbi_putchar(chr); }


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

x86 assembly (clang, -O2):
<console_putc>:
jmp    1030 <sbi_ecall_sbi_putchar@plt>

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

LLVM IR (-O2):
define void @console_putc(i32 %0) {
%2 = tail call i32 @sbi_ecall_sbi_putchar(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ stdlib_strided_dnanvariancewd(int /*<<< orphan*/ const,
                                                 double const, double const *,
                                                 int /*<<< orphan*/ const);
double stdlib_strided_dnanstdevwd(const int64_t N, const double correction,
                                  const double *X, const int64_t stride) {
  return sqrt(stdlib_strided_dnanvariancewd(N, correction, X, stride));
}


x86 assembly (clang, -O0):
<stdlib_strided_dnanstdevwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <stdlib_strided_dnanvariancewd@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dnanstdevwd>:
push   %rax
call   1030 <stdlib_strided_dnanvariancewd@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @stdlib_strided_dnanstdevwd(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load double, double* %6
%11 = load double*, double** %7
%12 = load i32, i32* %8
%13 = call i32 @stdlib_strided_dnanvariancewd(i32 %9, double %10, double* %11, i32 %12)
%14 = call double @sqrt(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @stdlib_strided_dnanstdevwd(i32 %0, double %1, double* %2, i32 %3) {
%5 = tail call i32 @stdlib_strided_dnanvariancewd(i32 %0, double %1, double* %2, i32 %3)
%6 = tail call double @sqrt(i32 %5)
ret double %6
}
void double_to_ui(double x, unsigned int *p) { p[3] = x; }


x86 assembly (clang, -O0):
<double_to_ui>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_ui>:
cvttsd2si %xmm0,%rax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @double_to_ui(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
store double %0, double* %3
store i32* %1, i32** %4
%5 = load double, double* %3
%6 = fptoui double %5 to i32
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 3
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @double_to_ui(double %0, i32* nocapture writeonly %1) {
%3 = fptoui double %0 to i32
%4 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %3, i32* %4
ret void
}
/* Type definitions */
struct blt_image {
  int dummy;
};
struct blt_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct blt_image *);
void destroy(struct blt_context *ctx, struct blt_image *img) { free(img); }


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

x86 assembly (clang, -O2):
<destroy>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.blt_context = type { i32 }
%struct.blt_image = type { i32 }
define void @destroy(%struct.blt_context* %0, %struct.blt_image* %1) {
%3 = alloca %struct.blt_context*
%4 = alloca %struct.blt_image*
store %struct.blt_context* %0, %struct.blt_context** %3
store %struct.blt_image* %1, %struct.blt_image** %4
%5 = load %struct.blt_image*, %struct.blt_image** %4
%6 = call i32 @free(%struct.blt_image* %5)
ret void
}

LLVM IR (-O2):
%struct.blt_context = type { i32 }
%struct.blt_image = type { i32 }
define void @destroy(%struct.blt_context* nocapture readnone %0, %struct.blt_image* nocapture %1) {
%3 = tail call i32 @free(%struct.blt_image* %1)
ret void
}
/* Variables and functions */
float expf(float);
float coshf(float x) { return .5f * (expf(x) + expf(-x)); }


x86 assembly (clang, -O0):
<coshf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <expf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <expf@plt>
movss  -0x8(%rbp),%xmm1
addss  %xmm0,%xmm1
movss  0xeac(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coshf>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <expf@plt>
movss  %xmm0,0xc(%rsp)
movaps 0x10(%rsp),%xmm0
xorps  0xed0(%rip),%xmm0
call   1030 <expf@plt>
addss  0xc(%rsp),%xmm0
mulss  0xecd(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @coshf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @expf(float %3)
%5 = load float, float* %2
%6 = fneg float %5
%7 = call float @expf(float %6)
%8 = fadd float %4, %7
%9 = fmul float 5.000000e-01, %8
ret float %9
}

LLVM IR (-O2):
define float @coshf(float %0) {
%2 = tail call float @expf(float %0)
%3 = fneg float %0
%4 = tail call float @expf(float %3)
%5 = fadd float %2, %4
%6 = fmul float %5, 5.000000e-01
ret float %6
}
/* Variables and functions */
char *Util_strlower(char *s) {
  char *p;
  for (p = s; *p != '\0'; p++)
    if (*p >= 'A' && *p <= 'Z')
      *p += 'a' - 'A';
  return s;
}


x86 assembly (clang, -O0):
<Util_strlower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <Util_strlower+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <Util_strlower+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <Util_strlower+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1151 <Util_strlower+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <Util_strlower+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Util_strlower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <Util_strlower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <Util_strlower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <Util_strlower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <Util_strlower+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <Util_strlower+0x10>
ret

LLVM IR (-O0):
define i8* @Util_strlower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %27, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %30
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
br label %27
27: ; preds = %26
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %5
30: ; preds = %5
%31 = load i8*, i8** %2
ret i8* %31
}

LLVM IR (-O2):
define i8* @Util_strlower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
void f(int n, int m, int *p, int *q) {
  while (n > 0) {
    ++(*p);
  }
  do {
    ++(*q);
  } while (m > 0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112c <f+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1112 <f+0x12>
jmp    1131 <f+0x31>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <f+0x31>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rcx),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
test   %esi,%esi
jg     1110 <f+0x10>
mov    %eax,(%rcx)
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = icmp slt i32 %0, 1
%6 = load i32, i32* %3
%7 = icmp sgt i32 %1, 0
br label %8
8: ; preds = %4, %8
%9 = phi i32 [ %6, %4 ], [ %10, %8 ]
%10 = add nsw i32 %9, 1
br i1 %7, label %8, label %11
11: ; preds = %8
store i32 %10, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long double);
int /*<<< orphan*/ scanf(char *, long double *, long double *);
int main() {
  long double a, b;
  scanf("%Lf%Lf", &a, &b);
  printf("%0.0Lf", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <scanf@plt>
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rdi
lea    0x20(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
fldt   0x20(%rsp)
fldt   0x10(%rsp)
faddp  %st,%st(1)
fstpt  (%rsp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%Lf%Lf\00"
@.str.1 = [7 x i8] c"%0.0Lf\00"
define i32 @main() {
%1 = alloca x86_fp80
%2 = alloca x86_fp80
%3 = bitcast x86_fp80* %1 to i8*
%4 = bitcast x86_fp80* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), x86_fp80* %1, x86_fp80* %2)
%6 = load x86_fp80, x86_fp80* %1
%7 = load x86_fp80, x86_fp80* %2
%8 = fadd x86_fp80 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %8)
ret i32 0
}
int fun231() { return 231; }


x86 assembly (clang, -O0):
<fun231>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun231() {
ret i32 231
}

LLVM IR (-O2):
define i32 @fun231() {
ret i32 231
}
extern double ReturnDouble() { return 99.9; }


x86 assembly (clang, -O0):
<ReturnDouble>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ReturnDouble() {
ret double 9.990000e+01
}

LLVM IR (-O2):
define double @ReturnDouble() {
ret double 9.990000e+01
}
int main_p1(void) {
  volatile int i = 0;
  for (;;) {
    i++;
  }
}


x86 assembly (clang, -O0):
<main_p1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    110b <main_p1+0xb>

x86 assembly (clang, -O2):
<main_p1>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
jmp    1110 <main_p1+0x10>

LLVM IR (-O0):
define i32 @main_p1() {
%1 = alloca i32
store volatile i32 0, i32* %1
br label %2
2: ; preds = %2, %0
%3 = load volatile i32, i32* %1
%4 = add nsw i32 %3, 1
store volatile i32 %4, i32* %1
br label %2
}

LLVM IR (-O2):
define i32 @main_p1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = add nsw i32 %4, 1
store volatile i32 %5, i32* %1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_vec_cmpne(int, int);
int /*<<< orphan*/ __builtin_vec_ld(int, int);
int /*<<< orphan*/ __builtin_vec_st(int, int /*<<< orphan*/, int);
void foo(void) {
  __builtin_vec_ld(1, 2);
  __builtin_vec_cmpne(1, 2);
  __builtin_vec_st(1, 0, 5);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <__builtin_vec_ld@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <__builtin_vec_cmpne@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <__builtin_vec_st@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <__builtin_vec_ld@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <__builtin_vec_cmpne@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x5,%edx
pop    %rax
jmp    1040 <__builtin_vec_st@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @__builtin_vec_ld(i32 1, i32 2)
%2 = call i32 @__builtin_vec_cmpne(i32 1, i32 2)
%3 = call i32 @__builtin_vec_st(i32 1, i32 0, i32 5)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @__builtin_vec_ld(i32 1, i32 2)
%2 = tail call i32 @__builtin_vec_cmpne(i32 1, i32 2)
%3 = tail call i32 @__builtin_vec_st(i32 1, i32 0, i32 5)
ret void
}
int xmlUCSIsSyriac(int code) {
  return (((code >= 0x0700) && (code <= 0x074F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsSyriac>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x700,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsSyriac+0x26>
cmpl   $0x74f,-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):
<xmlUCSIsSyriac>:
add    $0xfffff900,%edi
xor    %eax,%eax
cmp    $0x50,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsSyriac(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 1792
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 1871
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 @xmlUCSIsSyriac(i32 %0) {
%2 = add i32 %0, -1792
%3 = icmp ult i32 %2, 80
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int put_user(int, int *);
int ioctl_return(int *addr, int value) {
  return value < 0 ? value : put_user(value, addr);
}


x86 assembly (clang, -O0):
<ioctl_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1134 <ioctl_return+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <ioctl_return+0x33>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <put_user@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioctl_return>:
test   %esi,%esi
js     1121 <ioctl_return+0x11>
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <put_user@plt>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @ioctl_return(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @put_user(i32 %1, i32* %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ _sl_MaybeCloseFile();
void sl_CloseLogFile(void) { _sl_MaybeCloseFile(); }


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

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

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

LLVM IR (-O2):
define void @sl_CloseLogFile() {
%1 = tail call i32 (...) @_sl_MaybeCloseFile()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("pthread_demo: pthreads not available\n");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"pthread_demo: pthreads not available\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"pthread_demo: pthreads not available\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
scalar_t__ fileExists(char const *);
scalar_t__ stat(char const *, struct stat *);
time_t getFileModificationTime(const char *fileName) {
  struct stat st;
  if (fileExists(fileName)) {
    if (stat(fileName, &st) == 0) {
      return st.st_mtime;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<getFileModificationTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileExists@plt>
cmp    $0x0,%rax
je     1166 <getFileModificationTime+0x46>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    1161 <getFileModificationTime+0x41>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <getFileModificationTime+0x4d>
jmp    1166 <getFileModificationTime+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFileModificationTime>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fileExists@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1145 <getFileModificationTime+0x25>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <stat@plt>
test   %rax,%rax
jne    1145 <getFileModificationTime+0x25>
mov    (%rsp),%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @getFileModificationTime(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i64 @fileExists(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = call i64 @stat(i8* %0, %struct.stat* %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
br label %12
12: ; preds = %1, %6, %9
%13 = phi i32 [ %11, %9 ], [ 0, %6 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ hello();
main() { hello(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello()
ret i32 0
}
/* Variables and functions */
int popcount_16(unsigned int);
int popcount_32(unsigned int v) {
  return popcount_16(v >> 16) + popcount_16(v);
}


x86 assembly (clang, -O0):
<popcount_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
call   1030 <popcount_16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <popcount_16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount_32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
shr    $0x10,%edi
call   1030 <popcount_16@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <popcount_16@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @popcount_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = call i32 @popcount_16(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @popcount_16(i32 %6)
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @popcount_32(i32 %0) {
%2 = lshr i32 %0, 16
%3 = tail call i32 @popcount_16(i32 %2)
%4 = tail call i32 @popcount_16(i32 %0)
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f5(unsigned int x, unsigned int y) {
  unsigned int r = x + y;
  if (r >= x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     113a <f5+0x2a>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rbx
mov    %edi,%ebx
add    %esi,%ebx
jb     111e <f5+0xe>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f5(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* %4
%8 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp uge i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @f5(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = icmp ult i32 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
int hea_u64_bit(int);
int hea_test_u64_bit(__u64 v, int b) { return !!(v & hea_u64_bit(b)); }


x86 assembly (clang, -O0):
<hea_test_u64_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hea_u64_bit@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_test_u64_bit>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <hea_u64_bit@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hea_test_u64_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @hea_u64_bit(i32 %6)
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @hea_test_u64_bit(i32 %0, i32 %1) {
%3 = tail call i32 @hea_u64_bit(i32 %1)
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int f(int a, int b, int *d) {
  int c = a + b;
  *d = (c == 0);
  return c < 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x14(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
xor    %ecx,%ecx
add    %esi,%eax
sete   %cl
mov    %ecx,(%rdx)
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %1, %0
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = lshr i32 %4, 31
ret i32 %7
}