xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ XCB_ATOM_STRING;
int /*<<< orphan*/ XCB_ATOM_WM_CLASS;
int /*<<< orphan*/ xcb_get_property(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, long, long);
xcb_get_property_cookie_t xcb_icccm_get_wm_class(xcb_connection_t *c,
                                                 xcb_window_t window) {
  return xcb_get_property(c, 0, window, XCB_ATOM_WM_CLASS, XCB_ATOM_STRING, 0L,
                          2048L);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_class>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    (%rax),%r8d
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r9d
movq   $0x800,(%rsp)
call   1030 <xcb_get_property@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_class>:
push   %rax
mov    %esi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecd(%rip),%rax
mov    (%rax),%r8d
movq   $0x800,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_WM_CLASS = global i32 0
@XCB_ATOM_STRING = global i32 0
define i32 @xcb_icccm_get_wm_class(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 = load i32, i32* @XCB_ATOM_WM_CLASS
%8 = load i32, i32* @XCB_ATOM_STRING
%9 = call i32 @xcb_get_property(i32* %5, i32 0, i32 %6, i32 %7, i32 %8, i64 0, i64 2048)
ret i32 %9
}

LLVM IR (-O2):
@XCB_ATOM_WM_CLASS = global i32 0
@XCB_ATOM_STRING = global i32 0
define i32 @xcb_icccm_get_wm_class(i32* %0, i32 %1) {
%3 = load i32, i32* @XCB_ATOM_WM_CLASS
%4 = load i32, i32* @XCB_ATOM_STRING
%5 = tail call i32 @xcb_get_property(i32* %0, i32 0, i32 %1, i32 %3, i32 %4, i64 0, i64 2048)
ret i32 %5
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strftime(char *, unsigned long, char *, struct tm *);
void timeh(char *s, long unsigned int sz, struct tm *tm) {
  strftime(s, sz, "", tm);
}


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

x86 assembly (clang, -O2):
<timeh>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @timeh(i8* %0, i64 %1, %struct.tm* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.tm*
store i8* %0, i8** %4
store i64 %1, i64* %5
store %struct.tm* %2, %struct.tm** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load %struct.tm*, %struct.tm** %6
%10 = call i32 @strftime(i8* %7, i64 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @timeh(i8* %0, i64 %1, %struct.tm* %2) {
%4 = tail call i32 @strftime(i8* %0, i64 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_dmd_comments() {
  test_parser_verify_parse(test_parser_sourcefile("dmd", " //comment"), "dmd",
                           "", "//comment", 0);
}


x86 assembly (clang, -O0):
<test_dmd_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebc(%rip),%rdx
lea    0xeb7(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dmd_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec5(%rip),%rdx
lea    0xec0(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dmd\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_dmd_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dmd\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_dmd_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello CAB202.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello CAB202.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello CAB202.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
uint64_t dbl(const uint32_t in, int32_t e) {
  e = (((e >> 1) & 1) - ((int32_t)(e & 1)));
  return (uint64_t)((((uint64_t)in) << (uint64_t)1) - e);
}


x86 assembly (clang, -O0):
<dbl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
and    $0x1,%eax
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl>:
mov    %esi,%ecx
shr    %ecx
and    $0x1,%ecx
and    $0x1,%esi
lea    (%rsi,%rdi,2),%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dbl(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 1
%7 = and i32 %6, 1
%8 = load i32, i32* %4
%9 = and i32 %8, 1
%10 = sub nsw i32 %7, %9
store i32 %10, i32* %4
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 1
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @dbl(i64 %0, i32 %1) {
%3 = lshr i32 %1, 1
%4 = and i32 %3, 1
%5 = and i32 %1, 1
%6 = trunc i64 %0 to i32
%7 = shl i32 %6, 1
%8 = or i32 %7, %5
%9 = sub i32 %8, %4
ret i32 %9
}
/* Type definitions */
struct sched_param {
  int sched_priority;
};
typedef int /*<<< orphan*/ sp;

/* Variables and functions */
int /*<<< orphan*/ SCHED_RR;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                                      struct sched_param *);
void set_priority(int priority) {
  struct sched_param sp;
  memset(&sp, 0, sizeof(sp));
  sp.sched_priority = priority;
  sched_setscheduler(0, SCHED_RR, &sp);
  return;
}


x86 assembly (clang, -O0):
<set_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_priority>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %ebx,(%rsp)
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %r14,%rdx
call   1030 <sched_setscheduler@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_RR = global i32 0
define void @set_priority(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sched_param
store i32 %0, i32* %2
%4 = call i32 @memset(%struct.sched_param* %3, i32 0, i32 4)
%5 = load i32, i32* %2
%6 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* @SCHED_RR
%8 = call i32 @sched_setscheduler(i32 0, i32 %7, %struct.sched_param* %3)
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_RR = global i32 0
define void @set_priority(i32 %0) {
%2 = alloca %struct.sched_param
%3 = bitcast %struct.sched_param* %2 to i8*
%4 = call i32 @memset(%struct.sched_param* %2, i32 0, i32 4)
%5 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %2, i64 0, i32 0
store i32 %0, i32* %5
%6 = load i32, i32* @SCHED_RR
%7 = call i32 @sched_setscheduler(i32 0, i32 %6, %struct.sched_param* %2)
ret void
}
int cmp(const void *n1, const void *n2) {
  int r1 = *(const int *)n1;
  int r2 = *(const int *)n2;
  return r1 - r2;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void terminate() { exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @terminate() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @terminate() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @exit(i32 %1)
unreachable
}
int regd_open(struct inode *inode, struct file *file) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @regd_open(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void error(char *msg) { printf("Error: %s\n", msg); }


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

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int twin_prime(int a, int b) {
  if (b - a == 2) {
    printf("%d-%d\n", a, b);
  }
}


x86 assembly (clang, -O0):
<twin_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x2,%eax
jne    113f <twin_prime+0x2f>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twin_prime>:
mov    %esi,%edx
mov    %esi,%eax
sub    %edi,%eax
cmp    $0x2,%eax
jne    112e <twin_prime+0x1e>
push   %rax
mov    %edi,%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d-%d\0A\00"
define i32 @twin_prime(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* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d-%d\0A\00"
define i32 @twin_prime(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int web_client_api_request_v1_data_group(char *name) {
  if (!strcmp(name, "max"))
    return 1;
  else if (!strcmp(name, "average"))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<web_client_api_request_v1_data_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <web_client_api_request_v1_data_group+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1172 <web_client_api_request_v1_data_group+0x62>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1166 <web_client_api_request_v1_data_group+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1172 <web_client_api_request_v1_data_group+0x62>
jmp    116b <web_client_api_request_v1_data_group+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<web_client_api_request_v1_data_group>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     113e <web_client_api_request_v1_data_group+0x2e>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"max\00"
@.str.1 = [8 x i8] c"average\00"
define i32 @web_client_api_request_v1_data_group(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ one();
void *two(void) {
  if (malloc(1002) == NULL) {
    exit(-1);
  }
  free(one());
  return malloc(2002);
}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ea,%edi
call   1040 <malloc@plt>
cmp    $0x0,%rax
jne    1162 <two+0x22>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1050 <one@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    $0x7d2,%edi
call   1040 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<two>:
push   %rax
xor    %eax,%eax
call   1050 <one@plt>
mov    %eax,%edi
call   1030 <free@plt>
mov    $0x7d2,%edi
pop    %rax
jmp    1040 <malloc@plt>

LLVM IR (-O0):
define i8* @two() {
%1 = call i8* @malloc(i32 1002)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 -1)
unreachable
5: ; preds = %0
%6 = call i32 (...) @one()
%7 = call i32 @free(i32 %6)
%8 = call i8* @malloc(i32 2002)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @two() {
%1 = tail call i32 (...) @one()
%2 = tail call i32 @free(i32 %1)
%3 = tail call dereferenceable_or_null(2002) i8* @malloc(i32 2002)
ret i8* %3
}
/* Variables and functions */
int rand();
int generateRandom(int min, int max) { return rand() % (max - min + 1) + min; }


x86 assembly (clang, -O0):
<generateRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateRandom>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @generateRandom(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @generateRandom(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void heapSort(int *nums, int length) {}


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

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

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

LLVM IR (-O2):
define void @heapSort(i32* nocapture %0, i32 %1) {
ret void
}
const char *format_memory(int memory[6]) {
  *memory = 0;
  return "?";
}


x86 assembly (clang, -O0):
<format_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
lea    0xee7(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_memory>:
movl   $0x0,(%rdi)
lea    0xef3(%rip),%rax
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"?\00"
define i8* @format_memory(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
void pathcon_nm7_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm7_decref() {
ret void
}
/* Type definitions */
struct _WsbmKernelBuf {
  int dummy;
};
struct _WsbmBufStorage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
struct _WsbmKernelBuf *pool_kernel(struct _WsbmBufStorage *buf) {
  abort();
  return NULL;
}


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

x86 assembly (clang, -O2):
<pool_kernel>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct._WsbmKernelBuf = type { i32 }
%struct._WsbmBufStorage = type { i32 }
define %struct._WsbmKernelBuf* @pool_kernel(%struct._WsbmBufStorage* %0) {
%2 = alloca %struct._WsbmBufStorage*
store %struct._WsbmBufStorage* %0, %struct._WsbmBufStorage** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct._WsbmKernelBuf = type { i32 }
%struct._WsbmBufStorage = type { i32 }
define noalias %struct._WsbmKernelBuf* @pool_kernel(%struct._WsbmBufStorage* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
int __VERIFIER_nondet_int();
int main() {
  int i = 0, x = 0, y = 0;
  int n = __VERIFIER_nondet_int();
  __VERIFIER_assume(n > 0);
  for (i = 0; 1; i++) {
    __VERIFIER_assert(x == 0);
  }
  __VERIFIER_assert(x != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1185 <main+0x55>
jmp    11a4 <main+0x74>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1176 <main+0x46>
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1050 <__VERIFIER_assume@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @__VERIFIER_assume(i32 %9)
store i32 0, i32* %2
br label %11
11: ; preds = %17, %0
br i1 true, label %12, label %20
12: ; preds = %11
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @__VERIFIER_assert(i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %11
20: ; preds = %11
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @__VERIFIER_assert(i32 %23)
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
br label %5
5: ; preds = %5, %0
%6 = tail call i32 @__VERIFIER_assert(i32 1)
br label %5
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
int startsWith(const char *pre, const char *str) {
  size_t lenpre = strlen(pre), lenstr = strlen(str);
  return lenstr < lenpre ? 0 : strncmp(pre, str, lenpre) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <startsWith+0x42>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1182 <startsWith+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jb     115e <startsWith+0x3e>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
void CmpDestroy(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @CmpDestroy(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int input_waiting(void) {
  fd_set rfds;
  struct timeval tv;
  FD_ZERO(&rfds);
  FD_SET(0, &rfds);
  tv.tv_sec = 0;
  tv.tv_usec = 0;
  return select(1, &rfds, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<input_waiting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x4(%rbp),%rsi
call   1050 <FD_SET@plt>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_waiting>:
push   %rbx
sub    $0x20,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <FD_SET@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%r8
mov    $0x1,%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @input_waiting() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @FD_ZERO(i32* %1)
%4 = call i32 @FD_SET(i32 0, i32* %1)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i64 0, i64* %6
%7 = call i32 @select(i32 1, i32* %1, i32* null, i32* null, %struct.timeval* %2)
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @input_waiting() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = bitcast i32* %1 to i8*
%4 = bitcast %struct.timeval* %2 to i8*
%5 = call i32 @FD_ZERO(i32* %1)
%6 = call i32 @FD_SET(i32 0, i32* %1)
%7 = bitcast %struct.timeval* %2 to i8*
%8 = call i32 @select(i32 1, i32* %1, i32* null, i32* null, %struct.timeval* %2)
ret i32 %8
}
long double force_massAcceleration(long double M, long double A) {
  return M * A;
}


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

x86 assembly (clang, -O2):
<force_massAcceleration>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fmulp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @force_massAcceleration(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fmul x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @force_massAcceleration(x86_fp80 %0, x86_fp80 %1) {
%3 = fmul x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int const *);
int f(void) {
  const int dev = 4;
  return !foo(&dev);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <foo@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f() {
%1 = alloca i32
store i32 4, i32* %1
%2 = call i32 @foo(i32* %1)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = call i32 @foo(i32* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void asrs(int rn, int rm) {}


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

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

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

LLVM IR (-O2):
define void @asrs(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
void create_diff_tv(struct timeval *today, struct timeval *diff,
                    struct timeval *log) {
  diff->tv_sec = today->tv_sec - log->tv_sec;
  diff->tv_usec = today->tv_usec - log->tv_usec;
}


x86 assembly (clang, -O0):
<create_diff_tv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rax
sub    0x8(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
sub    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_diff_tv>:
movdqu (%rdi),%xmm0
movdqu (%rdx),%xmm1
psubq  %xmm1,%xmm0
movdqu %xmm0,(%rsi)
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @create_diff_tv(%struct.timeval* %0, %struct.timeval* %1, %struct.timeval* %2) {
%4 = alloca %struct.timeval*
%5 = alloca %struct.timeval*
%6 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %4
store %struct.timeval* %1, %struct.timeval** %5
store %struct.timeval* %2, %struct.timeval** %6
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = load %struct.timeval*, %struct.timeval** %6
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = sub nsw i64 %9, %12
%14 = load %struct.timeval*, %struct.timeval** %5
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 1
store i64 %13, i64* %15
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 0
%18 = load i64, i64* %17
%19 = load %struct.timeval*, %struct.timeval** %6
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %19, i32 0, i32 0
%21 = load i64, i64* %20
%22 = sub nsw i64 %18, %21
%23 = load %struct.timeval*, %struct.timeval** %5
%24 = getelementptr inbounds %struct.timeval, %struct.timeval* %23, i32 0, i32 0
store i64 %22, i64* %24
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @create_diff_tv(%struct.timeval* nocapture %0, %struct.timeval* nocapture writeonly %1, %struct.timeval* nocapture %2) {
%4 = bitcast %struct.timeval* %0 to <2 x i64>*
%5 = load <2 x i64>, <2 x i64>* %4
%6 = bitcast %struct.timeval* %2 to <2 x i64>*
%7 = load <2 x i64>, <2 x i64>* %6
%8 = sub nsw <2 x i64> %5, %7
%9 = bitcast %struct.timeval* %1 to <2 x i64>*
store <2 x i64> %8, <2 x i64>* %9
ret void
}
int ignore_err(const char *path, int err) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ignore_err(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_pop();
int /*<<< orphan*/ e_set_flags(int /*<<< orphan*/);
void e_plp() { e_set_flags(e_pop()); }


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

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

LLVM IR (-O0):
define void @e_plp() {
%1 = call i32 (...) @e_pop()
%2 = call i32 @e_set_flags(i32 %1)
ret void
}

LLVM IR (-O2):
define void @e_plp() {
%1 = tail call i32 (...) @e_pop()
%2 = tail call i32 @e_set_flags(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
int /*<<< orphan*/ unhexmangle_to_buffer(char *, char *, scalar_t__);
void unhexmangle_string(char *s) {
  if (s)
    unhexmangle_to_buffer(s, s, strlen(s) + 1);
}


x86 assembly (clang, -O0):
<unhexmangle_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <unhexmangle_string+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <unhexmangle_to_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unhexmangle_string>:
test   %rdi,%rdi
je     113e <unhexmangle_string+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <unhexmangle_to_buffer@plt>
ret

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

LLVM IR (-O2):
define void @unhexmangle_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @unhexmangle_to_buffer(i8* %0, i8* %0, i64 %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int compar_wchar(const void *a, const void *b, void *param) {
  return (*(wchar_t *)(a)) - (*(wchar_t *)(b));
}


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

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

LLVM IR (-O0):
define i32 @compar_wchar(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @compar_wchar(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = sub nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ PATH_MAX;
int /*<<< orphan*/ *getcwd(char *, int /*<<< orphan*/);
char *gmk_alloc(int /*<<< orphan*/);
char *func_pwd(const char *nm, unsigned int argc, char **argv) {
  char *buf = gmk_alloc(PATH_MAX);
  if (getcwd(buf, PATH_MAX) == NULL)
    buf[0] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<func_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <gmk_alloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
jne    1168 <func_pwd+0x48>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_pwd>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
call   1030 <gmk_alloc@plt>
mov    %rax,%rbx
mov    (%r14),%esi
mov    %rax,%rdi
call   1040 <getcwd@plt>
test   %rax,%rax
jne    1149 <func_pwd+0x29>
movb   $0x0,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i8* @func_pwd(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%8 = load i32, i32* @PATH_MAX
%9 = call i8* @gmk_alloc(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i32, i32* @PATH_MAX
%12 = call i32* @getcwd(i8* %10, i32 %11)
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i8*, i8** %7
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 0, i8* %16
br label %17
17: ; preds = %14, %3
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define i8* @func_pwd(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @PATH_MAX
%5 = tail call i8* @gmk_alloc(i32 %4)
%6 = load i32, i32* @PATH_MAX
%7 = tail call i32* @getcwd(i8* %5, i32 %6)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %3
store i8 0, i8* %5
br label %10
10: ; preds = %9, %3
ret i8* %5
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t cpu_read_cr2() {
  uint64_t ret = 0;
  __asm__ __volatile__("movq %%"
                       "cr2"
                       ", %0"
                       : "=r"(ret));
  return (ret);
}


x86 assembly (clang, -O0):
<cpu_read_cr2>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    %cr2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_read_cr2>:
mov    %cr2,%rax
ret

LLVM IR (-O0):
define i8* @cpu_read_cr2() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = call i8* asm sideeffect "movq %cr2, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @cpu_read_cr2() {
%1 = tail call i8* asm sideeffect "movq %cr2, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
int lw_sock_send_buffer_ex(int sock, char *buffer, int len) { return 0; }


x86 assembly (clang, -O0):
<lw_sock_send_buffer_ex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lw_sock_send_buffer_ex(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int strlen(char *);
int main(void) {
  char food[] = "Yummy";
  char *ptr;
  ptr = food + strlen(food);
  while (--ptr >= food)
    puts(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
lea    -0xa(%rbp),%rcx
cmp    %rcx,%rax
jb     118b <main+0x6b>
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
jmp    1164 <main+0x44>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movw   $0x79,0x4(%rsp)
movl   $0x6d6d7559,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rbx
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jb     1161 <main+0x41>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffffffffffff,%rbx
cmp    %r14,%rbx
jae    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.food = [6 x i8] c"Yummy\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = icmp ult i8* %6, %2
br i1 %7, label %13, label %8
8: ; preds = %0, %8
%9 = phi i8* [ %11, %8 ], [ %6, %0 ]
%10 = call i32 @puts(i8* %9)
%11 = getelementptr inbounds i8, i8* %9, i64 -1
%12 = icmp ult i8* %11, %2
br i1 %12, label %13, label %8
13: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(double, char, int);
int main() { f(0.0, 'a', 9); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
mov    $0x61,%edi
mov    $0x9,%esi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
mov    $0x61,%edi
mov    $0x9,%esi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(double 0.000000e+00, i8 signext 97, i32 9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(double 0.000000e+00, i8 signext 97, i32 9)
ret i32 0
}
void SCB_CleanInvalidateDCache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_CleanInvalidateDCache() {
ret void
}
int Foo(int foo[10], int index) { return foo[index]; }


x86 assembly (clang, -O0):
<Foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Foo>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @Foo(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @Foo(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}