xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x45() {
  Assert_real((isdigit(69) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              350, ("isdigit should be 0 for E"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x45>:
push   %rax
mov    $0x45,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x15e,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for E\00"
define void @t_isdigit_0x45() {
%1 = call i64 @isdigit(i32 69)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for E\00"
define void @t_isdigit_0x45() {
%1 = tail call i64 @isdigit(i32 69)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 350, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t tlv_get_type(const uint8_t *p_tlv) {
  return (p_tlv[0] << 8) | p_tlv[1];
}


x86 assembly (clang, -O0):
<tlv_get_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlv_get_type>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @tlv_get_type(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @tlv_get_type(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}
int mocked_int_function3() {
  ;
  return -3;
}


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

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

LLVM IR (-O0):
define i32 @mocked_int_function3() {
ret i32 -3
}

LLVM IR (-O2):
define i32 @mocked_int_function3() {
ret i32 -3
}
void init_iep_timer() {
  (*((volatile unsigned int *)(0x2e000 + 0x00))) &= ~(1);
  (*((volatile unsigned int *)(0x2e000 + 0x0C))) = 0xffffffff;
  (*((volatile unsigned int *)(0x2e000 + 0x04))) = 0;
  (*((volatile unsigned int *)(0x2e000 + 0x44))) = 0xf;
  (*((volatile unsigned int *)(0x2e000 + 0x48))) = 83333;
  (*((volatile unsigned int *)(0x2e000 + 0x40))) = (1 << 1) | 1;
  (*((volatile unsigned int *)(0x2e000 + 0x00))) |= 5 << 4;
  (*((volatile unsigned int *)(0x2e000 + 0x08))) = 0;
  (*((volatile unsigned int *)(0x2e000 + 0x00))) |= 1;
}


x86 assembly (clang, -O0):
<init_iep_timer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2e000,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x2e000,%eax
mov    %ecx,(%rax)
mov    $0x2e00c,%eax
movl   $0xffffffff,(%rax)
mov    $0x2e004,%eax
movl   $0x0,(%rax)
mov    $0x2e044,%eax
movl   $0xf,(%rax)
mov    $0x2e048,%eax
movl   $0x14585,(%rax)
mov    $0x2e040,%eax
movl   $0x3,(%rax)
mov    $0x2e000,%eax
mov    (%rax),%ecx
or     $0x50,%ecx
mov    $0x2e000,%eax
mov    %ecx,(%rax)
mov    $0x2e008,%eax
movl   $0x0,(%rax)
mov    $0x2e000,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x2e000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_iep_timer>:
andl   $0xfffffffe,0x2e000
fe
movl   $0xffffffff,0x2e00c
ff ff ff ff
movl   $0x0,0x2e004
movl   $0xf,0x2e044
movl   $0x14585,0x2e048
movl   $0x3,0x2e040
orl    $0x50,0x2e000
50
movl   $0x0,0x2e008
orl    $0x1,0x2e000
01
ret

LLVM IR (-O0):
define void @init_iep_timer() {
%1 = load volatile i32, i32* inttoptr (i64 188416 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 188416 to i32*)
store volatile i32 -1, i32* inttoptr (i64 188428 to i32*)
store volatile i32 0, i32* inttoptr (i64 188420 to i32*)
store volatile i32 15, i32* inttoptr (i64 188484 to i32*)
store volatile i32 83333, i32* inttoptr (i64 188488 to i32*)
store volatile i32 3, i32* inttoptr (i64 188480 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 188416 to i32*)
%4 = or i32 %3, 80
store volatile i32 %4, i32* inttoptr (i64 188416 to i32*)
store volatile i32 0, i32* inttoptr (i64 188424 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 188416 to i32*)
%6 = or i32 %5, 1
store volatile i32 %6, i32* inttoptr (i64 188416 to i32*)
ret void
}

LLVM IR (-O2):
define void @init_iep_timer() {
%1 = load volatile i32, i32* inttoptr (i64 188416 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 188416 to i32*)
store volatile i32 -1, i32* inttoptr (i64 188428 to i32*)
store volatile i32 0, i32* inttoptr (i64 188420 to i32*)
store volatile i32 15, i32* inttoptr (i64 188484 to i32*)
store volatile i32 83333, i32* inttoptr (i64 188488 to i32*)
store volatile i32 3, i32* inttoptr (i64 188480 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 188416 to i32*)
%4 = or i32 %3, 80
store volatile i32 %4, i32* inttoptr (i64 188416 to i32*)
store volatile i32 0, i32* inttoptr (i64 188424 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 188416 to i32*)
%6 = or i32 %5, 1
store volatile i32 %6, i32* inttoptr (i64 188416 to i32*)
ret void
}
void deadloop(void) {
  while (1) {
  }
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_1_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CyBle_BleSSInterruptHandler();
void CyBLE_Bless_Interrupt(void) { CyBle_BleSSInterruptHandler(); }


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

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

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

LLVM IR (-O2):
define void @CyBLE_Bless_Interrupt() {
%1 = tail call i32 (...) @CyBle_BleSSInterruptHandler()
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int rand();
float rand_float() {
  int r = rand();
  return (float)r / ((float)RAND_MAX + 1.0f);
}


x86 assembly (clang, -O0):
<rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mov    0x2eba(%rip),%rax
cvtsi2ssq (%rax),%xmm1
movss  0xec5(%rip),%xmm2
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_float>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %eax,%xmm0
mov    0x2ec5(%rip),%rax
cvtsi2ssq (%rax),%xmm1
addss  0xed0(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @rand_float() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to float
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to float
%7 = fadd float %6, 1.000000e+00
%8 = fdiv float %4, %7
ret float %8
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @rand_float() {
%1 = tail call i32 (...) @rand()
%2 = sitofp i32 %1 to float
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to float
%5 = fadd float %4, 1.000000e+00
%6 = fdiv float %2, %5
ret float %6
}
void BN_CTX_start(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_CTX_start() {
ret void
}
void statement() {}


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

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

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

LLVM IR (-O2):
define void @statement() {
ret void
}
void TMTimerLock(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerLock() {
ret void
}
/* Variables and functions */
int snprintf(char *, int, char *, char *);
int prepare_broadcast_msg(char *msg, int max_len) {
  return snprintf(msg, max_len, "%s", "Dzhumagulov_Berezhnoy_IU_7_2013");
}


x86 assembly (clang, -O0):
<prepare_broadcast_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_broadcast_msg>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [32 x i8] c"Dzhumagulov_Berezhnoy_IU_7_2013\00"
define i32 @prepare_broadcast_msg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @snprintf(i8* %5, i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [32 x i8] c"Dzhumagulov_Berezhnoy_IU_7_2013\00"
define i32 @prepare_broadcast_msg(i8* %0, i32 %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  scalar_t__ tv_usec;
};
typedef long long int64_t;

/* Variables and functions */
int64_t ng_tofday_to_timestamp(struct timeval *tv) {
  long long ts;
  ts = tv->tv_sec;
  ts *= 1000000;
  ts += tv->tv_usec;
  ts *= 1000;
  return ts;
}


x86 assembly (clang, -O0):
<ng_tofday_to_timestamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ng_tofday_to_timestamp>:
imul   $0xf4240,(%rdi),%rax
add    0x8(%rdi),%rax
imul   $0x3e8,%rax,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @ng_tofday_to_timestamp(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i64
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = mul nsw i64 %7, 1000000
store i64 %8, i64* %3
%9 = load %struct.timeval*, %struct.timeval** %2
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%11 = load i64, i64* %10
%12 = load i64, i64* %3
%13 = add nsw i64 %12, %11
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = mul nsw i64 %14, 1000
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @ng_tofday_to_timestamp(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
%8 = mul nsw i64 %7, 1000
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *, int *);
int get_token(char **input, char *result) {
  int n = 0;
  sscanf(*input, "%255s%n", result, &n);
  if (!n) {
    return 0;
  }
  *input += n;
  return 1;
}


x86 assembly (clang, -O0):
<get_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rdx
lea    0xec7(%rip),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <sscanf@plt>
cmpl   $0x0,-0x1c(%rbp)
jne    1158 <get_token+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1172 <get_token+0x62>
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_token>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
mov    (%rdi),%rdi
lea    0xed3(%rip),%rsi
lea    0xc(%rsp),%rcx
call   1030 <sscanf@plt>
movslq 0xc(%rsp),%rax
test   %rax,%rax
je     114b <get_token+0x3b>
add    %rax,(%rbx)
mov    $0x1,%eax
jmp    114d <get_token+0x3d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%255s%n\00"
define i32 @get_token(i8** nocapture %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i8*, i8** %0
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i32* %3)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8*, i8** %0
%11 = sext i32 %7 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** %0
br label %13
13: ; preds = %2, %9
%14 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int round2_d();
int round2_c() { return round2_d(); }


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

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

LLVM IR (-O0):
define i32 @round2_c() {
%1 = call i32 (...) @round2_d()
ret i32 %1
}

LLVM IR (-O2):
define i32 @round2_c() {
%1 = tail call i32 (...) @round2_d()
ret i32 %1
}
void blankREPORTfinish(void *info) { return; }


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

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

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

LLVM IR (-O2):
define void @blankREPORTfinish(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: dump-hex\n"
                  "   or  dump-hex LABEL\n"
                  "   or  dump-hex --help\n\n"
                  "Copies data from stdin to stdout,\n"
                  "and also writes a hex dump to stderr.\n");
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [135 x i8] c"Usage: dump-hex\0A or dump-hex LABEL\0A or dump-hex --help\0A\0ACopies data from stdin to stdout,\0Aand also writes a hex dump to stderr.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [135 x i8] c"Usage: dump-hex\0A or dump-hex LABEL\0A or dump-hex --help\0A\0ACopies data from stdin to stdout,\0Aand also writes a hex dump to stderr.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str, i64 0, i64 0))
ret void
}
void trap(void) { asm("int $0x03"); }


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

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

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

LLVM IR (-O2):
define void @trap() {
tail call void asm sideeffect "int $$0x03", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int *getMaxSubArray(int *, int);
int main() {
  int a[] = {-1, 4, -1, 5, 6, -13, 2};
  int *result = getMaxSubArray(a, 7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <getMaxSubArray@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <getMaxSubArray@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i32] [i32 -1, i32 4, i32 -1, i32 5, i32 6, i32 -13, i32 2]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = alloca i32*
%3 = bitcast [7 x i32]* %1 to i8*
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%5 = call i32* @getMaxSubArray(i32* %4, i32 7)
store i32* %5, i32** %2
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [7 x i32] [i32 -1, i32 4, i32 -1, i32 5, i32 6, i32 -13, i32 2]
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32* @getMaxSubArray(i32* %3, i32 7)
ret i32 0
}
void RC4(void) {}


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

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

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

LLVM IR (-O2):
define void @RC4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ ngen(char *, char *, int);
void cgunscaleby(int v) {
  ngen("%s\t$%d,%%rcx", "movq", v);
  gen("xorq\t%rdx,%rdx");
  gen("divq\t%rcx");
}


x86 assembly (clang, -O0):
<cgunscaleby>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <ngen@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen@plt>
lea    0xecd(%rip),%rdi
call   1040 <gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgunscaleby>:
push   %rax
mov    %edi,%edx
lea    0xed6(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <ngen@plt>
lea    0xed5(%rip),%rdi
call   1040 <gen@plt>
lea    0xed8(%rip),%rdi
pop    %rax
jmp    1040 <gen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09$%d,%%rcx\00"
@.str.1 = [5 x i8] c"movq\00"
@.str.2 = [15 x i8] c"xorq\09%rdx,%rdx\00"
@.str.3 = [10 x i8] c"divq\09%rcx\00"
define void @cgunscaleby(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09$%d,%%rcx\00"
@.str.1 = [5 x i8] c"movq\00"
@.str.2 = [15 x i8] c"xorq\09%rdx,%rdx\00"
@.str.3 = [10 x i8] c"divq\09%rcx\00"
define void @cgunscaleby(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%3 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int days_in_thisyear(int year) {
  return 365 + (((year % 4) == 0) && ((year % 100 != 0) || (year % 400 == 0)));
}


x86 assembly (clang, -O0):
<days_in_thisyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <days_in_thisyear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <days_in_thisyear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x16d,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_in_thisyear>:
mov    $0x16d,%eax
test   $0x3,%dil
je     110c <days_in_thisyear+0xc>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x16e,%eax
cmp    $0x28f5c28,%edx
ja     110b <days_in_thisyear+0xb>
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
mov    $0x16d,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @days_in_thisyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
%19 = add nsw i32 365, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @days_in_thisyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 366, i32 365
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 365, %1 ], [ 366, %4 ], [ %10, %7 ]
ret i32 %12
}
int test_imm_E6uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xE6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E6uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0xe6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E6uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 987842478080
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int isalpha(int);
__attribute__((regparm(0))) int(_win_isalpha)(int c) { return isalpha(c); }


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

x86 assembly (clang, -O2):
<_win_isalpha>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @_win_isalpha(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
ret i32 %2
}
struct expr *lvalue(void) {
  struct expr *exp = or ();
  return exp;
}


x86 assembly (clang, -O0):
<lvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <or@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.expr = type opaque
define %struct.expr* @lvalue() {
%1 = alloca %struct.expr*
%2 = call i32 (...) @or()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.expr*
store %struct.expr* %4, %struct.expr** %1
%5 = load %struct.expr*, %struct.expr** %1
ret %struct.expr* %5
}

LLVM IR (-O2):
%struct.expr = type opaque
define %struct.expr* @lvalue() {
%1 = tail call i32 (...) @or()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to %struct.expr*
ret %struct.expr* %3
}
/* Variables and functions */
int /*<<< orphan*/ instance1(int /*<<< orphan*/);
int /*<<< orphan*/ instance2(int /*<<< orphan*/);
int /*<<< orphan*/ instance3(int /*<<< orphan*/);
int /*<<< orphan*/ instance4(int /*<<< orphan*/);
int /*<<< orphan*/ instance5(int /*<<< orphan*/);
int /*<<< orphan*/ instance6(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  instance1(0);
__CPROVER_ASYNC_1:
  instance2(0);
__CPROVER_ASYNC_2:
  instance3(0);
__CPROVER_ASYNC_3:
  instance4(0);
__CPROVER_ASYNC_4:
  instance5(0);
__CPROVER_ASYNC_5:
  instance6(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1080 <instance1@plt>
xor    %edi,%edi
call   1040 <instance2@plt>
xor    %edi,%edi
call   1060 <instance3@plt>
xor    %edi,%edi
call   1030 <instance4@plt>
xor    %edi,%edi
call   1070 <instance5@plt>
xor    %edi,%edi
call   1050 <instance6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1080 <instance1@plt>
xor    %edi,%edi
call   1040 <instance2@plt>
xor    %edi,%edi
call   1060 <instance3@plt>
xor    %edi,%edi
call   1030 <instance4@plt>
xor    %edi,%edi
call   1070 <instance5@plt>
xor    %edi,%edi
call   1050 <instance6@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @instance1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @instance2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @instance3(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @instance4(i32 0)
br label %10
10: ; preds = %8
%11 = call i32 @instance5(i32 0)
br label %12
12: ; preds = %10
%13 = call i32 @instance6(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @instance1(i32 0)
%2 = tail call i32 @instance2(i32 0)
%3 = tail call i32 @instance3(i32 0)
%4 = tail call i32 @instance4(i32 0)
%5 = tail call i32 @instance5(i32 0)
%6 = tail call i32 @instance6(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int main() {
  int result;
  char *a = malloc(10);
  a[0] = 0;
  result = a[0];
  free(a);
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
movb   $0x0,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i8* @malloc(i32 10)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %2
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
store i8 0, i8* %1
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
long double gsl_coerce_long_double(const long double x) {
  volatile long double y;
  y = x;
  return y;
}


x86 assembly (clang, -O0):
<gsl_coerce_long_double>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_coerce_long_double>:
fldt   0x8(%rsp)
fstpt  -0x18(%rsp)
fldt   -0x18(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @gsl_coerce_long_double(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
store volatile x86_fp80 %4, x86_fp80* %3
%5 = load volatile x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @gsl_coerce_long_double(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = bitcast x86_fp80* %2 to i8*
store volatile x86_fp80 %0, x86_fp80* %2
%4 = load volatile x86_fp80, x86_fp80* %2
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ ICPrint();
int /*<<< orphan*/ printf(char *);
void ICPrintParents() {
  ICPrint();
  printf("Hello, papa!\n");
}


x86 assembly (clang, -O0):
<ICPrintParents>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ICPrint@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, papa!\0A\00"
define void @ICPrintParents() {
%1 = call i32 (...) @ICPrint()
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello, papa!\00"
define void @ICPrintParents() {
%1 = tail call i32 (...) @ICPrint()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int y8n(int d) {
  switch (d) {
  case (0):
    return (-1);
  case (1):
    return (-1);
  case (2):
    return (0);
  case (3):
    return (1);
  case (4):
    return (1);
  case (5):
    return (1);
  case (6):
    return (0);
  case (7):
    return (-1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<y8n>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     118c <y8n+0x8c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0x0,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0x1,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0x1,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0x1,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0x0,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <y8n+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<y8n>:
xor    %eax,%eax
cmp    $0x7,%edi
ja     1114 <y8n+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.y8n = [8 x i32] [i32 -1, i32 -1, i32 0, i32 1, i32 1, i32 1, i32 0, i32 -1]
define i32 @y8n(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.y8n, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
int mystrlen(const char *string) {
  int length = 0;
  while (*string++) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <mystrlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
cmpb   $0x0,(%rdi)
je     111c <mystrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int getpagesize();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int pageSize = getpagesize();
  printf("Page size - %i bytes\n", pageSize);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%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 <getpagesize@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"Page size - %i bytes\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpagesize()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int parse_unspecified(int);
int /*<<< orphan*/ pipe_global_name();
int parse_macro_stuff(void) {
  pipe_global_name();
  return parse_unspecified(0x20);
}


x86 assembly (clang, -O0):
<parse_macro_stuff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pipe_global_name@plt>
mov    $0x20,%edi
call   1030 <parse_unspecified@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_macro_stuff>:
push   %rax
xor    %eax,%eax
call   1040 <pipe_global_name@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <parse_unspecified@plt>

LLVM IR (-O0):
define i32 @parse_macro_stuff() {
%1 = call i32 (...) @pipe_global_name()
%2 = call i32 @parse_unspecified(i32 32)
ret i32 %2
}

LLVM IR (-O2):
define i32 @parse_macro_stuff() {
%1 = tail call i32 (...) @pipe_global_name()
%2 = tail call i32 @parse_unspecified(i32 32)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
__attribute__((noreturn)) void perr_exit(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<perr_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perr_exit>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @perr_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @perr_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int strlen(char const *);
int isaac_strlen(const char *str) {
  if (!str)
    return 0;
  else
    return strlen(str);
}


x86 assembly (clang, -O0):
<isaac_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <isaac_strlen+0x23>
movl   $0x0,-0x4(%rbp)
jmp    113f <isaac_strlen+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaac_strlen>:
test   %rdi,%rdi
je     111a <isaac_strlen+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isaac_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool tsaf_get_transport_private_data_flag(const uint8_t *p_ts) {
  return !!(p_ts[5] & 0x02);
}


x86 assembly (clang, -O0):
<tsaf_get_transport_private_data_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsaf_get_transport_private_data_flag>:
mov    0x14(%rdi),%eax
shr    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @tsaf_get_transport_private_data_flag(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @tsaf_get_transport_private_data_flag(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
void main() {
  char str1[80], str2[80];
  int strcompare(char *, char *);
  printf("Enter str1:\n");
  gets(str1);
  printf("Enter str2:\n");
  gets(str2);
  strcompare(str1, str2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <gets@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x50(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1050 <strcompare@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xa8,%rsp
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
lea    0x50(%rsp),%r14
mov    %r14,%rdi
call   1040 <gets@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcompare@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter str1:\0A\00"
@.str.1 = [13 x i8] c"Enter str2:\0A\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%11 = call i32 @strcompare(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Enter str1:\00"
@str.2 = [12 x i8] c"Enter str2:\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%8 = call i32 @gets(i8* %4)
%9 = call i32 @strcompare(i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void strcat_unknown_src_length(char *src, int offset) {
  char dst[8] = "1234";
  strcat(dst, &src[offset]);
  if (strlen(dst) < 4)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcat_unknown_src_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
call   1040 <strcat@plt>
lea    -0x14(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jge    1160 <strcat_unknown_src_length+0x40>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_unknown_src_length>:
push   %rbx
sub    $0x10,%rsp
movq   $0x34333231,0x8(%rsp)
33 34
movslq %esi,%rsi
add    %rdi,%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strcat_unknown_src_length.dst = [8 x i8] c"1234\00\00\00\00"
define void @strcat_unknown_src_length(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [8 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [8 x i8]* %5 to i8*
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = call i32 @strcat(i8* %7, i8* %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = icmp slt i32 %14, 4
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i8, i8* null
br label %18
18: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
define void @strcat_unknown_src_length(i8* %0, i32 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 875770417, i64* %3
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = call i32 @strcat(i8* %4, i8* %6)
%8 = call i32 @strlen(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct tm *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ strptime(char *, char *, struct tm *);
time_t get_time(char *time_details) {
  struct tm tm;
  memset(&tm, 0, sizeof(struct tm));
  strptime(time_details, "%Y-%m-%d %H:%M:%S", &tm);
  return mktime(&tm);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <strptime@plt>
lea    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <strptime@plt>
mov    %r14,%rdi
call   1040 <mktime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @get_time(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.tm
store i8* %0, i8** %2
%4 = call i32 @memset(%struct.tm* %3, i32 0, i32 4)
%5 = load i8*, i8** %2
%6 = call i32 @strptime(i8* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
%7 = call i32 @mktime(%struct.tm* %3)
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @get_time(i8* %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = call i32 @memset(%struct.tm* %2, i32 0, i32 4)
%5 = call i32 @strptime(i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
%6 = call i32 @mktime(%struct.tm* %2)
ret i32 %6
}