xunge/DecIR huggingface dataset:
/* Type definitions */
struct spi_transaction_dev {
  int dummy;
};

/* Variables and functions */
int do_transaction(struct spi_transaction_dev *, unsigned int, unsigned int,
                   unsigned char *, int);
int spi_transaction_write(struct spi_transaction_dev *dev, unsigned int addr,
                          unsigned int size, unsigned char *data) {
  return do_transaction(dev, addr, size, data, (size > 4) ? 0x04 : 0x00);
}


x86 assembly (clang, -O0):
<spi_transaction_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r9d
xor    %r8d,%r8d
mov    $0x4,%eax
cmp    $0x4,%r9d
cmova  %eax,%r8d
call   1030 <do_transaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_transaction_write>:
xor    %r8d,%r8d
cmp    $0x5,%edx
setae  %r8b
shl    $0x2,%r8d
jmp    1030 <do_transaction@plt>

LLVM IR (-O0):
%struct.spi_transaction_dev = type { i32 }
define i32 @spi_transaction_write(%struct.spi_transaction_dev* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.spi_transaction_dev*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.spi_transaction_dev* %0, %struct.spi_transaction_dev** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load %struct.spi_transaction_dev*, %struct.spi_transaction_dev** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = load i32, i32* %7
%14 = icmp ugt i32 %13, 4
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 4, i32 0
%17 = call i32 @do_transaction(%struct.spi_transaction_dev* %9, i32 %10, i32 %11, i8* %12, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.spi_transaction_dev = type { i32 }
define i32 @spi_transaction_write(%struct.spi_transaction_dev* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp ugt i32 %2, 4
%6 = select i1 %5, i32 4, i32 0
%7 = tail call i32 @do_transaction(%struct.spi_transaction_dev* %0, i32 %1, i32 %2, i8* %3, i32 %6)
ret i32 %7
}
int strlen_for_utf8_display(char *str) {
  int len = 0;
  for (char *p = str; *p; p++) {
    if ((*p & 0xc0) != 0x80)
      len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen_for_utf8_display>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <strlen_for_utf8_display+0x5a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     1144 <strlen_for_utf8_display+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <strlen_for_utf8_display+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <strlen_for_utf8_display+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_for_utf8_display>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <strlen_for_utf8_display+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strlen_for_utf8_display+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen_for_utf8_display(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %2, %1 ]
%8 = phi i8* [ %14, %6 ], [ %0, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = and i8 %7, -64
%11 = icmp ne i8 %10, -128
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %9, %12
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %4, label %6
}
void imx_configure_tzasc(void) {}


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

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

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

LLVM IR (-O2):
define void @imx_configure_tzasc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_MD_C and/or MBEDTLS_ENTROPY_C and/or "
         "MBEDTLS_RSA_C and/or MBEDTLS_SHA256_C and/or "
         "MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or "
         "MBEDTLS_CTR_DRBG_C not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [170 x i8] c"MBEDTLS_MD_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_RSA_C and/or MBEDTLS_SHA256_C and/or MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [169 x i8] c"MBEDTLS_MD_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_RSA_C and/or MBEDTLS_SHA256_C and/or MBEDTLS_PK_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_CTR_DRBG_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([169 x i8], [169 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ x();
scalar_t__ y();
f() { x() || y(); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <x@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1152 <f+0x32>
mov    $0x0,%al
call   1040 <y@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %eax,%eax
call   1030 <x@plt>
test   %rax,%rax
je     112f <f+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <y@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
%2 = call i64 (...) @x()
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @y()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ true, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i64 (...) @x()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i64 (...) @y()
br label %5
5: ; preds = %3, %0
ret i32 undef
}
int show_d2199_block_info(unsigned int block_id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @show_d2199_block_info(i32 %0) {
ret i32 0
}
void *test_anti_range_53(int n) {
  extern void *alloc_anti_range_53(int) __attribute__((alloc_size(1)));
  if (0x7fffffff - 1 <= n && n <= 0x7fffffff - 1)
    n = 0x7fffffff - 1 - 1;
  return alloc_anti_range_53(n);
}


x86 assembly (clang, -O0):
<test_anti_range_53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7ffffffe,%eax
cmp    -0x4(%rbp),%eax
jg     113d <test_anti_range_53+0x2d>
cmpl   $0x7ffffffe,-0x4(%rbp)
jg     113d <test_anti_range_53+0x2d>
movl   $0x7ffffffd,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_53@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_53>:
cmp    $0x7ffffffe,%edi
mov    $0x7ffffffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_53@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_53(i32 %0) {
%2 = icmp eq i32 %0, 2147483646
%3 = select i1 %2, i32 2147483645, i32 %0
%4 = tail call i8* @alloc_anti_range_53(i32 %3)
ret i8* %4
}
void glGetClipPlanef(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetClipPlanef() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ err(int, char *, char const *, int, char const *);
void *xcalloc_(size_t n, size_t size, const char *file, int line,
               const char *func) {
  void *p = calloc(n, size);
  if (!p)
    err(1, "%s:%d (%s): calloc() failed", file, line, func);
  return p;
}


x86 assembly (clang, -O0):
<xcalloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1173 <xcalloc_+0x53>
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    $0x1,%edi
lea    0xe92(%rip),%rsi
call   1040 <err@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r15d
mov    %rdx,%rbx
call   1030 <calloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1157 <xcalloc_+0x37>
lea    0xebc(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %r14,%r8
call   1040 <err@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%s:%d (%s): calloc() failed\00"
define i8* @xcalloc_(i64 %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
store i64 %0, i64* %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call i8* @calloc(i64 %12, i64 %13)
store i8* %14, i8** %11
%15 = load i8*, i8** %11
%16 = icmp ne i8* %15, null
br i1 %16, label %22, label %17
17: ; preds = %5
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = load i8*, i8** %10
%21 = call i32 @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %19, i8* %20)
br label %22
22: ; preds = %17, %5
%23 = load i8*, i8** %11
ret i8* %23
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s:%d (%s): calloc() failed\00"
define noalias i8* @xcalloc_(i64 %0, i64 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i8* @calloc(i64 %0, i64 %1)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %4)
br label %10
10: ; preds = %8, %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int ntohl(int);
int /*<<< orphan*/ stderr;
void traps(void) {
  static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
  int *p = (int *)test;
  if (*p != ntohl(0x434f4e46)) {
    fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianness? %#x\n", *p);
    exit(2);
  }
}


x86 assembly (clang, -O0):
<traps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2ef9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
je     1188 <traps+0x58>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traps>:
push   %rax
mov    $0x434f4e46,%edi
call   1050 <ntohl@plt>
cmp    $0x464e4f43,%eax
jne    1144 <traps+0x14>
pop    %rax
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    $0x464e4f43,%edx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@traps.test = internal global [5 x i8] c"CONF\00"
@stderr = global i32 0
@.str = [51 x i8] c"fixdep: sizeof(int) != 4 or wrong endianness? %#x\0A\00"
define void @traps() {
%1 = alloca i32*
store i32* bitcast ([5 x i8]* @traps.test to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
%4 = call i32 @ntohl(i32 1129270854)
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = load i32*, i32** %1
%9 = load i32, i32* %8
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"fixdep: sizeof(int) != 4 or wrong endianness? %#x\0A\00"
define void @traps() {
%1 = tail call i32 @ntohl(i32 1129270854)
%2 = icmp eq i32 %1, 1179537219
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 1179537219)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pop_description();
int /*<<< orphan*/ push_description(char *);
void test_targas() {
  push_description("Targa File Handling");
  pop_description();
}


x86 assembly (clang, -O0):
<test_targas>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <push_description@plt>
mov    $0x0,%al
call   1030 <pop_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_targas>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <push_description@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <pop_description@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Targa File Handling\00"
define void @test_targas() {
%1 = call i32 @push_description(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @pop_description()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Targa File Handling\00"
define void @test_targas() {
%1 = tail call i32 @push_description(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @pop_description()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show(char *);
int main(int argc, const char *argv[]) {
  show("this is a test");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"this is a test\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @show(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"this is a test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @show(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
__attribute((always_)) void *f() {
  static int i;
  static int *p = &i;
  return p;
}


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

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

LLVM IR (-O0):
@f.i = internal global i32 0
@f.p = internal global i32* @f.i
define i8* @f() {
%1 = load i32*, i32** @f.p
%2 = bitcast i32* %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
@f.i = internal global i32 0
define i8* @f() {
ret i8* bitcast (i32* @f.i to i8*)
}
void RTSemMutexRequestNoResumeDebug(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemMutexRequestNoResumeDebug() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *BIO_new_fd(int /*<<< orphan*/, int);
int demonstrate_digest(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(void) {
  int result = 1;
  BIO *input = BIO_new_fd(fileno(stdin), 1);
  if (input != NULL) {
    result = demonstrate_digest(input);
    BIO_free(input);
  }
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <BIO_new_fd@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1194 <main+0x54>
mov    -0x10(%rbp),%rdi
call   1040 <demonstrate_digest@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <BIO_free@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <BIO_new_fd@plt>
test   %rax,%rax
je     117b <main+0x3b>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <demonstrate_digest@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <BIO_free@plt>
mov    %ebp,%eax
jmp    1180 <main+0x40>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fileno(i32 %1)
%3 = tail call i32* @BIO_new_fd(i32 %2, i32 1)
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @demonstrate_digest(i32* %3)
%7 = tail call i32 @BIO_free(i32* %3)
br label %8
8: ; preds = %5, %0
%9 = phi i32 [ %6, %5 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ malloc(int);
void applyArr(int **p, int len) {
  *p = (int *)malloc(sizeof(int) * len);
  if (!*p) {
    return;
  }
}


x86 assembly (clang, -O0):
<applyArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114b <applyArr+0x3b>
jmp    114b <applyArr+0x3b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyArr>:
push   %rbx
mov    %rdi,%rbx
lea    0x0(,%rsi,4),%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @applyArr(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 = sext i32 %5 to i64
%7 = mul i64 4, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i32*
%11 = load i32**, i32*** %3
store i32* %10, i32** %11
%12 = load i32**, i32*** %3
%13 = load i32*, i32** %12
%14 = icmp ne i32* %13, null
br i1 %14, label %16, label %15
15: ; preds = %2
br label %16
16: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
define void @applyArr(i32** nocapture writeonly %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %0
ret void
}
void freestr(const char *s) {}


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

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

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

LLVM IR (-O2):
define void @freestr(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test();
int main() {
  test();
  printf("OK\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void posix_class_neg2NP_ALNUM() {}


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

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

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

LLVM IR (-O2):
define void @posix_class_neg2NP_ALNUM() {
ret void
}
/* Variables and functions */
int __semihost(int, int /*<<< orphan*/ *);
int semihost_reset(void) { return __semihost(((0x100) + 2), NULL); }


x86 assembly (clang, -O0):
<semihost_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x102,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <__semihost@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<semihost_reset>:
mov    $0x102,%edi
xor    %esi,%esi
jmp    1030 <__semihost@plt>

LLVM IR (-O0):
define i32 @semihost_reset() {
%1 = call i32 @__semihost(i32 258, i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @semihost_reset() {
%1 = tail call i32 @__semihost(i32 258, i32* null)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int sleep(int);
void test7_h1(int sig) {
  int r;
  printf("test7_h1 basladi\n");
  r = sleep(100);
  printf("test7_h1 bitti r:%d\n", r);
}


x86 assembly (clang, -O0):
<test7_h1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <sleep@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7_h1>:
push   %rax
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
call   1050 <sleep@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"test7_h1 basladi\0A\00"
@.str.1 = [21 x i8] c"test7_h1 bitti r:%d\0A\00"
define void @test7_h1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 100)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"test7_h1 bitti r:%d\0A\00"
@str = [17 x i8] c"test7_h1 basladi\00"
define void @test7_h1(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 100)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
void init_array(int array[], int size) {}


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

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

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

LLVM IR (-O2):
define void @init_array(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ warn_err();
void *malloczero(size_t size) {
  void *p = malloc(size);
  if (p != ((void *)0))
    memset(p, 0, size);
  else
    warn_err();
  return p;
}


x86 assembly (clang, -O0):
<malloczero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1168 <malloczero+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
jmp    116f <malloczero+0x3f>
mov    $0x0,%al
call   1050 <warn_err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloczero>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1153 <malloczero+0x23>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
jmp    115a <malloczero+0x2a>
xor    %eax,%eax
call   1050 <warn_err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @malloczero(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @warn_err()
br label %8
8: ; preds = %6, %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
add() { ol("DAD D"); }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"DAD D\00"
define i32 @add() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"DAD D\00"
define i32 @add() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ baz();
int /*<<< orphan*/ foo();
int /*<<< orphan*/ foobar(int volatile);
int /*<<< orphan*/ foobar2(int volatile);
int main() {
  volatile int x;
  foo();
  bar();
  foobar(x);
  foobar2(x);
  baz();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <foo@plt>
mov    $0x0,%al
call   1050 <bar@plt>
mov    -0x8(%rbp),%edi
call   1060 <foobar@plt>
mov    -0x8(%rbp),%edi
call   1040 <foobar2@plt>
mov    $0x0,%al
call   1030 <baz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <foo@plt>
xor    %eax,%eax
call   1050 <bar@plt>
mov    0x4(%rsp),%edi
call   1060 <foobar@plt>
mov    0x4(%rsp),%edi
call   1040 <foobar2@plt>
xor    %eax,%eax
call   1030 <baz@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @foo()
%4 = call i32 (...) @bar()
%5 = load volatile i32, i32* %2
%6 = call i32 @foobar(i32 %5)
%7 = load volatile i32, i32* %2
%8 = call i32 @foobar2(i32 %7)
%9 = call i32 (...) @baz()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @bar()
%5 = load volatile i32, i32* %1
%6 = tail call i32 @foobar(i32 %5)
%7 = load volatile i32, i32* %1
%8 = tail call i32 @foobar2(i32 %7)
%9 = tail call i32 (...) @baz()
ret i32 0
}
/* Variables and functions */
scalar_t__ _fnmatch(char *);
int main(int argc, char *argv[]) {
  int ret = 0;
  (void)argc;
  ret += _fnmatch(argv[0]);
  return (ret == 0) ? 0 : 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_fnmatch@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <_fnmatch@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i64 @_fnmatch(i8* %10)
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 0, i32 2
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @_fnmatch(i8* %3)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 0, i32 2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ pattern1(int);
int /*<<< orphan*/ pattern2(int);
int /*<<< orphan*/ printf(char *);
int main() {
  int n = 5;
  pattern1(n);
  printf("\n");
  pattern2(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <pattern1@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <pattern2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1050 <pattern1@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
call   1040 <pattern2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pattern1(i32 5)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @pattern2(i32 5)
ret i32 0
}
/* Type definitions */
struct in_addr {
  int s_addr;
};
typedef int /*<<< orphan*/ broadcast;

/* Variables and functions */
int /*<<< orphan*/ memset(struct in_addr *, int /*<<< orphan*/, int);
int prefix2mask(int);
struct in_addr calc_broadcast(struct in_addr addr, int prefix) {
  struct in_addr mask;
  struct in_addr broadcast;
  mask.s_addr = prefix2mask(prefix);
  memset(&broadcast, 0, sizeof(broadcast));
  broadcast.s_addr = (addr.s_addr & mask.s_addr) | ~mask.s_addr;
  return broadcast;
}


x86 assembly (clang, -O0):
<calc_broadcast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <prefix2mask@plt>
mov    %eax,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    -0x18(%rbp),%ecx
xor    $0xffffffff,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_broadcast>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <prefix2mask@plt>
mov    %eax,%ebp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
not    %ebp
or     %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @calc_broadcast(i32 %0, i32 %1) {
%3 = alloca %struct.in_addr
%4 = alloca %struct.in_addr
%5 = alloca i32
%6 = alloca %struct.in_addr
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
store i32 %0, i32* %7
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = call i32 @prefix2mask(i32 %8)
%10 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
store i32 %9, i32* %10
%11 = call i32 @memset(%struct.in_addr* %3, i32 0, i32 4)
%12 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
%15 = load i32, i32* %14
%16 = and i32 %13, %15
%17 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
%18 = load i32, i32* %17
%19 = xor i32 %18, -1
%20 = or i32 %16, %19
%21 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
store i32 %20, i32* %21
%22 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %3, i32 0, i32 0
%23 = load i32, i32* %22
ret i32 %23
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @calc_broadcast(i32 %0, i32 %1) {
%3 = alloca %struct.in_addr
%4 = tail call i32 @prefix2mask(i32 %1)
%5 = call i32 @memset(%struct.in_addr* %3, i32 0, i32 4)
%6 = xor i32 %4, -1
%7 = or i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int in(int, int, int);
int u8isupperasciii(int n) { return in(n, 0x41, 0x5A); }


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

x86 assembly (clang, -O2):
<u8isupperasciii>:
mov    $0x41,%esi
mov    $0x5a,%edx
jmp    1030 <in@plt>

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

LLVM IR (-O2):
define i32 @u8isupperasciii(i32 %0) {
%2 = tail call i32 @in(i32 %0, i32 65, i32 90)
ret i32 %2
}
char rcombine(char r1, char r2) { return r1 ? 0 : r2; }


x86 assembly (clang, -O0):
<rcombine>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     1127 <rcombine+0x27>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <rcombine+0x2e>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcombine>:
xor    %eax,%eax
test   %dil,%dil
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @rcombine(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 0
%4 = select i1 %3, i8 %1, i8 0
ret i8 %4
}
/* Type definitions */
struct vink_arena {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *vink_arena_alloc(struct vink_arena *, scalar_t__);
char *vink_arena_strdup(struct vink_arena *arena, const char *string) {
  char *result;
  result = vink_arena_alloc(arena, strlen(string) + 1);
  if (!result)
    return 0;
  strcpy(result, string);
  return result;
}


x86 assembly (clang, -O0):
<vink_arena_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1050 <vink_arena_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    117d <vink_arena_strdup+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    1192 <vink_arena_strdup+0x62>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vink_arena_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
call   1050 <vink_arena_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <vink_arena_strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.vink_arena = type { i32 }
define i8* @vink_arena_strdup(%struct.vink_arena* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca %struct.vink_arena*
%5 = alloca i8*
%6 = alloca i8*
store %struct.vink_arena* %0, %struct.vink_arena** %4
store i8* %1, i8** %5
%7 = load %struct.vink_arena*, %struct.vink_arena** %4
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i8* @vink_arena_alloc(%struct.vink_arena* %7, i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %2
store i8* null, i8** %3
br label %20
15: ; preds = %2
%16 = load i8*, i8** %6
%17 = load i8*, i8** %5
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %6
store i8* %19, i8** %3
br label %20
20: ; preds = %15, %14
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
%struct.vink_arena = type { i32 }
define i8* @vink_arena_strdup(%struct.vink_arena* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @vink_arena_alloc(%struct.vink_arena* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @strcpy(i8* %5, i8* %1)
br label %9
9: ; preds = %2, %7
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS12_MAC_DATA;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS12_MAC_DATA_it;
PKCS12_MAC_DATA *d2i_PKCS12_MAC_DATA(PKCS12_MAC_DATA **a,
                                     const unsigned char **in, long len) {
  return (PKCS12_MAC_DATA *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                          &PKCS12_MAC_DATA_it);
}


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

x86 assembly (clang, -O2):
<d2i_PKCS12_MAC_DATA>:
mov    0x2ed1(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@PKCS12_MAC_DATA_it = global i32 0
define i32* @d2i_PKCS12_MAC_DATA(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @PKCS12_MAC_DATA_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@PKCS12_MAC_DATA_it = global i32 0
define i32* @d2i_PKCS12_MAC_DATA(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @PKCS12_MAC_DATA_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void VIDDummyVdp2SetPriorityNBG2(__attribute((unused)) int priority) {}


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

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

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

LLVM IR (-O2):
define void @VIDDummyVdp2SetPriorityNBG2(i32 %0) {
ret void
}
int my_word(char c) {
  if (c >= 'a' && c <= 'z')
    return (1);
  if (c >= 'A' && c <= 'Z')
    return (1);
  if (c >= '0' && c <= '9')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<my_word>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <my_word+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <my_word+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1183 <my_word+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <my_word+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <my_word+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1183 <my_word+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     117c <my_word+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     117c <my_word+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <my_word+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_word>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @my_word(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void HandleSEGV() {
  print("exiting program gracefully");
  return;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"exiting program gracefully\00"
define void @HandleSEGV() {
%1 = call i32 @print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"exiting program gracefully\00"
define void @HandleSEGV() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ number;
};
typedef TYPE_1__ XExtData;

/* Variables and functions */
int get_XExtData_number(void *_p) { return (int)((XExtData *)_p)->number; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XExtData_number(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XExtData_number(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}