xunge/DecIR huggingface dataset:
int test_imm_27int8_reg(signed char val) {
  return ((val) & (-0x27 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_27int8_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, -39
%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_27int8_reg(i8 signext %0) {
%2 = and i8 %0, -39
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void os_exit(int status) { exit(status); }


x86 assembly (clang, -O0):
<os_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<os_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @os_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ soar_cReInitSoar();
void reinitialize_soar(void) { soar_cReInitSoar(); }


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

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

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

LLVM IR (-O2):
define void @reinitialize_soar() {
%1 = tail call i32 (...) @soar_cReInitSoar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void on_dtmf_detected(void *usrdata, const char *digits, int len) {
  printf("Detected %s\n", digits);
}


x86 assembly (clang, -O0):
<on_dtmf_detected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Detected %s\0A\00"
define void @on_dtmf_detected(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
struct cla {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cla_print_dot_fp(struct cla *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void cla_print_dot(struct cla *cmd) { cla_print_dot_fp(cmd, stdout); }


x86 assembly (clang, -O0):
<cla_print_dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <cla_print_dot_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cla_print_dot>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <cla_print_dot_fp@plt>

LLVM IR (-O0):
%struct.cla = type { i32 }
@stdout = global i32 0
define void @cla_print_dot(%struct.cla* %0) {
%2 = alloca %struct.cla*
store %struct.cla* %0, %struct.cla** %2
%3 = load %struct.cla*, %struct.cla** %2
%4 = load i32, i32* @stdout
%5 = call i32 @cla_print_dot_fp(%struct.cla* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.cla = type { i32 }
@stdout = global i32 0
define void @cla_print_dot(%struct.cla* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @cla_print_dot_fp(%struct.cla* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
size_t wcslen(int /*<<< orphan*/ const *);
int wmemcmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *, size_t);
int wcscmp(const wchar_t *a, const wchar_t *b) {
  size_t n = wcslen(a);
  size_t m = wcslen(b);
  return wmemcmp(a, b, (n < m ? n : m) + 1);
}


x86 assembly (clang, -O0):
<wcscmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wcslen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wcslen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1175 <wcscmp+0x55>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    117d <wcscmp+0x5d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rdx
add    $0x1,%rdx
call   1040 <wmemcmp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcscmp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <wcslen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <wcslen@plt>
cmp    %rax,%rbx
cmovae %rax,%rbx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <wmemcmp@plt>

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

LLVM IR (-O2):
define i32 @wcscmp(i32* %0, i32* %1) {
%3 = tail call i64 @wcslen(i32* %0)
%4 = tail call i64 @wcslen(i32* %1)
%5 = icmp ult i64 %3, %4
%6 = select i1 %5, i64 %3, i64 %4
%7 = add i64 %6, 1
%8 = tail call i32 @wmemcmp(i32* %0, i32* %1, i64 %7)
ret i32 %8
}
extern int f8(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f8() {
ret i32 0
}

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

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSA_PSS_PARAMS_it;
int i2d_RSA_PSS_PARAMS(RSA_PSS_PARAMS *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &RSA_PSS_PARAMS_it);
}


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

x86 assembly (clang, -O2):
<i2d_RSA_PSS_PARAMS>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@RSA_PSS_PARAMS_it = global i32 0
define i32 @i2d_RSA_PSS_PARAMS(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @RSA_PSS_PARAMS_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sendBlink(int, int, int, int);
int /*<<< orphan*/ sendConf(int, int);
void setBlueBlink(int sockfd, int timeOn, int period) {
  sendConf(sockfd, (1 << 7) | (3 << 3) | (2 << 1));
  sendBlink(sockfd, 0x13, timeOn, period);
}


x86 assembly (clang, -O0):
<setBlueBlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9c,%esi
call   1040 <sendConf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x13,%esi
call   1030 <sendBlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBlueBlink>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x9c,%esi
call   1040 <sendConf@plt>
mov    %ebx,%edi
mov    $0x13,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sendBlink@plt>

LLVM IR (-O0):
define void @setBlueBlink(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @sendConf(i32 %7, i32 156)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @sendBlink(i32 %9, i32 19, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @setBlueBlink(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @sendConf(i32 %0, i32 156)
%5 = tail call i32 @sendBlink(i32 %0, i32 19, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void docompletehalt(void) { exit(0); }


x86 assembly (clang, -O0):
<docompletehalt>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<docompletehalt>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @docompletehalt() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @docompletehalt() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
void getWord_validinput_returnsword(int byteAddr) {}


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

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

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

LLVM IR (-O2):
define void @getWord_validinput_returnsword(i32 %0) {
ret void
}
void rop3_190_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

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

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

LLVM IR (-O2):
define void @rop3_190_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ A_BOLD;
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int /*<<< orphan*/ const, int /*<<< orphan*/ const,
                            char *, int /*<<< orphan*/ const);
void draw_score(const uint32_t y, const uint32_t x, const uint8_t score) {
  attron(A_BOLD);
  mvprintw(y, x, "%i", score);
}


x86 assembly (clang, -O0):
<draw_score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <attron@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xeb1(%rip),%rdx
call   1040 <mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_score>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <attron@plt>
lea    0xec0(%rip),%rdx
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <mvprintw@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
@.str = [3 x i8] c"%i\00"
define void @draw_score(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @A_BOLD
%8 = call i32 @attron(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @mvprintw(i32 %9, i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@.str = [3 x i8] c"%i\00"
define void @draw_score(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @A_BOLD
%5 = tail call i32 @attron(i32 %4)
%6 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void vld_Construct(_rep, _Base_Construct) int *_rep, _Base_Construct;
{ Construct_XST_FNC_OBJ(_rep, _Base_Construct); }


x86 assembly (clang, -O0):
<vld_Construct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <Construct_XST_FNC_OBJ@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vld_Construct(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @Construct_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @vld_Construct(i32* %0, i32 %1) {
%3 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @Construct_XST_FNC_OBJ to i32 (i32*, i32, ...)*)(i32* %0, i32 %1)
ret void
}
int test_imm_BAuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xBA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BAuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 186
%6 = icmp ne i64 %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_BAuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 186
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ cli();
int /*<<< orphan*/ enable_irq(int);
int /*<<< orphan*/ timerinit();
void intrinit(void) {
  cli();
  enable_irq(0);
  enable_irq(1);
  timerinit();
}


x86 assembly (clang, -O0):
<intrinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <cli@plt>
xor    %edi,%edi
call   1030 <enable_irq@plt>
mov    $0x1,%edi
call   1030 <enable_irq@plt>
mov    $0x0,%al
call   1050 <timerinit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intrinit>:
push   %rax
xor    %eax,%eax
call   1040 <cli@plt>
xor    %edi,%edi
call   1030 <enable_irq@plt>
mov    $0x1,%edi
call   1030 <enable_irq@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <timerinit@plt>

LLVM IR (-O0):
define void @intrinit() {
%1 = call i32 (...) @cli()
%2 = call i32 @enable_irq(i32 0)
%3 = call i32 @enable_irq(i32 1)
%4 = call i32 (...) @timerinit()
ret void
}

LLVM IR (-O2):
define void @intrinit() {
%1 = tail call i32 (...) @cli()
%2 = tail call i32 @enable_irq(i32 0)
%3 = tail call i32 @enable_irq(i32 1)
%4 = tail call i32 (...) @timerinit()
ret void
}
double adaptivereleasecurve(double x, double a, double b, double c, double d) {
  double x2 = x * x;
  return a * x2 * x + b * x2 + c * x + d;
}


x86 assembly (clang, -O0):
<adaptivereleasecurve>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adaptivereleasecurve>:
movapd %xmm0,%xmm5
mulsd  %xmm0,%xmm5
mulsd  %xmm5,%xmm1
mulsd  %xmm2,%xmm5
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm5
mulsd  %xmm3,%xmm0
addsd  %xmm5,%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @adaptivereleasecurve(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %6
%13 = load double, double* %6
%14 = fmul double %12, %13
store double %14, double* %11
%15 = load double, double* %7
%16 = load double, double* %11
%17 = fmul double %15, %16
%18 = load double, double* %6
%19 = load double, double* %8
%20 = load double, double* %11
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %17, double %18, double %21)
%23 = load double, double* %9
%24 = load double, double* %6
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double %22)
%26 = load double, double* %10
%27 = fadd double %25, %26
ret double %27
}

LLVM IR (-O2):
define double @adaptivereleasecurve(double %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %0, %0
%7 = fmul double %6, %1
%8 = fmul double %6, %2
%9 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %9)
%11 = fadd double %10, %4
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rc_print_bb_model();
int main() {
  printf("\nCurrently running on a:\n");
  rc_print_bb_model();
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <rc_print_bb_model@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [25 x i8] c"\0ACurrently running on a:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @rc_print_bb_model()
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void error(const char *msg) {
  fprintf(stderr, "error: %s: %s\n", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"error: %s: %s\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"error: %s: %s\0A\00"
@errno = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int calc(int a, int b, int (*strategy)(int, int)) { return (*strategy)(a, b); }


x86 assembly (clang, -O0):
<calc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @calc(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
char *strrchr(char const *, char);
char *SSL_String_Get_Filetype(const char *str) {
  const char *dot = strrchr(str, '.');
  if (!dot || dot == str)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<SSL_String_Get_Filetype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <SSL_String_Get_Filetype+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <SSL_String_Get_Filetype+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <SSL_String_Get_Filetype+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_String_Get_Filetype>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @SSL_String_Get_Filetype(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @SSL_String_Get_Filetype(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() { printf("%s", "Hello World"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int pow257(int, int);
int mkoff_s_n(int i) { return pow257(139, 127 * i); }


x86 assembly (clang, -O0):
<mkoff_s_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x7f,-0x4(%rbp),%esi
mov    $0x8b,%edi
call   1030 <pow257@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkoff_s_n>:
mov    %edi,%esi
shl    $0x7,%esi
sub    %edi,%esi
mov    $0x8b,%edi
jmp    1030 <pow257@plt>

LLVM IR (-O0):
define i32 @mkoff_s_n(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 127, %3
%5 = call i32 @pow257(i32 139, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @mkoff_s_n(i32 %0) {
%2 = mul nsw i32 %0, 127
%3 = tail call i32 @pow257(i32 139, i32 %2)
ret i32 %3
}
int derefArg(int *p) { return *p; }


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

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

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

LLVM IR (-O2):
define i32 @derefArg(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int __feh;

/* Variables and functions */
int write(int, short *, int);
int bewrite16(int fd, short c) {
  int r;
  do {
    short __feh = c;
    if (!1)
      c = c;
    else
      c = ((((__feh) >> 8) & 0xff) | (((__feh)&0xff) << 8));
  } while (0);
  r = write(fd, &c, 2);
  return r;
}


x86 assembly (clang, -O0):
<bewrite16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movswl -0xe(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bewrite16>:
push   %rax
rol    $0x8,%si
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bewrite16(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
%6 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
br label %7
7: ; preds = %2
%8 = load i16, i16* %4
store i16 %8, i16* %6
%9 = load i16, i16* %6
%10 = sext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = load i16, i16* %6
%14 = sext i16 %13 to i32
%15 = and i32 %14, 255
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = trunc i32 %17 to i16
store i16 %18, i16* %4
br label %19
19: ; preds = %7
%20 = load i32, i32* %3
%21 = call i32 @write(i32 %20, i16* %4, i32 2)
store i32 %21, i32* %5
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
define i32 @bewrite16(i32 %0, i16 signext %1) {
%3 = alloca i16
%4 = tail call i16 @llvm.bswap.i16(i16 %1)
store i16 %4, i16* %3
%5 = call i32 @write(i32 %0, i16* %3, i32 2)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
mode_t getumask(void) {
  mode_t ret = umask(0);
  umask(ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<getumask>:
push   %rbx
xor    %edi,%edi
call   1030 <umask@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <umask@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getumask() {
%1 = tail call i32 @umask(i32 0)
%2 = tail call i32 @umask(i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ check(int);
int aa(int b) {
  int a = 1;
  if (a == 1) {
    a = 1;
  }
  if (a == 2) {
    a = 2;
  } else {
    a = 3;
  }
  if (!check(a)) {
    a = 0;
  }
}


x86 assembly (clang, -O0):
<aa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1133 <aa+0x23>
movl   $0x1,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jne    1149 <aa+0x39>
movl   $0x2,-0xc(%rbp)
jmp    1150 <aa+0x40>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <check@plt>
cmp    $0x0,%eax
jne    1168 <aa+0x58>
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa>:
mov    $0x3,%edi
jmp    1030 <check@plt>

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

LLVM IR (-O2):
define i32 @aa(i32 %0) {
%2 = tail call i32 @check(i32 3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ draw(double, double);
int /*<<< orphan*/ move(double, double);
int /*<<< orphan*/ printf(char *);
void line(double xd, double yd, double xf, double yf) {
  printf("newpath ");
  move(xd, yd);
  draw(xf, yf);
  printf("stroke\n");
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <move@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <draw@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <move@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1040 <draw@plt>
lea    0xe78(%rip),%rdi
add    $0x28,%rsp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"newpath \00"
@.str.1 = [8 x i8] c"stroke\0A\00"
define void @line(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call i32 @move(double %10, double %11)
%13 = load double, double* %7
%14 = load double, double* %8
%15 = call i32 @draw(double %13, double %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"newpath \00"
@str = [7 x i8] c"stroke\00"
define void @line(double %0, double %1, double %2, double %3) {
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @move(double %0, double %1)
%7 = tail call i32 @draw(double %2, double %3)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int ft_isalnum(int c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
      (c >= '0' && c <= '9'))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     111b <ft_isalnum+0x1b>
cmpl   $0x7a,-0x8(%rbp)
jle    1143 <ft_isalnum+0x43>
cmpl   $0x41,-0x8(%rbp)
jl     112f <ft_isalnum+0x2f>
cmpl   $0x5a,-0x8(%rbp)
jle    1143 <ft_isalnum+0x43>
cmpl   $0x30,-0x8(%rbp)
jl     114f <ft_isalnum+0x4f>
cmpl   $0x39,-0x8(%rbp)
jg     114f <ft_isalnum+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_isalnum+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
int get_rtc_year(void) {
  (*(volatile unsigned int *)(0x7E005040)) |= (1 << 3);
  (*(volatile unsigned int *)(0x7E005040)) = 1;
  char value = (*(volatile unsigned int *)(0x7E005088));
  int year = ((value >> 4) & 0xF) * 10 + (value & 0xF);
  (*(volatile unsigned int *)(0x7E005040)) = 0;
  return year;
}


x86 assembly (clang, -O0):
<get_rtc_year>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e005040,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x7e005040,%eax
mov    %ecx,(%rax)
mov    $0x7e005040,%eax
movl   $0x1,(%rax)
mov    $0x7e005088,%eax
mov    (%rax),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
imul   $0xa,%eax,%eax
movsbl -0x1(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x7e005040,%eax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rtc_year>:
orl    $0x8,0x7e005040
08
movl   $0x1,0x7e005040
mov    0x7e005088,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
and    $0xf,%ecx
lea    (%rcx,%rcx,4),%ecx
and    $0xf,%eax
lea    (%rax,%rcx,2),%eax
movl   $0x0,0x7e005040
ret

LLVM IR (-O0):
define i32 @get_rtc_year() {
%1 = alloca i8
%2 = alloca i32
%3 = load volatile i32, i32* inttoptr (i64 2113949760 to i32*)
%4 = or i32 %3, 8
store volatile i32 %4, i32* inttoptr (i64 2113949760 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113949760 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 2113949832 to i32*)
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, 4
%10 = and i32 %9, 15
%11 = mul nsw i32 %10, 10
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = and i32 %13, 15
%15 = add nsw i32 %11, %14
store i32 %15, i32* %2
store volatile i32 0, i32* inttoptr (i64 2113949760 to i32*)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_rtc_year() {
%1 = load volatile i32, i32* inttoptr (i64 2113949760 to i32*)
%2 = or i32 %1, 8
store volatile i32 %2, i32* inttoptr (i64 2113949760 to i32*)
store volatile i32 1, i32* inttoptr (i64 2113949760 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 2113949832 to i32*)
%4 = lshr i32 %3, 4
%5 = and i32 %4, 15
%6 = mul nuw nsw i32 %5, 10
%7 = and i32 %3, 15
%8 = add nuw nsw i32 %6, %7
store volatile i32 0, i32* inttoptr (i64 2113949760 to i32*)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ posix_words();
void platform_words() { posix_words(); }


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

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

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

LLVM IR (-O2):
define void @platform_words() {
%1 = tail call i32 (...) @posix_words()
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
struct tm *local_time();
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char const *, struct tm *);
extern void formated_system_datetime(char *ret, const char *format) {
  struct tm *t_st;
  char buf[128];
  t_st = local_time();
  strftime(buf, sizeof(buf), format, t_st);
  strcpy(ret, buf);
}


x86 assembly (clang, -O0):
<formated_system_datetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <local_time@plt>
mov    %rax,-0x18(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x80,%esi
call   1050 <strftime@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formated_system_datetime>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <local_time@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x80,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @formated_system_datetime(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.tm*
%6 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call %struct.tm* (...) @local_time()
store %struct.tm* %7, %struct.tm** %5
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load %struct.tm*, %struct.tm** %5
%11 = call i32 @strftime(i8* %8, i32 128, i8* %9, %struct.tm* %10)
%12 = load i8*, i8** %3
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @formated_system_datetime(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = tail call %struct.tm* (...) @local_time()
%6 = call i32 @strftime(i8* %4, i32 128, i8* %1, %struct.tm* %5)
%7 = call i32 @strcpy(i8* %0, i8* %4)
ret void
}
int symlink(const char *path1, const char *path2) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @symlink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sort2(int *, int *);
void sort3(int *x, int *y, int *z) {
  sort2(x, z);
  sort2(x, y);
  sort2(y, z);
}


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

x86 assembly (clang, -O2):
<sort3>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdx,%rsi
call   1030 <sort2@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <sort2@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <sort2@plt>

LLVM IR (-O0):
define void @sort3(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %6
%9 = call i32 @sort2(i32* %7, i32* %8)
%10 = load i32*, i32** %4
%11 = load i32*, i32** %5
%12 = call i32 @sort2(i32* %10, i32* %11)
%13 = load i32*, i32** %5
%14 = load i32*, i32** %6
%15 = call i32 @sort2(i32* %13, i32* %14)
ret void
}

LLVM IR (-O2):
define void @sort3(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @sort2(i32* %0, i32* %2)
%5 = tail call i32 @sort2(i32* %0, i32* %1)
%6 = tail call i32 @sort2(i32* %1, i32* %2)
ret void
}
double atan_66s(double x) {
  static const double c1 = 1.6867629106;
  static const double c2 = 0.4378497304;
  static const double c3 = 1.6867633134;
  double x2;
  x2 = x * x;
  return (x * (c1 + x2 * c2) / (c3 + x2));
}


x86 assembly (clang, -O0):
<atan_66s>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xede(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeda(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan_66s>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  0xeec(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@atan_66s.c1 = internal constant double 0x3FFAFCFB1B121FD5
@atan_66s.c2 = internal constant double 0x3FDC05BAE02858C1
@atan_66s.c3 = internal constant double 0x3FFAFCFB8732545F
define double @atan_66s(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3FDC05BAE02858C1, double 0x3FFAFCFB1B121FD5)
%10 = fmul double %7, %9
%11 = load double, double* %3
%12 = fadd double 0x3FFAFCFB8732545F, %11
%13 = fdiv double %10, %12
ret double %13
}

LLVM IR (-O2):
define double @atan_66s(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FDC05BAE02858C1, double 0x3FFAFCFB1B121FD5)
%4 = fmul double %3, %0
%5 = fadd double %2, 0x3FFAFCFB8732545F
%6 = fdiv double %4, %5
ret double %6
}
void mem_text_address_writeable(unsigned long addr) {}


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

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

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

LLVM IR (-O2):
define void @mem_text_address_writeable(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort(int *, int /*<<< orphan*/, int, int);
void quickSort(int ar_size, int *ar) { sort(ar, 0, ar_size, ar_size); }


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%ecx
xor    %esi,%esi
call   1030 <sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
mov    %edi,%ecx
mov    %rsi,%rdi
xor    %esi,%esi
mov    %ecx,%edx
jmp    1030 <sort@plt>

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

LLVM IR (-O2):
define void @quickSort(i32 %0, i32* %1) {
%3 = tail call i32 @sort(i32* %1, i32 0, i32 %0, i32 %0)
ret void
}