xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ nRF24L01P_setRegister(int, int /*<<< orphan*/);
void nRF24L01P_disableAutoRetransmit(void) { nRF24L01P_setRegister(0x04, 0); }


x86 assembly (clang, -O0):
<nRF24L01P_disableAutoRetransmit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <nRF24L01P_setRegister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nRF24L01P_disableAutoRetransmit>:
mov    $0x4,%edi
xor    %esi,%esi
jmp    1030 <nRF24L01P_setRegister@plt>

LLVM IR (-O0):
define void @nRF24L01P_disableAutoRetransmit() {
%1 = call i32 @nRF24L01P_setRegister(i32 4, i32 0)
ret void
}

LLVM IR (-O2):
define void @nRF24L01P_disableAutoRetransmit() {
%1 = tail call i32 @nRF24L01P_setRegister(i32 4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x62() {
  Assert_real((isalnum(98)),
              "/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_isalnum.c",
              495, ("isalnum should be 1 for b"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for b\00"
define void @t_isalnum_0x62() {
%1 = call i32 @isalnum(i32 98)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for b\00"
define void @t_isalnum_0x62() {
%1 = tail call i32 @isalnum(i32 98)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 495, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
extern const char *onig_version(void) {
  static char s[12];
  snprintf(s, sizeof(s), "%d.%d.%d", 6, 9, 1);
  return s;
}


x86 assembly (clang, -O0):
<onig_version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
mov    $0xc,%esi
lea    0xed9(%rip),%rdx
mov    $0x6,%ecx
mov    $0x9,%r8d
mov    $0x1,%r9d
call   1030 <snprintf@plt>
lea    0x2ee5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onig_version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rdx
mov    %rbx,%rdi
mov    $0xc,%esi
mov    $0x6,%ecx
mov    $0x9,%r8d
mov    $0x1,%r9d
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@onig_version.s = internal global [12 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @onig_version() {
%1 = call i32 @snprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @onig_version.s, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 6, i32 9, i32 1)
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @onig_version.s, i64 0, i64 0)
}

LLVM IR (-O2):
@onig_version.s = internal global [12 x i8] zeroinitializer
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @onig_version() {
%1 = tail call i32 @snprintf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @onig_version.s, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 6, i32 9, i32 1)
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @onig_version.s, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LogVfprintf(int /*<<< orphan*/ *, char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void LogFatal(FILE *prFP, char *pcFmt, va_list rVArgList) {
  fprintf(prFP, "FATAL: ");
  LogVfprintf(prFP, pcFmt, rVArgList);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<LogFatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <LogVfprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<LogFatal>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xebc(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <LogVfprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"FATAL: \00"
@EXIT_FAILURE = global i32 0
define void @LogFatal(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @LogVfprintf(i32* %9, i8* %10, i32 %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"FATAL: \00"
@EXIT_FAILURE = global i32 0
define void @LogFatal(i32* %0, i8* %1, i32 %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
%5 = tail call i32 @LogVfprintf(i32* %0, i8* %1, i32 %2)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
void swscale_configuration() {}


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

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

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

LLVM IR (-O2):
define void @swscale_configuration() {
ret void
}
void *memset(void *__dest, signed int __ch, unsigned long int __len) {
  if ((_Bool)0) {
    if (__len == 0ul) {
    __CPROVER_DUMP_L1:;
      __warn_memset_zero_len();
      return __dest;
    }
  }
  void *return_value___builtin___memset_chk$1;
  return_value___builtin___memset_chk$1 = __builtin___memset_chk(
      __dest, __ch, (unsigned int)__len, 18446744073709551615ul);
  return return_value___builtin___memset_chk$1;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1132 <memset+0x22>
jmp    1154 <memset+0x44>
cmpq   $0x0,-0x20(%rbp)
jne    114f <memset+0x3f>
jmp    1142 <memset+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117b <memset+0x6b>
jmp    1154 <memset+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    %eax,%eax
mov    %eax,%edx
mov    $0xffffffffffffffff,%rcx
call   1030 <__memset_chk@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %edx,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = and i64 %2, 4294967295
%5 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %5, i64 %4, i1 false)
ret i8* %0
}
/* Variables and functions */
int convert(char *);
int /*<<< orphan*/ printf(char *, int);
main() {
  char *ptr = "1998";
  printf("%d", convert(ptr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <convert@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"1998\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @convert(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct timespec {
  unsigned long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
long diff_ts(struct timespec a, struct timespec b) {
  return ((a.tv_sec - b.tv_sec) * 1000000000UL + (a.tv_nsec - b.tv_nsec));
}


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

x86 assembly (clang, -O2):
<diff_ts>:
sub    %rdx,%rdi
imul   $0x3b9aca00,%rdi,%rax
sub    %rcx,%rsi
add    %rsi,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @diff_ts(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = bitcast %struct.timespec* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timespec* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%16 = load i64, i64* %15
%17 = sub i64 %14, %16
%18 = mul i64 %17, 1000000000
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%22 = load i64, i64* %21
%23 = sub nsw i64 %20, %22
%24 = add i64 %18, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @diff_ts(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub i64 %0, %2
%6 = mul i64 %5, 1000000000
%7 = sub i64 %1, %3
%8 = add i64 %7, %6
ret i64 %8
}
/* Type definitions */
struct i8x_listitem {
  int dummy;
};
struct i8x_chunk {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_listitem_get_object(struct i8x_listitem *);
struct i8x_chunk *__attribute__((always_))
i8x_listitem_get_chunk(struct i8x_listitem *item) {
  return (struct i8x_chunk *)i8x_listitem_get_object(item);
}


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

x86 assembly (clang, -O2):
<i8x_listitem_get_chunk>:
jmp    1030 <i8x_listitem_get_object@plt>

LLVM IR (-O0):
%struct.i8x_chunk = type { i32 }
%struct.i8x_listitem = type { i32 }
define %struct.i8x_chunk* @i8x_listitem_get_chunk(%struct.i8x_listitem* %0) {
%2 = alloca %struct.i8x_listitem*
store %struct.i8x_listitem* %0, %struct.i8x_listitem** %2
%3 = load %struct.i8x_listitem*, %struct.i8x_listitem** %2
%4 = call i64 @i8x_listitem_get_object(%struct.i8x_listitem* %3)
%5 = inttoptr i64 %4 to %struct.i8x_chunk*
ret %struct.i8x_chunk* %5
}

LLVM IR (-O2):
%struct.i8x_chunk = type { i32 }
%struct.i8x_listitem = type { i32 }
define %struct.i8x_chunk* @i8x_listitem_get_chunk(%struct.i8x_listitem* %0) {
%2 = tail call i64 @i8x_listitem_get_object(%struct.i8x_listitem* %0)
%3 = inttoptr i64 %2 to %struct.i8x_chunk*
ret %struct.i8x_chunk* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ch8_LOW() { printf("Error: ch8_LOW not yet implemented\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Error: ch8_LOW not yet implemented\0A\00"
define void @ch8_LOW() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"Error: ch8_LOW not yet implemented\00"
define void @ch8_LOW() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DisconnectKeyCodes2();
int /*<<< orphan*/ MyMouseButtonSet(int /*<<< orphan*/);
void DisconnectKeyCodes3(void) {
  DisconnectKeyCodes2();
  MyMouseButtonSet(0);
}


x86 assembly (clang, -O0):
<DisconnectKeyCodes3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <DisconnectKeyCodes2@plt>
xor    %edi,%edi
call   1040 <MyMouseButtonSet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisconnectKeyCodes3>:
push   %rax
xor    %eax,%eax
call   1030 <DisconnectKeyCodes2@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <MyMouseButtonSet@plt>

LLVM IR (-O0):
define void @DisconnectKeyCodes3() {
%1 = call i32 (...) @DisconnectKeyCodes2()
%2 = call i32 @MyMouseButtonSet(i32 0)
ret void
}

LLVM IR (-O2):
define void @DisconnectKeyCodes3() {
%1 = tail call i32 (...) @DisconnectKeyCodes2()
%2 = tail call i32 @MyMouseButtonSet(i32 0)
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn78() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn78");
  return result;
}


x86 assembly (clang, -O0):
<fn78>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn78>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn78\00"
define i8* @fn78() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn78\00"
define i8* @fn78() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ update_screen(char *);
void read_place() {
  char msg[300];
  update_screen(msg);
}


x86 assembly (clang, -O0):
<read_place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
lea    -0x130(%rbp),%rdi
call   1030 <update_screen@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_place>:
sub    $0x138,%rsp
mov    %rsp,%rdi
call   1030 <update_screen@plt>
add    $0x138,%rsp
ret

LLVM IR (-O0):
define void @read_place() {
%1 = alloca [300 x i8]
%2 = getelementptr inbounds [300 x i8], [300 x i8]* %1, i64 0, i64 0
%3 = call i32 @update_screen(i8* %2)
ret void
}

LLVM IR (-O2):
define void @read_place() {
%1 = alloca [300 x i8]
%2 = getelementptr inbounds [300 x i8], [300 x i8]* %1, i64 0, i64 0
%3 = call i32 @update_screen(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cwrapper_q_sort_double_with_indices(double *, int *,
                                                       int /*<<< orphan*/, int);
void quicksort_double_with_indices_(double numbers[], int indices[],
                                    int *array_size) {
  cwrapper_q_sort_double_with_indices(numbers, indices, 0, (*array_size) - 1);
}


x86 assembly (clang, -O0):
<quicksort_double_with_indices_>:
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),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <cwrapper_q_sort_double_with_indices@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort_double_with_indices_>:
mov    (%rdx),%ecx
add    $0xffffffff,%ecx
xor    %edx,%edx
jmp    1030 <cwrapper_q_sort_double_with_indices@plt>

LLVM IR (-O0):
define void @quicksort_double_with_indices_(double* %0, i32* %1, i32* %2) {
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32*
store double* %0, double** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load double*, double** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @cwrapper_q_sort_double_with_indices(double* %7, i32* %8, i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @quicksort_double_with_indices_(double* %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
%6 = tail call i32 @cwrapper_q_sort_double_with_indices(double* %0, i32* %1, i32 0, i32 %5)
ret void
}
void infinite_loop() {
  while (1) {
  };
}


x86 assembly (clang, -O0):
<infinite_loop>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <infinite_loop+0x9>
jmp    1109 <infinite_loop+0x9>

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

LLVM IR (-O0):
define void @infinite_loop() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @infinite_loop() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ rad_init();
void decode_radius_init(void) { rad_init(); }


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

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

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

LLVM IR (-O2):
define void @decode_radius_init() {
%1 = tail call i32 (...) @rad_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ boolTerm();
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ match(char);
void boolOr() {
  match('|');
  boolTerm();
  emitln("pop\t%%ebx");
  emitln("or\t%%ebx,%%eax");
}


x86 assembly (clang, -O0):
<boolOr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7c,%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1050 <boolTerm@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb2(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boolOr>:
push   %rax
mov    $0x7c,%edi
call   1040 <match@plt>
xor    %eax,%eax
call   1050 <boolTerm@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb5(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [15 x i8] c"or\09%%ebx,%%eax\00"
define void @boolOr() {
%1 = call i32 @match(i8 signext 124)
%2 = call i32 (...) @boolTerm()
%3 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [15 x i8] c"or\09%%ebx,%%eax\00"
define void @boolOr() {
%1 = tail call i32 @match(i8 signext 124)
%2 = tail call i32 (...) @boolTerm()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *a, int b) { assert(0); }


x86 assembly (clang, -O0):
<pthread_mutexattr_setpshared>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_setpshared(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, const char *argv[]) { printf("ciao %s!\n", argv[1]); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"ciao %s!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_get_mainloop_api() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_get_mainloop_api"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"NOT IMPLEMENTED:pa_iochannel_get_mainloop_api\0A\00"
define i32 @pa_iochannel_get_mainloop_api() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [46 x i8] c"NOT IMPLEMENTED:pa_iochannel_get_mainloop_api\00"
define i32 @pa_iochannel_get_mainloop_api() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *getHostName(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char *hostname = getHostName(argv[1]);
  if (!hostname)
    printf("There is error in ip address\n");
  else
    printf("\nHost Name: %s\n\n", hostname);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <getHostName@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <main+0x45>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1177 <main+0x57>
mov    -0x18(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <getHostName@plt>
test   %rax,%rax
je     1152 <main+0x22>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115e <main+0x2e>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"There is error in ip address\0A\00"
@.str.1 = [17 x i8] c"\0AHost Name: %s\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i8* @getHostName(i8* %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %18
15: ; preds = %2
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"\0AHost Name: %s\0A\0A\00"
@str = [29 x i8] c"There is error in ip address\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @getHostName(i8* %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %11
11: ; preds = %9, %7
ret i32 0
}
void *realloc() { return 0; }


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

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

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
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @realloc(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
int atoi(const char *str) {}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
struct reb_simulation {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INFINITY;
scalar_t__ reb_output_check(struct reb_simulation *, int);
int /*<<< orphan*/ reb_output_timing(struct reb_simulation *,
                                     int /*<<< orphan*/);
void heartbeat(struct reb_simulation *r) {
  if (reb_output_check(r, 100.)) {
    reb_output_timing(r, INFINITY);
  }
}


x86 assembly (clang, -O0):
<heartbeat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x64,%esi
call   1040 <reb_output_check@plt>
cmp    $0x0,%rax
je     1156 <heartbeat+0x36>
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <reb_output_timing@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heartbeat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x64,%esi
call   1040 <reb_output_check@plt>
test   %rax,%rax
je     1145 <heartbeat+0x25>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <reb_output_timing@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.reb_simulation = type { i32 }
@INFINITY = global i32 0
define void @heartbeat(%struct.reb_simulation* %0) {
%2 = alloca %struct.reb_simulation*
store %struct.reb_simulation* %0, %struct.reb_simulation** %2
%3 = load %struct.reb_simulation*, %struct.reb_simulation** %2
%4 = call i64 @reb_output_check(%struct.reb_simulation* %3, i32 100)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.reb_simulation*, %struct.reb_simulation** %2
%8 = load i32, i32* @INFINITY
%9 = call i32 @reb_output_timing(%struct.reb_simulation* %7, i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.reb_simulation = type { i32 }
@INFINITY = global i32 0
define void @heartbeat(%struct.reb_simulation* %0) {
%2 = tail call i64 @reb_output_check(%struct.reb_simulation* %0, i32 100)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @INFINITY
%6 = tail call i32 @reb_output_timing(%struct.reb_simulation* %0, i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
int fitsBits(int x, int n) {
  int neg = x >> 31;
  int n_1 = n + (~0);
  return (neg & !((~x) >> n_1)) | (~neg & !(x >> n_1));
}


x86 assembly (clang, -O0):
<fitsBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x10(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
sar    %cl,%edx
mov    -0x14(%rbp),%ecx
cmp    $0x0,%edx
setne  %dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fitsBits>:
mov    %edi,%eax
lea    -0x1(%rsi),%ecx
mov    %edi,%edx
sar    %cl,%edx
shr    $0x1f,%eax
xor    %ecx,%ecx
cmp    $0xffffffff,%edx
sete   %cl
and    %eax,%ecx
test   %edx,%edx
sete   %al
test   %edi,%edi
setns  %dl
and    %al,%dl
movzbl %dl,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = ashr i32 %7, 31
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = xor i32 %12, -1
%14 = load i32, i32* %6
%15 = ashr i32 %13, %14
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = and i32 %11, %18
%20 = load i32, i32* %5
%21 = xor i32 %20, -1
%22 = load i32, i32* %3
%23 = load i32, i32* %6
%24 = ashr i32 %22, %23
%25 = icmp ne i32 %24, 0
%26 = xor i1 %25, true
%27 = zext i1 %26 to i32
%28 = and i32 %21, %27
%29 = or i32 %19, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @fitsBits(i32 %0, i32 %1) {
%3 = lshr i32 %0, 31
%4 = add nsw i32 %1, -1
%5 = ashr i32 %0, %4
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = and i32 %3, %7
%9 = icmp eq i32 %5, 0
%10 = icmp sgt i32 %0, -1
%11 = select i1 %10, i1 %9, i1 false
%12 = zext i1 %11 to i32
%13 = or i32 %8, %12
ret i32 %13
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn16() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn16");
  return result;
}


x86 assembly (clang, -O0):
<fn16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn16>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn16\00"
define i8* @fn16() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn16\00"
define i8* @fn16() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int bmap2wday(unsigned char bmap) {
  int j;
  j = 0;
  while ((bmap = (bmap >> 1)) != 0)
    j++;
  return j;
}


x86 assembly (clang, -O0):
<bmap2wday>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl %al,%eax
cmp    $0x0,%eax
je     1135 <bmap2wday+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <bmap2wday+0x11>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmap2wday>:
xor    %eax,%eax
cmp    $0x2,%dil
jb     111d <bmap2wday+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax)
shr    %cl
add    $0x1,%eax
cmp    $0x3,%dil
mov    %ecx,%edi
ja     1110 <bmap2wday+0x10>
ret

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

LLVM IR (-O2):
define i32 @bmap2wday(i8 zeroext %0) {
%2 = icmp ult i8 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i8 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i8 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i8 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void put_i32(int32_t n) { printf("%d", n); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @put_i32(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void J420ToRGB24() {}


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

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

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

LLVM IR (-O2):
define void @J420ToRGB24() {
ret void
}
int is_divisible_by_all_to(long l, long num) {
  long i;
  for (i = 2; i <= num; i++)
    if (l % i != 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_divisible_by_all_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x2,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1158 <is_divisible_by_all_to+0x58>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x20(%rbp)
cmp    $0x0,%rdx
je     1142 <is_divisible_by_all_to+0x42>
movl   $0x0,-0x4(%rbp)
jmp    115f <is_divisible_by_all_to+0x5f>
jmp    1147 <is_divisible_by_all_to+0x47>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <is_divisible_by_all_to+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_divisible_by_all_to>:
mov    $0x1,%r8d
cmp    $0x2,%rsi
jl     115d <is_divisible_by_all_to+0x5d>
mov    $0x1,%ecx
sub    %rsi,%rcx
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1140 <is_divisible_by_all_to+0x40>
mov    %rdi,%rax
cqto
idiv   %rsi
test   %rdx,%rdx
je     114b <is_divisible_by_all_to+0x4b>
jmp    1161 <is_divisible_by_all_to+0x61>
nopl   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    1161 <is_divisible_by_all_to+0x61>
lea    (%rcx,%rsi,1),%rax
add    $0x1,%rax
add    $0x1,%rsi
cmp    $0x2,%rax
jne    1120 <is_divisible_by_all_to+0x20>
mov    %r8d,%eax
ret
xor    %r8d,%r8d
mov    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @is_divisible_by_all_to(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, 2
br i1 %3, label %11, label %7
4: ; preds = %7
%5 = add nuw i64 %8, 1
%6 = icmp eq i64 %8, %1
br i1 %6, label %11, label %7
7: ; preds = %2, %4
%8 = phi i64 [ %5, %4 ], [ 2, %2 ]
%9 = srem i64 %0, %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7, %4, %2
%12 = phi i32 [ 1, %2 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
int letter(char c) { return 'a' <= c && c <= 'z'; }


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x61,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <letter+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @letter(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void watchdog_periodic(void) { (*(volatile unsigned char *)0xFFFAB) = 0xAC; }


x86 assembly (clang, -O0):
<watchdog_periodic>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffab,%eax
movb   $0xac,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<watchdog_periodic>:
movb   $0xac,0xfffab
ac
ret

LLVM IR (-O0):
define void @watchdog_periodic() {
store volatile i8 -84, i8* inttoptr (i64 1048491 to i8*)
ret void
}

LLVM IR (-O2):
define void @watchdog_periodic() {
store volatile i8 -84, i8* inttoptr (i64 1048491 to i8*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_eol(void) { fprintf(stderr, "\n"); }


x86 assembly (clang, -O0):
<print_eol>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_eol>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @print_eol() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @print_eol() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  pid_t pid;
  pid = getpid();
  printf("fuck %lu\n", pid);
  pause();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <pause@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"fuck %lu\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @pause()
ret i32 0
}
/* Variables and functions */
scalar_t__ dcac_add_ops(int, int, int /*<<< orphan*/ *, int);
int dcac_add_gname_attr(int gid) { return (int)dcac_add_ops(1, gid, NULL, -1); }


x86 assembly (clang, -O0):
<dcac_add_gname_attr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    $0xffffffff,%ecx
call   1030 <dcac_add_ops@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcac_add_gname_attr>:
mov    %edi,%esi
mov    $0x1,%edi
xor    %edx,%edx
mov    $0xffffffff,%ecx
jmp    1030 <dcac_add_ops@plt>

LLVM IR (-O0):
define i32 @dcac_add_gname_attr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @dcac_add_ops(i32 1, i32 %3, i32* null, i32 -1)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @dcac_add_gname_attr(i32 %0) {
%2 = tail call i64 @dcac_add_ops(i32 1, i32 %0, i32* null, i32 -1)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void setval_414(unsigned *p) { *p = 2143516679U; }


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

x86 assembly (clang, -O2):
<setval_414>:
movl   $0x7fc37807,(%rdi)
ret

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

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