xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ recv_ack();
scalar_t__ send_msg(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ strlen(char *);
void set_origin() {
  char buf[80];
  sprintf(buf, "C ORIGIN\n");
  if (send_msg(buf, strlen(buf))) {
    recv_ack();
  }
}


x86 assembly (clang, -O0):
<set_origin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%esi
call   1050 <send_msg@plt>
cmp    $0x0,%rax
je     1185 <set_origin+0x45>
mov    $0x0,%al
call   1030 <recv_ack@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_origin>:
push   %rbx
sub    $0x50,%rsp
movabs $0x4e494749524f2043,%rax
47 49 4e
mov    %rax,(%rsp)
movw   $0xa,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <send_msg@plt>
test   %rax,%rax
je     116b <set_origin+0x3b>
xor    %eax,%eax
call   1030 <recv_ack@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"C ORIGIN\0A\00"
define void @set_origin() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = call i64 @send_msg(i8* %4, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @recv_ack()
br label %11
11: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"C ORIGIN\0A\00"
define void @set_origin() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i64 @send_msg(i8* %2, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @recv_ack()
br label %8
8: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int getSelection(void) {
  int selection;
  printf("MAIN MENU\n=========\n1. Input Text\n2. Encrypt\n3. Decrypt\n4. "
         "Exit\nSelection: ");
  fflush(stdin);
  scanf("%d", &selection);
  return selection;
}


x86 assembly (clang, -O0):
<getSelection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xef3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSelection>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    0xefa(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"MAIN MENU\0A=========\0A1. Input Text\0A2. Encrypt\0A3. Decrypt\0A4. Exit\0ASelection: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @getSelection() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = call i32 @fflush(i32 %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [76 x i8] c"MAIN MENU\0A=========\0A1. Input Text\0A2. Encrypt\0A3. Decrypt\0A4. Exit\0ASelection: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @getSelection() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = tail call i32 @fflush(i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
ret i32 %7
}
/* Variables and functions */
unsigned char VIM_HAPI_GetWorkMode();
unsigned char V5H_WorkMode_Get(void) { return (VIM_HAPI_GetWorkMode()); }


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

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

LLVM IR (-O0):
define zeroext i8 @V5H_WorkMode_Get() {
%1 = call zeroext i8 (...) @VIM_HAPI_GetWorkMode()
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @V5H_WorkMode_Get() {
%1 = tail call zeroext i8 (...) @VIM_HAPI_GetWorkMode()
ret i8 %1
}
/* Variables and functions */
int bbm_bulk_read(void *, unsigned short, unsigned short, unsigned char *,
                  unsigned short);
int bbm_com_bulk_read(void *handle, unsigned short devid, unsigned short addr,
                      unsigned char *data, unsigned short size) {
  int res;
  res = bbm_bulk_read(handle, devid, addr, data, size);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_bulk_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %si,-0xa(%rbp)
mov    %dx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0xc(%rbp),%ax
mov    -0x18(%rbp),%rcx
movzwl %dx,%esi
movzwl %ax,%edx
movzwl -0x1a(%rbp),%r8d
call   1030 <bbm_bulk_read@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_bulk_read>:
jmp    1030 <bbm_bulk_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_bulk_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i8* %3, i16 zeroext %4) {
%6 = alloca i8*
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i16
%11 = alloca i32
store i8* %0, i8** %6
store i16 %1, i16* %7
store i16 %2, i16* %8
store i8* %3, i8** %9
store i16 %4, i16* %10
%12 = load i8*, i8** %6
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i16, i16* %10
%17 = call i32 @bbm_bulk_read(i8* %12, i16 zeroext %13, i16 zeroext %14, i8* %15, i16 zeroext %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
define i32 @bbm_com_bulk_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i8* %3, i16 zeroext %4) {
%6 = tail call i32 @bbm_bulk_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i8* %3, i16 zeroext %4)
ret i32 %6
}
double ho_recognize_font_1_seven(const double *array_in) {
  double return_value = 0.0;
  return return_value;
}


x86 assembly (clang, -O0):
<ho_recognize_font_1_seven>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ho_recognize_font_1_seven>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ho_recognize_font_1_seven(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
store double 0.000000e+00, double* %3
%4 = load double, double* %3
ret double %4
}

LLVM IR (-O2):
define double @ho_recognize_font_1_seven(double* nocapture readnone %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ omb_utils_sysvinit(int /*<<< orphan*/ *, char *);
void omb_utils_reboot() { omb_utils_sysvinit(NULL, "6"); }


x86 assembly (clang, -O0):
<omb_utils_reboot>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
lea    0xee1(%rip),%rsi
call   1030 <omb_utils_sysvinit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<omb_utils_reboot>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <omb_utils_sysvinit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"6\00"
define void @omb_utils_reboot() {
%1 = call i32 @omb_utils_sysvinit(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"6\00"
define void @omb_utils_reboot() {
%1 = tail call i32 @omb_utils_sysvinit(i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eputxc(char, int, int, int);
void eputc(char chr, int x, int y) { eputxc(chr, x, y, 0xF000); }


x86 assembly (clang, -O0):
<eputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0xf000,%ecx
movsbl %al,%edi
call   1030 <eputxc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eputc>:
mov    $0xf000,%ecx
jmp    1030 <eputxc@plt>

LLVM IR (-O0):
define void @eputc(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @eputxc(i8 signext %7, i32 %8, i32 %9, i32 61440)
ret void
}

LLVM IR (-O2):
define void @eputc(i8 signext %0, i32 %1, i32 %2) {
%4 = tail call i32 @eputxc(i8 signext %0, i32 %1, i32 %2, i32 61440)
ret void
}
int test_imm_42uint16_mem(unsigned short *val) {
  return ((*val) & (0x42 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_42uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 66
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
kill() {}


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

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

LLVM IR (-O0):
define i32 @kill() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kill() {
ret i32 undef
}
float rayleigh_phase_func(float mu) {
  return 3. * (1. + mu * mu) / (16. * 3.14159265359);
}


x86 assembly (clang, -O0):
<rayleigh_phase_func>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef1(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xedd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rayleigh_phase_func>:
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xef0(%rip),%xmm0
mulsd  0xef0(%rip),%xmm0
divsd  0xef0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @rayleigh_phase_func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fadd double 1.000000e+00, %6
%8 = fmul double 3.000000e+00, %7
%9 = fdiv double %8, 0x404921FB54442EEA
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @rayleigh_phase_func(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fmul double %4, 3.000000e+00
%6 = fdiv double %5, 0x404921FB54442EEA
%7 = fptrunc double %6 to float
ret float %7
}
int DRV_GET_GPIO_INFO(unsigned char *pGpioInfo, unsigned long ulLength) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_GPIO_INFO(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ouverture(char *, char *, int);
int main(void) {
  ouverture("essai.open_3", "w+", 1);
  ouverture("essai.open_3", "w+", 1);
  ouverture("essai.open_3", "w+", 0);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x1,%edx
call   1030 <ouverture@plt>
lea    0xec2(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x1,%edx
call   1030 <ouverture@plt>
lea    0xeaa(%rip),%rdi
lea    0xeb0(%rip),%rsi
xor    %edx,%edx
call   1030 <ouverture@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0xeeb(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <ouverture@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <ouverture@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <ouverture@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"essai.open_3\00"
@.str.1 = [3 x i8] c"w+\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ouverture(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @ouverture(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 @ouverture(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"essai.open_3\00"
@.str.1 = [3 x i8] c"w+\00"
define i32 @main() {
%1 = tail call i32 @ouverture(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 @ouverture(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @ouverture(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdout;
void print_string(char *string) {
  printf("%s", string);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdout = global i32 0
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zed_log_stderr_close();
int /*<<< orphan*/ zed_log_syslog_close();
void zed_log_fini(void) {
  zed_log_stderr_close();
  zed_log_syslog_close();
}


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

x86 assembly (clang, -O2):
<zed_log_fini>:
push   %rax
xor    %eax,%eax
call   1040 <zed_log_stderr_close@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <zed_log_syslog_close@plt>

LLVM IR (-O0):
define void @zed_log_fini() {
%1 = call i32 (...) @zed_log_stderr_close()
%2 = call i32 (...) @zed_log_syslog_close()
ret void
}

LLVM IR (-O2):
define void @zed_log_fini() {
%1 = tail call i32 (...) @zed_log_stderr_close()
%2 = tail call i32 (...) @zed_log_syslog_close()
ret void
}
/* Variables and functions */
void Reserved_Handler5(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Reserved_Handler5() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ CaptureInput();
int /*<<< orphan*/ HaxKBSetup();
int /*<<< orphan*/ Init();
int main(int argc, char *args[]) {
  if (!Init()) {
    return -1;
  }
  HaxKBSetup();
  CaptureInput();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <Init@plt>
cmp    $0x0,%eax
jne    1162 <main+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <main+0x47>
mov    $0x0,%al
call   1050 <HaxKBSetup@plt>
mov    $0x0,%al
call   1030 <CaptureInput@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <Init@plt>
test   %eax,%eax
je     114e <main+0x1e>
xor    %eax,%eax
call   1050 <HaxKBSetup@plt>
xor    %eax,%eax
call   1030 <CaptureInput@plt>
jmp    1153 <main+0x23>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 (...) @HaxKBSetup()
%7 = tail call i32 (...) @CaptureInput()
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
void TimerM$AlarmControl$disableEvents(void) {
  MSP430TimerM$ControlB3$disableEvents();
}


x86 assembly (clang, -O0):
<TimerM$AlarmControl$disableEvents>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MSP430TimerM$ControlB3$disableEvents@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerM$AlarmControl$disableEvents>:
xor    %eax,%eax
jmp    1030 <MSP430TimerM$ControlB3$disableEvents@plt>

LLVM IR (-O0):
define void @"TimerM$AlarmControl$disableEvents"() {
%1 = call i32 (...) @"MSP430TimerM$ControlB3$disableEvents"()
ret void
}

LLVM IR (-O2):
define void @"TimerM$AlarmControl$disableEvents"() {
%1 = tail call i32 (...) @"MSP430TimerM$ControlB3$disableEvents"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float fasterpow2(float p) {
  float clipp = (p < -126) ? -126.0f : p;
  union {
    uint32_t i;
    float f;
  } v = {(1 << 23) * (clipp + 126.94269504f)};
  return v.f;
}


x86 assembly (clang, -O0):
<fasterpow2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    112d <fasterpow2+0x2d>
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1137 <fasterpow2+0x37>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebf(%rip),%xmm1
addss  -0x8(%rbp),%xmm1
movss  0xeae(%rip),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterpow2>:
movss  0xef8(%rip),%xmm1
maxss  %xmm0,%xmm1
addss  0xef0(%rip),%xmm1
mulss  0xeec(%rip),%xmm1
cvttss2si %xmm1,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @fasterpow2(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = fcmp olt float %5, -1.260000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %7
%11 = phi float [ -1.260000e+02, %7 ], [ %9, %8 ]
store float %11, float* %3
%12 = bitcast %union.anon* %4 to i32*
%13 = load float, float* %3
%14 = fadd float %13, 0x405FBC5520000000
%15 = fmul float 0x4160000000000000, %14
%16 = fptosi float %15 to i32
store i32 %16, i32* %12
%17 = bitcast %union.anon* %4 to float*
%18 = load float, float* %17
ret float %18
}

LLVM IR (-O2):
define float @fasterpow2(float %0) {
%2 = fcmp olt float %0, -1.260000e+02
%3 = select i1 %2, float -1.260000e+02, float %0
%4 = fadd float %3, 0x405FBC5520000000
%5 = fmul float %4, 0x4160000000000000
%6 = fptosi float %5 to i32
%7 = bitcast i32 %6 to float
ret float %7
}
void stuff() {}


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

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

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

LLVM IR (-O2):
define void @stuff() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void do_work(void *arg) {
  int *timep = (int *)arg;
  printf("Sleeping for %d seconds\n", *timep);
  sleep(*timep);
  printf("Woke up after %d seconds\n", *timep);
  free(arg);
}


x86 assembly (clang, -O0):
<do_work>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1050 <sleep@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_work>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1050 <sleep@plt>
mov    (%rbx),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Sleeping for %d seconds\0A\00"
@.str.1 = [26 x i8] c"Woke up after %d seconds\0A\00"
define void @do_work(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @sleep(i32 %10)
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i8*, i8** %2
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Sleeping for %d seconds\0A\00"
@.str.1 = [26 x i8] c"Woke up after %d seconds\0A\00"
define void @do_work(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = tail call i32 @sleep(i32 %5)
%7 = load i32, i32* %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec * 1.e-6;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t __attribute__((no, noclone)) vec_while_int16_t(int16_t *restrict a) {
  for (int i = 0; i < 8; ++i)
    a[i] += 1;
}


x86 assembly (clang, -O0):
<vec_while_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1138 <vec_while_int16_t+0x38>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <vec_while_int16_t+0xf>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_while_int16_t>:
pcmpeqd %xmm0,%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
psubd  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
psubd  %xmm0,%xmm2
movdqu %xmm2,0x10(%rdi)
ret

LLVM IR (-O0):
define i32 @vec_while_int16_t(i32* noalias %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
br label %15
15: ; preds = %8
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @vec_while_int16_t(i32* noalias nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = add nsw <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
ret i32 undef
}
void board_putc(int ch) {
  while (((*(volatile unsigned int *)(0xb8020000 + 4 * (5))) & 0x20) == 0)
    ;
  *(volatile unsigned int *)(0xb8020000 + 4 * (0)) = (ch);
  while (((*(volatile unsigned int *)(0xb8020000 + 4 * (5))) & 0x20) == 0)
    ;
}


x86 assembly (clang, -O0):
<board_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xb8020014,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    111f <board_putc+0x1f>
jmp    1107 <board_putc+0x7>
mov    -0x4(%rbp),%ecx
mov    $0xb8020000,%eax
mov    %ecx,(%rax)
mov    $0xb8020014,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    1141 <board_putc+0x41>
jmp    1129 <board_putc+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_putc>:
mov    $0xb8020014,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x20,(%rax)
je     1110 <board_putc+0x10>
mov    %edi,-0x14(%rax)
nopl   0x0(%rax,%rax,1)
testl  $0x20,(%rax)
je     1120 <board_putc+0x20>
ret

LLVM IR (-O0):
define void @board_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* inttoptr (i64 3087138836 to i32*)
%5 = and i32 %4, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* %2
store volatile i32 %9, i32* inttoptr (i64 3087138816 to i32*)
br label %10
10: ; preds = %14, %8
%11 = load volatile i32, i32* inttoptr (i64 3087138836 to i32*)
%12 = and i32 %11, 32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @board_putc(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3087138836 to i32*)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 3087138816 to i32*)
br label %7
7: ; preds = %7, %6
%8 = load volatile i32, i32* inttoptr (i64 3087138836 to i32*)
%9 = and i32 %8, 32
%10 = icmp eq i32 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
ret void
}
int test_imm_94int8_reg(signed char val) {
  return ((val) & (-0x94 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_94int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff6c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_94int8_reg>:
test   $0xffffff6c,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_94int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -148
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int countLines(FILE *file) {
  int lines = 0;
  char buf[256];
  while (fgets(buf, 256, file) != NULL) {
    lines++;
  }
  rewind(file);
  return lines;
}


x86 assembly (clang, -O0):
<countLines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1163 <countLines+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <countLines+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0xc(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countLines>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%r14
mov    $0xffffffff,%ebx
mov    %rsp,%r15
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1040 <fgets@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1140 <countLines+0x20>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %ebx,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @countLines(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [256 x i8]
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %10, %1
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32* @fgets(i8* %6, i32 256, i32* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %5
13: ; preds = %5
%14 = load i32*, i32** %2
%15 = call i32 @rewind(i32* %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @countLines(i32* nocapture %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i32* @fgets(i8* %3, i32 256, i32* %0)
%7 = icmp eq i32* %6, null
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
%10 = call i32 @rewind(i32* %0)
ret i32 %5
}
/* Variables and functions */
int get_encoded_dynmessage_length(unsigned char *, int);
scalar_t__ verify_dynmessage_start(unsigned char *, int);
extern int verify_full_dynmessage(unsigned char *data, int data_len) {
  int verified = 0;
  if (verify_dynmessage_start(data, data_len)) {
    int dynmessage_length = get_encoded_dynmessage_length(data, data_len);
    verified = dynmessage_length <= data_len;
  }
  return verified;
}


x86 assembly (clang, -O0):
<verify_full_dynmessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <verify_dynmessage_start@plt>
cmp    $0x0,%rax
je     116c <verify_full_dynmessage+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <get_encoded_dynmessage_length@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_full_dynmessage>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <verify_dynmessage_start@plt>
test   %rax,%rax
je     1148 <verify_full_dynmessage+0x28>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <get_encoded_dynmessage_length@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setle  %al
jmp    114a <verify_full_dynmessage+0x2a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @verify_full_dynmessage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i64 @verify_dynmessage_start(i8* %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = call i32 @get_encoded_dynmessage_length(i8* %12, i32 %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp sle i32 %15, %16
%18 = zext i1 %17 to i32
store i32 %18, i32* %5
br label %19
19: ; preds = %11, %2
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @verify_full_dynmessage(i8* %0, i32 %1) {
%3 = tail call i64 @verify_dynmessage_start(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @get_encoded_dynmessage_length(i8* %0, i32 %1)
%7 = icmp sle i32 %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x63() {
  Assert_real((isascii(99)),
              "/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_isascii.c",
              500, ("isascii should be 1 for c"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x63>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x1f4,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for c\00"
define void @t_isascii_0x63() {
%1 = call i32 @isascii(i32 99)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 500, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for c\00"
define void @t_isascii_0x63() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_bus_wait(void *bus,
                                                       uint64_t timeout_usec) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_wait>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_wait(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_wait(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
int test_imm_6Cuint8_reg(unsigned char val) {
  return ((val) & (0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x6c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Cuint8_reg>:
test   $0x6c,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 108
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSource(struct sqlConnection *, int, char *);
char *visiGeneAcknowledgement(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSource(conn, id, "acknowledgement");
}


x86 assembly (clang, -O0):
<visiGeneAcknowledgement>:
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
call   1030 <stringFieldInSubmissionSource@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneAcknowledgement>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSource@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [16 x i8] c"acknowledgement\00"
define i8* @visiGeneAcknowledgement(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSource(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [16 x i8] c"acknowledgement\00"
define i8* @visiGeneAcknowledgement(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSource(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int XImageByteOrder() {}


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

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

LLVM IR (-O0):
define i32 @XImageByteOrder() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XImageByteOrder() {
ret i32 undef
}
int test_imm_34int16_reg(short val) {
  return ((val) & (-0x34 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_34int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffcc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_34int16_reg>:
test   $0xffcc,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_34int16_reg(i16 signext %0) {
%2 = and i16 %0, -52
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ordenadas(int *x, int *y) {
  int aux;
  if (*x > *y) {
    aux = *x;
    *x = *y;
    *y = aux;
  }
}


x86 assembly (clang, -O0):
<ordenadas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    113c <ordenadas+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ordenadas>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
jle    110c <ordenadas+0xc>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @ordenadas(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %4, i32* %0
store i32 %3, i32* %1
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void cross_sleep(int sleep_ms) { usleep(sleep_ms * 1000); }


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

x86 assembly (clang, -O2):
<cross_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @cross_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @cross_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
unsigned long long reverseBits_fun_ullong(unsigned long long x) {
  unsigned long long r = x;
  int i = 63;
  while (x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_ullong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x3f,-0x14(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1152 <reverseBits_fun_ullong+0x52>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <reverseBits_fun_ullong+0x17>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_ullong>:
mov    $0x3f,%ecx
cmp    $0x2,%rdi
jae    1112 <reverseBits_fun_ullong+0x12>
mov    %rdi,%rax
shl    %cl,%rax
ret
mov    $0x3f,%ecx
mov    %rdi,%rax
mov    %rdi,%rdx
nopl   (%rax)
shr    %rdx
mov    %edx,%esi
and    $0x1,%esi
lea    (%rsi,%rax,2),%rax
add    $0xffffffff,%ecx
cmp    $0x3,%rdi
mov    %rdx,%rdi
ja     1120 <reverseBits_fun_ullong+0x20>
mov    %ecx,%ecx
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @reverseBits_fun_ullong(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 63, %1 ]
%6 = phi i64 [ %10, %3 ], [ %0, %1 ]
%7 = lshr i64 %4, 1
%8 = shl i64 %6, 1
%9 = and i64 %7, 1
%10 = or i64 %8, %9
%11 = add nsw i32 %5, -1
%12 = icmp ult i64 %4, 4
br i1 %12, label %13, label %3
13: ; preds = %3
%14 = zext i32 %11 to i64
br label %15
15: ; preds = %13, %1
%16 = phi i64 [ %0, %1 ], [ %10, %13 ]
%17 = phi i64 [ 63, %1 ], [ %14, %13 ]
%18 = shl i64 %16, %17
ret i64 %18
}
int omap5_thermal_remove_sensor(struct omap_bandgap *bg_ptr, int id) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.omap_bandgap = type opaque
define i32 @omap5_thermal_remove_sensor(%struct.omap_bandgap* %0, i32 %1) {
%3 = alloca %struct.omap_bandgap*
%4 = alloca i32
store %struct.omap_bandgap* %0, %struct.omap_bandgap** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.omap_bandgap = type opaque
define i32 @omap5_thermal_remove_sensor(%struct.omap_bandgap* nocapture readnone %0, i32 %1) {
ret i32 0
}