xunge/DecIR huggingface dataset:
/* Variables and functions */
int connectToIP(char const *);
char *grabDataWithURL(int, char *, char const *, int /*<<< orphan*/ *);
char *check_for_motion(const char *ip) {
  int sockfd = connectToIP(ip);
  if (sockfd >= 0) {
    return grabDataWithURL(sockfd, "/get?mdresult", ip, NULL);
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<check_for_motion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <connectToIP@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1162 <check_for_motion+0x42>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb0(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <grabDataWithURL@plt>
mov    %rax,-0x8(%rbp)
jmp    116a <check_for_motion+0x4a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_motion>:
push   %rbx
mov    %rdi,%rbx
call   1030 <connectToIP@plt>
test   %eax,%eax
js     1141 <check_for_motion+0x21>
lea    0xecc(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
xor    %ecx,%ecx
pop    %rbx
jmp    1040 <grabDataWithURL@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/get?mdresult\00"
define i8* @check_for_motion(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @connectToIP(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = load i8*, i8** %3
%12 = call i8* @grabDataWithURL(i32 %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %11, i32* null)
store i8* %12, i8** %2
br label %14
13: ; preds = %1
store i8* null, i8** %2
br label %14
14: ; preds = %13, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [14 x i8] c"/get?mdresult\00"
define i8* @check_for_motion(i8* %0) {
%2 = tail call i32 @connectToIP(i8* %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @grabDataWithURL(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
void plugin_exit_smartwatch(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_smartwatch() {
ret void
}
int DefMock_timerfd_settime(int fd, int flags,
                            const struct itimerspec *new_value,
                            struct itimerspec *old_value) {
  return 0;
}


x86 assembly (clang, -O0):
<DefMock_timerfd_settime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.itimerspec = type opaque
define i32 @DefMock_timerfd_settime(i32 %0, i32 %1, %struct.itimerspec* %2, %struct.itimerspec* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.itimerspec*
%8 = alloca %struct.itimerspec*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.itimerspec* %2, %struct.itimerspec** %7
store %struct.itimerspec* %3, %struct.itimerspec** %8
ret i32 0
}

LLVM IR (-O2):
%struct.itimerspec = type opaque
define i32 @DefMock_timerfd_settime(i32 %0, i32 %1, %struct.itimerspec* nocapture readnone %2, %struct.itimerspec* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *skipspace(const char *in) {
  for (; isspace(*in); in++)
    ;
  return (char *)in;
}


x86 assembly (clang, -O0):
<skipspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <skipspace+0x38>
jmp    1137 <skipspace+0x27>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skipspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipspace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
int test_imm_0Auint16_mem(unsigned short *val) {
  return ((*val) & (0x0A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Auint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 10
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
const char *player_get_build_time_info(void) { return " Unknow "; }


x86 assembly (clang, -O0):
<player_get_build_time_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<player_get_build_time_info>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c" Unknow \00"
define i8* @player_get_build_time_info() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c" Unknow \00"
define i8* @player_get_build_time_info() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned long long strtoul(char const *, char **, int);
unsigned long long strtoull(const char *nptr, char **endptr, int base) {
  return strtoul(nptr, endptr, base);
}


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

x86 assembly (clang, -O2):
<strtoull>:
jmp    1030 <strtoul@plt>

LLVM IR (-O0):
define i64 @strtoull(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** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i64 @strtoul(i8* %7, i8** %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtoull(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ addFoncT(char *, void (*)(), int, short);
void addFonE(char *l, void (*f)(void), short F) { addFoncT(l, f, 2, F); }


x86 assembly (clang, -O0):
<addFonE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
movswl -0x12(%rbp),%ecx
call   1030 <addFoncT@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addFonE>:
mov    %edx,%ecx
mov    $0x2,%edx
jmp    1030 <addFoncT@plt>

LLVM IR (-O0):
define void @addFonE(i8* %0, void ()* %1, i16 signext %2) {
%4 = alloca i8*
%5 = alloca void ()*
%6 = alloca i16
store i8* %0, i8** %4
store void ()* %1, void ()** %5
store i16 %2, i16* %6
%7 = load i8*, i8** %4
%8 = load void ()*, void ()** %5
%9 = bitcast void ()* %8 to void (...)*
%10 = load i16, i16* %6
%11 = call i32 @addFoncT(i8* %7, void (...)* %9, i32 2, i16 signext %10)
ret void
}

LLVM IR (-O2):
define void @addFonE(i8* %0, void ()* %1, i16 signext %2) {
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @addFoncT(i8* %0, void (...)* %4, i32 2, i16 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ICPrintPapa() { printf("papa"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"papa\00"
define void @ICPrintPapa() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Credit(int, unsigned char, int);
int _readData(int, unsigned char *, int);
int /*<<< orphan*/ usleep(int);
readData(int fd, unsigned char socketID, unsigned char *buf, int len) {
  int ret;
  if (Credit(fd, socketID, 1) == 1) {
    usleep(1000);
    ret = _readData(fd, buf, len);
    return ret;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<readData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%edx
movzbl -0x9(%rbp),%esi
call   1040 <Credit@plt>
cmp    $0x1,%eax
jne    1189 <readData+0x59>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <_readData@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <readData+0x60>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readData>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %edi,%ebp
mov    $0x1,%edx
call   1040 <Credit@plt>
cmp    $0x1,%eax
jne    1166 <readData+0x36>
mov    $0x3e8,%edi
call   1050 <usleep@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_readData@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readData(i32 %0, i8 zeroext %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8 %1, i8* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%11 = load i32, i32* %6
%12 = load i8, i8* %7
%13 = call i32 @Credit(i32 %11, i8 zeroext %12, i32 1)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %22
15: ; preds = %4
%16 = call i32 @usleep(i32 1000)
%17 = load i32, i32* %6
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = call i32 @_readData(i32 %17, i8* %18, i32 %19)
store i32 %20, i32* %10
%21 = load i32, i32* %10
store i32 %21, i32* %5
br label %23
22: ; preds = %4
store i32 -1, i32* %5
br label %23
23: ; preds = %22, %15
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @readData(i32 %0, i8 zeroext %1, i8* %2, i32 %3) {
%5 = tail call i32 @Credit(i32 %0, i8 zeroext %1, i32 1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @usleep(i32 1000)
%9 = tail call i32 @_readData(i32 %0, i8* %2, i32 %3)
br label %10
10: ; preds = %4, %7
%11 = phi i32 [ %9, %7 ], [ -1, %4 ]
ret i32 %11
}
int f(int i, unsigned j) {
  int b[2];
  if (&b[i] == &b[j])
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rcx
lea    -0x14(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
lea    -0x14(%rbp),%rcx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jne    113e <f+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <f+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rcx
mov    %esi,%edx
xor    %eax,%eax
cmp    %rdx,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %8
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %11
%13 = icmp eq i32* %9, %12
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = zext i32 %1 to i64
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ check_params(int, char **);
int /*<<< orphan*/ sp_init();
int /*<<< orphan*/ sp_init_vga();
int /*<<< orphan*/ spcf_pre_check_options(int, char **);
int /*<<< orphan*/ spma_init_privileged();
int /*<<< orphan*/ start_spectemu();
int main(int argc, char *argv[]) {
  spma_init_privileged();
  sp_init_vga();
  spcf_pre_check_options(argc, argv);
  check_params(argc, argv);
  sp_init();
  start_spectemu();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <spma_init_privileged@plt>
mov    $0x0,%al
call   1030 <sp_init_vga@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <spcf_pre_check_options@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <check_params@plt>
mov    $0x0,%al
call   1040 <sp_init@plt>
mov    $0x0,%al
call   1080 <start_spectemu@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <spma_init_privileged@plt>
xor    %eax,%eax
call   1030 <sp_init_vga@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <spcf_pre_check_options@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <check_params@plt>
xor    %eax,%eax
call   1040 <sp_init@plt>
xor    %eax,%eax
call   1080 <start_spectemu@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @spma_init_privileged()
%7 = call i32 (...) @sp_init_vga()
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @spcf_pre_check_options(i32 %8, i8** %9)
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @check_params(i32 %11, i8** %12)
%14 = call i32 (...) @sp_init()
%15 = call i32 (...) @start_spectemu()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @spma_init_privileged()
%4 = tail call i32 (...) @sp_init_vga()
%5 = tail call i32 @spcf_pre_check_options(i32 %0, i8** %1)
%6 = tail call i32 @check_params(i32 %0, i8** %1)
%7 = tail call i32 (...) @sp_init()
%8 = tail call i32 (...) @start_spectemu()
ret i32 0
}
/* Variables and functions */
int fun2(int, int);
int fun1(int c, int d) {
  if (c > d) {
    return fun2(c - 1, d + 1);
  } else {
    return d - c;
  }
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1143 <fun1+0x33>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <fun2@plt>
mov    %eax,-0x4(%rbp)
jmp    114c <fun1+0x3c>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
mov    %esi,%eax
sub    %edi,%eax
jge    1121 <fun1+0x11>
add    $0xffffffff,%edi
add    $0x1,%esi
jmp    1030 <fun2@plt>
ret

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

LLVM IR (-O2):
define i32 @fun1(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = add nsw i32 %1, 1
%7 = tail call i32 @fun2(i32 %5, i32 %6)
br label %10
8: ; preds = %2
%9 = sub nsw i32 %1, %0
br label %10
10: ; preds = %8, %4
%11 = phi i32 [ %7, %4 ], [ %9, %8 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t evpd_page_len(uint8_t *data) { return (data[2] << 8) | data[3]; }


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

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

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

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


x86 assembly (clang, -O0):
<sub1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
sub    -0x4(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub1>:
lea    (%rdi,%rdi,1),%eax
add    $0xfffffffb,%eax
ret

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

LLVM IR (-O2):
define i32 @sub1(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, -5
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t pdu_phone_digits_bytes(uint8_t digits) {
  return (digits + (digits & 1)) >> 1;
}


x86 assembly (clang, -O0):
<pdu_phone_digits_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_phone_digits_bytes>:
mov    %edi,%eax
and    $0x1,%eax
add    %edi,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @pdu_phone_digits_bytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = add nsw i32 %3, %5
%7 = ashr i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @pdu_phone_digits_bytes(i32 %0) {
%2 = and i32 %0, 1
%3 = add nsw i32 %2, %0
%4 = ashr i32 %3, 1
ret i32 %4
}
int nl(char c) { return c == '\n'; }


x86 assembly (clang, -O0):
<nl>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl>:
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @nl(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @nl(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
void do_put() { return; }


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

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

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

LLVM IR (-O2):
define void @do_put() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t get_u32le(unsigned char *p) {
  return (uint32_t)p[0] | ((uint32_t)p[1] << 8) | ((uint32_t)p[2] << 16) |
         ((uint32_t)p[3]) << 24;
}


x86 assembly (clang, -O0):
<get_u32le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_u32le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @get_u32le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
double seconds_() {
  struct timeval tp;
  struct timezone tzp;
  int i;
  i = gettimeofday(&tp, &tzp);
  return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<seconds_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    %eax,-0x1c(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds_>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @seconds_() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @seconds_() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
ret double %12
}
/* Variables and functions */
char *strrchr(char *, int);
char *str_split_at_right(char *string, int delimiter) {
  char *cp;
  if ((cp = strrchr(string, delimiter)) != NULL)
    *cp++ = 0;
  return (cp);
}


x86 assembly (clang, -O0):
<str_split_at_right>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114b <str_split_at_right+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_split_at_right>:
push   %rax
call   1030 <strrchr@plt>
test   %rax,%rax
je     1127 <str_split_at_right+0x17>
mov    %rax,%rcx
add    $0x1,%rax
movb   $0x0,(%rcx)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @str_split_at_right(i8* %0, i32 %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
br label %7
7: ; preds = %5, %2
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
/* Type definitions */
struct Graph {
  int dummy;
};

/* Variables and functions */
struct Graph *construct_graph();
int /*<<< orphan*/ fill_adjacency_list(struct Graph *, int);
struct Graph *generate_graph_type_2() {
  struct Graph *graph = construct_graph();
  fill_adjacency_list(graph, 1000);
  return graph;
}


x86 assembly (clang, -O0):
<generate_graph_type_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <construct_graph@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <fill_adjacency_list@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_graph_type_2>:
push   %rbx
xor    %eax,%eax
call   1040 <construct_graph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3e8,%esi
call   1030 <fill_adjacency_list@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
define %struct.Graph* @generate_graph_type_2() {
%1 = alloca %struct.Graph*
%2 = call %struct.Graph* (...) @construct_graph()
store %struct.Graph* %2, %struct.Graph** %1
%3 = load %struct.Graph*, %struct.Graph** %1
%4 = call i32 @fill_adjacency_list(%struct.Graph* %3, i32 1000)
%5 = load %struct.Graph*, %struct.Graph** %1
ret %struct.Graph* %5
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define %struct.Graph* @generate_graph_type_2() {
%1 = tail call %struct.Graph* (...) @construct_graph()
%2 = tail call i32 @fill_adjacency_list(%struct.Graph* %1, i32 1000)
ret %struct.Graph* %1
}
float htol_float(float hostval) { return hostval; }


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

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

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

LLVM IR (-O2):
define float @htol_float(float returned %0) {
ret float %0
}
int adis16300_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @adis16300_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
void mfm_validateclock(const unsigned char clock, const unsigned char data) {
  (void)clock;
  (void)data;
}


x86 assembly (clang, -O0):
<mfm_validateclock>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mfm_validateclock(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @mfm_validateclock(i8 zeroext %0, i8 zeroext %1) {
ret void
}
OP(dd, f2) { op_f2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_f2()
ret i32 undef
}
void XtGetActionKeysym() {}


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

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

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

LLVM IR (-O2):
define void @XtGetActionKeysym() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_string(char *);
void html_end_link(void) { write_string("</A>"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"</A>\00"
define void @html_end_link() {
%1 = call i32 @write_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"</A>\00"
define void @html_end_link() {
%1 = tail call i32 @write_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void foo(const char *str) { bar(); }


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

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

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @bar()
ret void
}
__attribute__((always_)) void debug_dma_unmap_sg(struct device *dev,
                                                 struct scatterlist *sglist,
                                                 int nelems, int dir) {}


x86 assembly (clang, -O0):
<debug_dma_unmap_sg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_unmap_sg(%struct.device* %0, %struct.scatterlist* %1, i32 %2, i32 %3) {
%5 = alloca %struct.device*
%6 = alloca %struct.scatterlist*
%7 = alloca i32
%8 = alloca i32
store %struct.device* %0, %struct.device** %5
store %struct.scatterlist* %1, %struct.scatterlist** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.scatterlist = type opaque
define void @debug_dma_unmap_sg(%struct.device* nocapture %0, %struct.scatterlist* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, scalar_t__ *, int);
bool is_sysfield_timer_expired(int sys_timer_fd) {
  uint64_t time_read = 0;
  read(sys_timer_fd, &time_read, sizeof(uint64_t));
  return time_read > 0 ? true : false;
}


x86 assembly (clang, -O0):
<is_sysfield_timer_expired>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <read@plt>
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sysfield_timer_expired>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <read@plt>
xor    %eax,%eax
cmpq   $0x0,(%rsp)
setg   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_sysfield_timer_expired(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
%4 = load i32, i32* %2
%5 = call i32 @read(i32 %4, i64* %3, i32 8)
%6 = load i64, i64* %3
%7 = icmp sgt i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_sysfield_timer_expired(i32 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = call i32 @read(i32 %0, i64* %2, i32 8)
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void foo(int param) {}


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

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ openlog(char const *, int /*<<< orphan*/, int);
void daemon_inetd(const char *pname, int facility) {
  openlog(pname, LOG_PID, facility);
}


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

x86 assembly (clang, -O2):
<daemon_inetd>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%esi
jmp    1030 <openlog@plt>

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

LLVM IR (-O2):
@LOG_PID = global i32 0
define void @daemon_inetd(i8* %0, i32 %1) {
%3 = load i32, i32* @LOG_PID
%4 = tail call i32 @openlog(i8* %0, i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ root_test_function();
int main() {
  root_test_function();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <root_test_function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @root_test_function()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rand_exp(float, float *);
int rand_exp_int(float mean) {
  float r;
  rand_exp(mean, &r);
  return (int)r + 1;
}


x86 assembly (clang, -O0):
<rand_exp_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <rand_exp@plt>
cvttss2si -0x8(%rbp),%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_exp_int>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <rand_exp@plt>
cvttss2si 0x4(%rsp),%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_exp_int(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 @rand_exp(float %4, float* %3)
%6 = load float, float* %3
%7 = fptosi float %6 to i32
%8 = add nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @rand_exp_int(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @rand_exp(float %0, float* %2)
%5 = load float, float* %2
%6 = fptosi float %5 to i32
%7 = add nsw i32 %6, 1
ret i32 %7
}
/* Variables and functions */
double scale_h1(double, double, double);
double scale_h3(double, double, double);
double scale_Sxz(double x, double y, double z, double dx, double dy,
                 double dz) {
  return scale_h1(x, y, z) * scale_h3(x, y, z) * dx * dz;
}


x86 assembly (clang, -O0):
<scale_Sxz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <scale_h1@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <scale_h3@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_Sxz>:
sub    $0x38,%rsp
movsd  %xmm5,0x30(%rsp)
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <scale_h1@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1040 <scale_h3@plt>
mulsd  0x20(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @scale_Sxz(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = call double @scale_h1(double %13, double %14, double %15)
%17 = load double, double* %7
%18 = load double, double* %8
%19 = load double, double* %9
%20 = call double @scale_h3(double %17, double %18, double %19)
%21 = fmul double %16, %20
%22 = load double, double* %10
%23 = fmul double %21, %22
%24 = load double, double* %12
%25 = fmul double %23, %24
ret double %25
}

LLVM IR (-O2):
define double @scale_Sxz(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @scale_h1(double %0, double %1, double %2)
%8 = tail call double @scale_h3(double %0, double %1, double %2)
%9 = fmul double %7, %8
%10 = fmul double %9, %3
%11 = fmul double %10, %5
ret double %11
}
int test_imm_22int16_reg(short val) {
  return ((val) & (-0x22 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_22int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -34
%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_22int16_reg(i16 signext %0) {
%2 = and i16 %0, -34
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t pixel_g(uint32_t pixel) { return (pixel >> 8) & 0xff; }


x86 assembly (clang, -O0):
<pixel_g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pixel_g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @pixel_g(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
int test_imm_A4uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xA4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A4uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10747904
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void nseel_asm_notequal_exact_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_notequal_exact_end() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xkey;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xkey_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xkey.send_event = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xkey_send_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xkey_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xkey_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xkey_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
char opttype(char *str) {
  if (*str != '-')
    return -1;
  str++;
  return *str;
}


x86 assembly (clang, -O0):
<opttype>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1121 <opttype+0x21>
movb   $0xff,-0x1(%rbp)
jmp    1136 <opttype+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opttype>:
mov    $0xff,%al
cmpb   $0x2d,(%rdi)
jne    110a <opttype+0xa>
mov    0x1(%rdi),%al
ret

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

LLVM IR (-O2):
define signext i8 @opttype(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %4
%8 = phi i8 [ %6, %4 ], [ -1, %1 ]
ret i8 %8
}
int sa_dst_compare() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sa_dst_compare() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AudioEvent_RestartEventBuffer(int /*<<< orphan*/);
int /*<<< orphan*/ CPC_GetNopCount();
int /*<<< orphan*/ Digiblaster_Reset();
void Audio_Reset(void) {
  AudioEvent_RestartEventBuffer(CPC_GetNopCount());
  Digiblaster_Reset();
}


x86 assembly (clang, -O0):
<Audio_Reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CPC_GetNopCount@plt>
mov    %eax,%edi
call   1050 <AudioEvent_RestartEventBuffer@plt>
mov    $0x0,%al
call   1040 <Digiblaster_Reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Audio_Reset>:
push   %rax
xor    %eax,%eax
call   1030 <CPC_GetNopCount@plt>
mov    %eax,%edi
call   1050 <AudioEvent_RestartEventBuffer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Digiblaster_Reset@plt>

LLVM IR (-O0):
define void @Audio_Reset() {
%1 = call i32 (...) @CPC_GetNopCount()
%2 = call i32 @AudioEvent_RestartEventBuffer(i32 %1)
%3 = call i32 (...) @Digiblaster_Reset()
ret void
}

LLVM IR (-O2):
define void @Audio_Reset() {
%1 = tail call i32 (...) @CPC_GetNopCount()
%2 = tail call i32 @AudioEvent_RestartEventBuffer(i32 %1)
%3 = tail call i32 (...) @Digiblaster_Reset()
ret void
}