xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ m_del(int, int);
int /*<<< orphan*/ m_free_strings(int, int /*<<< orphan*/);
scalar_t__ mls(int, int);
int v_find_key(int, char const *);
void v_remove(int vs, const char *name) {
  int pos = v_find_key(vs, name);
  if (pos >= 0) {
    m_free_strings((*(int *)mls((vs), (pos))), 0);
    m_del(vs, pos);
  }
}


x86 assembly (clang, -O0):
<v_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <v_find_key@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1187 <v_remove+0x47>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1060 <mls@plt>
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <m_free_strings@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <m_del@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_remove>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <v_find_key@plt>
test   %eax,%eax
js     1171 <v_remove+0x31>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <mls@plt>
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <m_free_strings@plt>
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m_del@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @v_remove(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @v_find_key(i32 %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i64 @mls(i32 %12, i32 %13)
%15 = inttoptr i64 %14 to i32*
%16 = load i32, i32* %15
%17 = call i32 @m_free_strings(i32 %16, i32 0)
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = call i32 @m_del(i32 %18, i32 %19)
br label %21
21: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @v_remove(i32 %0, i8* %1) {
%3 = tail call i32 @v_find_key(i32 %0, i8* %1)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @mls(i32 %0, i32 %3)
%7 = inttoptr i64 %6 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @m_free_strings(i32 %8, i32 0)
%10 = tail call i32 @m_del(i32 %0, i32 %3)
br label %11
11: ; preds = %5, %2
ret void
}
void save_to_eeprom(void) {}


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

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

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

LLVM IR (-O2):
define void @save_to_eeprom() {
ret void
}
/* Variables and functions */
int BTAC1C2_EncodeQuantUni2(int, int, int, int, int);
int BTAC1C2_EncodeQuantUni(int tgt, int pred, int step, int lsbit) {
  return (BTAC1C2_EncodeQuantUni2(tgt, tgt, pred, step, lsbit));
}


x86 assembly (clang, -O0):
<BTAC1C2_EncodeQuantUni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
call   1030 <BTAC1C2_EncodeQuantUni2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTAC1C2_EncodeQuantUni>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
jmp    1030 <BTAC1C2_EncodeQuantUni2@plt>

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

LLVM IR (-O2):
define i32 @BTAC1C2_EncodeQuantUni(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @BTAC1C2_EncodeQuantUni2(i32 %0, i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
int __cxa_atexit(void (*destructor)(void *), void *objptr, void *dso) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @__cxa_atexit(void (i8*)* %0, i8* %1, i8* %2) {
%4 = alloca void (i8*)*
%5 = alloca i8*
%6 = alloca i8*
store void (i8*)* %0, void (i8*)** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @__cxa_atexit(void (i8*)* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ end();
int /*<<< orphan*/ end_module();
int /*<<< orphan*/ module(char *);
int /*<<< orphan*/ scale(float, float, float);
int /*<<< orphan*/ sphere(double);
void pod_module(char *modulename, float length, float r) {
  module(modulename);
  scale(r / 10.0, r / 10.0, length / 20.0);
  sphere(10.0);
  end();
  end_module();
}


x86 assembly (clang, -O0):
<pod_module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <module@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe67(%rip),%xmm2
divsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xe56(%rip),%xmm3
divsd  %xmm3,%xmm2
cvtsd2ss %xmm2,%xmm2
call   1050 <scale@plt>
movsd  0xe39(%rip),%xmm0
call   1070 <sphere@plt>
mov    $0x0,%al
call   1030 <end@plt>
mov    $0x0,%al
call   1040 <end_module@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pod_module>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1060 <module@plt>
movss  (%rsp),%xmm0
divss  0xe92(%rip),%xmm0
movss  0x4(%rsp),%xmm2
divss  0xe88(%rip),%xmm2
movaps %xmm0,%xmm1
call   1050 <scale@plt>
movsd  0xe7c(%rip),%xmm0
call   1070 <sphere@plt>
xor    %eax,%eax
call   1030 <end@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <end_module@plt>

LLVM IR (-O0):
define void @pod_module(i8* %0, float %1, float %2) {
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
store i8* %0, i8** %4
store float %1, float* %5
store float %2, float* %6
%7 = load i8*, i8** %4
%8 = call i32 @module(i8* %7)
%9 = load float, float* %6
%10 = fpext float %9 to double
%11 = fdiv double %10, 1.000000e+01
%12 = fptrunc double %11 to float
%13 = load float, float* %6
%14 = fpext float %13 to double
%15 = fdiv double %14, 1.000000e+01
%16 = fptrunc double %15 to float
%17 = load float, float* %5
%18 = fpext float %17 to double
%19 = fdiv double %18, 2.000000e+01
%20 = fptrunc double %19 to float
%21 = call i32 @scale(float %12, float %16, float %20)
%22 = call i32 @sphere(double 1.000000e+01)
%23 = call i32 (...) @end()
%24 = call i32 (...) @end_module()
ret void
}

LLVM IR (-O2):
define void @pod_module(i8* %0, float %1, float %2) {
%4 = tail call i32 @module(i8* %0)
%5 = fdiv float %2, 1.000000e+01
%6 = fdiv float %1, 2.000000e+01
%7 = tail call i32 @scale(float %5, float %5, float %6)
%8 = tail call i32 @sphere(double 1.000000e+01)
%9 = tail call i32 (...) @end()
%10 = tail call i32 (...) @end_module()
ret void
}
int foo() {
  return 1 / 0;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 poison
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(int, char *);
void drive_print_drive_status(int level, uint32_t status) {
  msg(0x100, "drive_print_drive_status called\n");
  exit(1);
}


x86 assembly (clang, -O0):
<drive_print_drive_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x100,%edi
lea    0xec6(%rip),%rsi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<drive_print_drive_status>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x100,%edi
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"drive_print_drive_status called\0A\00"
define void @drive_print_drive_status(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @msg(i32 256, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"drive_print_drive_status called\0A\00"
define void @drive_print_drive_status(i32 %0, i32 %1) {
%3 = tail call i32 @msg(i32 256, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
int is_valid_unquoted_key_char(const char c) {
  return (('0' <= c && c <= '9') || ('a' <= c && c <= 'z') ||
          ('A' <= c && c <= 'Z') || ('_' == c));
}


x86 assembly (clang, -O0):
<is_valid_unquoted_key_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     112d <is_valid_unquoted_key_char+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1184 <is_valid_unquoted_key_char+0x84>
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1150 <is_valid_unquoted_key_char+0x50>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1184 <is_valid_unquoted_key_char+0x84>
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1173 <is_valid_unquoted_key_char+0x73>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1184 <is_valid_unquoted_key_char+0x84>
movsbl -0x1(%rbp),%ecx
mov    $0x5f,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_unquoted_key_char>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x1a,%cl
setb   %cl
cmp    $0x5f,%dil
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_valid_unquoted_key_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = icmp eq i8 %0, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
unsigned char tokoi8(c)
unsigned char c;
{ return c; }


x86 assembly (clang, -O0):
<tokoi8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokoi8>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @tokoi8(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
int isblank(int ch) {
  if (ch == 0x09 || ch == 0x20)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
je     111b <isblank+0x1b>
cmpl   $0x20,-0x8(%rbp)
jne    1127 <isblank+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isblank+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 9
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 1, i32* %2
br label %11
10: ; preds = %6
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mbedtls_free_wrap(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<mbedtls_free_wrap>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mbedtls_free_wrap(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned int dummyRead(volatile unsigned int *addr) { return *addr; }


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

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

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

LLVM IR (-O2):
define i32 @dummyRead(i32* %0) {
%2 = load volatile i32, i32* %0
ret i32 %2
}
void ioctl_audio_stop() {}


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

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

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

LLVM IR (-O2):
define void @ioctl_audio_stop() {
ret void
}
void liberateMatrix(int **matrix) {
  free(*matrix);
  free(matrix);
}


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

x86 assembly (clang, -O2):
<liberateMatrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @liberateMatrix(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = bitcast i32* %4 to i8*
%6 = load i32**, i32*** %2
%7 = bitcast i32** %6 to i8*
ret void
}

LLVM IR (-O2):
define void @liberateMatrix(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i32** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISLNK(int /*<<< orphan*/);
int /*<<< orphan*/ assert(char const *);
scalar_t__ lstat(char const *, struct stat *);
int is_link(const char *fname) {
  assert(fname);
  struct stat s;
  if (lstat(fname, &s) == 0) {
    if (S_ISLNK(s.st_mode))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lstat@plt>
cmp    $0x0,%rax
jne    117f <is_link+0x4f>
mov    -0x18(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     117a <is_link+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1186 <is_link+0x56>
jmp    117f <is_link+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_link>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <assert@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <lstat@plt>
test   %rax,%rax
jne    1165 <is_link+0x35>
mov    0x8(%rsp),%edi
call   1030 <S_ISLNK@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1167 <is_link+0x37>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_link(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = call i64 @lstat(i8* %7, %struct.stat* %4)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i64 @S_ISLNK(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %2
br label %18
16: ; preds = %10
br label %17
17: ; preds = %16, %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_link(i8* %0) {
%2 = alloca %struct.stat
%3 = tail call i32 @assert(i8* %0)
%4 = bitcast %struct.stat* %2 to i8*
%5 = call i64 @lstat(i8* %0, %struct.stat* %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = tail call i64 @S_ISLNK(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7, %1
br label %13
13: ; preds = %7, %12
%14 = phi i32 [ 0, %12 ], [ 1, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_immdh_op();
int /*<<< orphan*/ arm_memio_ldrh(int /*<<< orphan*/);
void arm_ldrh_imm() { arm_memio_ldrh(arm_memio_immdh_op()); }


x86 assembly (clang, -O0):
<arm_ldrh_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_memio_immdh_op@plt>
mov    %eax,%edi
call   1040 <arm_memio_ldrh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldrh_imm>:
push   %rax
xor    %eax,%eax
call   1030 <arm_memio_immdh_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_memio_ldrh@plt>

LLVM IR (-O0):
define void @arm_ldrh_imm() {
%1 = call i32 (...) @arm_memio_immdh_op()
%2 = call i32 @arm_memio_ldrh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldrh_imm() {
%1 = tail call i32 (...) @arm_memio_immdh_op()
%2 = tail call i32 @arm_memio_ldrh(i32 %1)
ret void
}
/* Variables and functions */
char *string_from_format(char *, int);
char *string_itoa(int number) { return string_from_format("%d", number); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @string_itoa(i32 %0) {
%2 = tail call i8* @string_from_format(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ isalpha(int);
int isdebdistchar(int c) { return isalpha(c) || c == '-'; }


x86 assembly (clang, -O0):
<isdebdistchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <isdebdistchar+0x2f>
cmpl   $0x2d,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdebdistchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isdebdistchar(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 45
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
char *outc(p, c, maxl)
char *p;
char c;
long *maxl;
{
  if (*maxl < sizeof(char))
    fatal("out of space to store resource");
  *maxl = *maxl - sizeof(char);
  *p++ = c;
  return p;
}


x86 assembly (clang, -O0):
<outc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x1,(%rax)
jae    1142 <outc+0x32>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <fatal@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
sub    $0x1,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outc>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    (%rdx),%rax
test   %rax,%rax
jne    1137 <outc+0x27>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <fatal@plt>
mov    0x0(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,0x0(%rbp)
mov    %r14b,(%rbx)
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"out of space to store resource\00"
define i8* @outc(i8* %0, i32 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i64*
%7 = trunc i32 %1 to i8
store i8* %0, i8** %4
store i8 %7, i8* %5
store i64* %2, i64** %6
%8 = load i64*, i64** %6
%9 = load i64, i64* %8
%10 = icmp ult i64 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
%14 = load i64*, i64** %6
%15 = load i64, i64* %14
%16 = sub i64 %15, 1
%17 = load i64*, i64** %6
store i64 %16, i64* %17
%18 = load i8, i8* %5
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
store i8 %18, i8* %19
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
@.str = [31 x i8] c"out of space to store resource\00"
define i8* @outc(i8* writeonly %0, i32 %1, i64* nocapture %2) {
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = load i64, i64* %2
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %8, %6 ], [ %4, %3 ]
%11 = trunc i32 %1 to i8
%12 = add i64 %10, -1
store i64 %12, i64* %2
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %11, i8* %0
ret i8* %13
}
double f1(double x) { return x * x - 5; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double -5.000000e+00)
ret double %5
}

LLVM IR (-O2):
define double @f1(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -5.000000e+00)
ret double %2
}
/* Variables and functions */
char *malloc(int);
int sprintf(char *, char const *, char const *);
char *msg_app_string(const char *msg1, const char *msg2) {
  char *p = malloc(200);
  int b = sprintf(p, msg1, msg2);
  return p;
}


x86 assembly (clang, -O0):
<msg_app_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_app_string>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @msg_app_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i8* @malloc(i32 200)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @sprintf(i8* %8, i8* %9, i8* %10)
store i32 %11, i32* %6
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @msg_app_string(i8* nocapture %0, i8* %1) {
%3 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Realtime_IsLoggedIn();
int /*<<< orphan*/ Realtime_RandomUserRegister();
int /*<<< orphan*/ roadmap_login_ssd_on_signup_skip();
void roadmap_login_on_signup_skip(void) {
  if (!Realtime_IsLoggedIn()) {
    Realtime_RandomUserRegister();
  }
  roadmap_login_ssd_on_signup_skip();
}


x86 assembly (clang, -O0):
<roadmap_login_on_signup_skip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Realtime_IsLoggedIn@plt>
cmp    $0x0,%eax
jne    114b <roadmap_login_on_signup_skip+0x1b>
mov    $0x0,%al
call   1040 <Realtime_RandomUserRegister@plt>
mov    $0x0,%al
call   1050 <roadmap_login_ssd_on_signup_skip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_login_on_signup_skip>:
push   %rax
xor    %eax,%eax
call   1030 <Realtime_IsLoggedIn@plt>
test   %eax,%eax
jne    1143 <roadmap_login_on_signup_skip+0x13>
xor    %eax,%eax
call   1040 <Realtime_RandomUserRegister@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <roadmap_login_ssd_on_signup_skip@plt>

LLVM IR (-O0):
define void @roadmap_login_on_signup_skip() {
%1 = call i32 (...) @Realtime_IsLoggedIn()
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = call i32 (...) @Realtime_RandomUserRegister()
br label %5
5: ; preds = %3, %0
%6 = call i32 (...) @roadmap_login_ssd_on_signup_skip()
ret void
}

LLVM IR (-O2):
define void @roadmap_login_on_signup_skip() {
%1 = tail call i32 (...) @Realtime_IsLoggedIn()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @Realtime_RandomUserRegister()
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @roadmap_login_ssd_on_signup_skip()
ret void
}
int _write(int file, char *buffer, unsigned int count) {
  register int i;
  for (i = 0; i < count; ++i) {
  }
  return count;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1134 <_write+0x34>
jmp    1126 <_write+0x26>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <_write+0x15>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 returned %2) {
ret i32 %2
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  printf("%d", factorial(number));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <factorial@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @factorial(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int clear_bits_uint64(int, int, int);
uint64_t set_bits_uint64(uint64_t data, int bit0, int bit1, uint64_t val) {
  uint64_t d = clear_bits_uint64(data, bit0, bit1);
  d |= val << bit0;
  return d;
}


x86 assembly (clang, -O0):
<set_bits_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <clear_bits_uint64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bits_uint64>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
call   1030 <clear_bits_uint64@plt>
mov    %ebp,%ecx
shl    %cl,%ebx
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @set_bits_uint64(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i32 @clear_bits_uint64(i32 %10, i32 %11, i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = shl i32 %14, %15
%17 = load i32, i32* %9
%18 = or i32 %17, %16
store i32 %18, i32* %9
%19 = load i32, i32* %9
ret i32 %19
}

LLVM IR (-O2):
define i32 @set_bits_uint64(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @clear_bits_uint64(i32 %0, i32 %1, i32 %2)
%6 = shl i32 %3, %1
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = 12;
  int ones = 255;
  int res = (num ^ ones) + 1;
  printf("%d\n", res);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 244)
ret i32 0
}
int has_transparent_hugepage(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @has_transparent_hugepage() {
ret i32 1
}

LLVM IR (-O2):
define i32 @has_transparent_hugepage() {
ret i32 1
}
int Init(unsigned long adr, unsigned long clk, unsigned long fnc) {
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @Init(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @Init(i64 %0, i64 %1, i64 %2) {
ret i32 0
}
int greatestBitPos(int x) {
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return ((~x >> 1) | (1 << 31)) & x;
}


x86 assembly (clang, -O0):
<greatestBitPos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
sar    $0x1,%eax
or     $0x80000000,%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<greatestBitPos>:
mov    %edi,%eax
sar    %eax
or     %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x10,%edx
or     %ecx,%edx
mov    %edx,%eax
shr    %eax
not    %eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @greatestBitPos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = xor i32 %23, -1
%25 = ashr i32 %24, 1
%26 = or i32 %25, -2147483648
%27 = load i32, i32* %2
%28 = and i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @greatestBitPos(i32 %0) {
%2 = ashr i32 %0, 1
%3 = or i32 %2, %0
%4 = ashr i32 %3, 2
%5 = or i32 %4, %3
%6 = ashr i32 %5, 4
%7 = or i32 %6, %5
%8 = ashr i32 %7, 8
%9 = or i32 %8, %7
%10 = ashr i32 %9, 16
%11 = or i32 %10, %9
%12 = lshr i32 %11, 1
%13 = xor i32 %12, -1
%14 = and i32 %11, %13
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ u32_to_le(int /*<<< orphan*/, int /*<<< orphan*/ *);
void i32_to_le(int32_t val, uint8_t *buf) { u32_to_le(val, buf); }


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

x86 assembly (clang, -O2):
<i32_to_le>:
jmp    1030 <u32_to_le@plt>

LLVM IR (-O0):
define void @i32_to_le(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 @u32_to_le(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @i32_to_le(i32 %0, i32* %1) {
%3 = tail call i32 @u32_to_le(i32 %0, i32* %1)
ret void
}
ClientData(c, buf, n) int c, n;
char *buf;
{
  int i;
  for (i = 0; i < n; i++)
    ClientByte(c, buf[i]);
}


x86 assembly (clang, -O0):
<ClientData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <ClientData+0x49>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
mov    $0x0,%al
call   1030 <ClientByte@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <ClientData+0x19>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClientData>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1148 <ClientData+0x38>
mov    %rsi,%r14
mov    %edi,%r15d
mov    %edx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%r14,%rbp,1),%esi
mov    %r15d,%edi
xor    %eax,%eax
call   1030 <ClientByte@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <ClientData+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ClientData(i32 %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ClientByte to i32 (i32, i32, ...)*)(i32 %0, i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret i32 undef
}
int test4(int d) { return ((d ^ 4) & 4) != 0; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x4,%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
xor    %eax,%eax
test   $0x4,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 4
%5 = and i32 %4, 4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
void sighand(int i) {}


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

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

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

LLVM IR (-O2):
define void @sighand(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ const *get_transport4(int /*<<< orphan*/ const *,
                                         scalar_t__);
const uint8_t *get_inner4(const uint8_t *b, uint32_t blen) {
  return get_transport4(b + 8, blen - 8);
}


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

x86 assembly (clang, -O2):
<get_inner4>:
add    $0x20,%rdi
add    $0xfffffffffffffff8,%rsi
jmp    1030 <get_transport4@plt>

LLVM IR (-O0):
define i32* @get_inner4(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 8
%7 = load i64, i64* %4
%8 = sub nsw i64 %7, 8
%9 = call i32* @get_transport4(i32* %6, i64 %8)
ret i32* %9
}

LLVM IR (-O2):
define i32* @get_inner4(i32* %0, i64 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 8
%4 = add nsw i64 %1, -8
%5 = tail call i32* @get_transport4(i32* %3, i64 %4)
ret i32* %5
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rot16r5(uint16_t x) { return (x >> 5) | (x << 11); }


x86 assembly (clang, -O0):
<rot16r5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
mov    -0x4(%rbp),%ecx
shl    $0xb,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16r5>:
mov    %edi,%eax
sar    $0x5,%eax
shl    $0xb,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot16r5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 5
%5 = load i32, i32* %2
%6 = shl i32 %5, 11
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot16r5(i32 %0) {
%2 = ashr i32 %0, 5
%3 = shl i32 %0, 11
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  if (L"a"
      "b"[1] != L'b')
    abort();
  exit(0);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ die(char *);
void *ecalloc(size_t nmemb, size_t size) {
  void *p;
  if (!(p = calloc(nmemb, size)))
    die("calloc:");
  return p;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1157 <ecalloc+0x37>
lea    0xeae(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <ecalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"calloc:\00"
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @die(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"calloc:\00"
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void swap(int *p, int *q) {
  *p += *q;
  *q = *p - *q;
  *p -= *q;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%eax
add    (%rsi),%eax
mov    %eax,(%rdi)
sub    (%rsi),%eax
mov    %eax,(%rsi)
sub    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swap(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* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
store i32 %9, i32* %7
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = sub nsw i32 %11, %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = load i32*, i32** %3
%19 = load i32, i32* %18
%20 = sub nsw i32 %19, %17
store i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = add nsw i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = sub nsw i32 %5, %6
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %0
ret void
}
void intel_dsm_get_bios_data_funcs_supported(struct drm_i915_private *i915) {
  return;
}


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

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

LLVM IR (-O0):
%struct.drm_i915_private = type opaque
define void @intel_dsm_get_bios_data_funcs_supported(%struct.drm_i915_private* %0) {
%2 = alloca %struct.drm_i915_private*
store %struct.drm_i915_private* %0, %struct.drm_i915_private** %2
ret void
}

LLVM IR (-O2):
%struct.drm_i915_private = type opaque
define void @intel_dsm_get_bios_data_funcs_supported(%struct.drm_i915_private* nocapture %0) {
ret void
}