xunge/DecIR huggingface dataset:
/* Variables and functions */
void memset_x86(void *buf, size_t len, int v) {
  char *bytes = buf;
  char *end = buf + len;
  const char val = v;
  while (bytes < end) {
    *bytes++ = val;
  }
}


x86 assembly (clang, -O0):
<memset_x86>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x29(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1150 <memset_x86+0x50>
mov    -0x29(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1129 <memset_x86+0x29>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset_x86>:
lea    (%rdi,%rsi,1),%rcx
cmp    %rdi,%rcx
jbe    112b <memset_x86+0x1b>
push   %rax
mov    %rsi,%rax
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @memset_x86(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
store i8* %10, i8** %7
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = getelementptr i8, i8* %11, i64 %12
store i8* %13, i8** %8
%14 = load i32, i32* %6
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
br label %16
16: ; preds = %20, %3
%17 = load i8*, i8** %7
%18 = load i8*, i8** %8
%19 = icmp ult i8* %17, %18
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i8, i8* %9
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %7
store i8 %21, i8* %22
br label %16
24: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @memset_x86(i8* writeonly %0, i64 %1, i32 %2) {
%4 = getelementptr i8, i8* %0, i64 %1
%5 = icmp ugt i8* %4, %0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = trunc i32 %2 to i8
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
struct tsm_screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inc_age(struct tsm_screen *);
int /*<<< orphan*/ tsm_screen_move_down(struct tsm_screen *, int, int);
int /*<<< orphan*/ tsm_screen_move_line_home(struct tsm_screen *);
__attribute__((visibility("default"))) void
tsm_screen_newline(struct tsm_screen *con) {
  if (!con)
    return;
  inc_age(con);
  tsm_screen_move_down(con, 1, true);
  tsm_screen_move_line_home(con);
}


x86 assembly (clang, -O0):
<tsm_screen_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <tsm_screen_newline+0x1c>
jmp    116e <tsm_screen_newline+0x3e>
mov    -0x8(%rbp),%rdi
call   1040 <inc_age@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <tsm_screen_move_down@plt>
mov    -0x8(%rbp),%rdi
call   1050 <tsm_screen_move_line_home@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsm_screen_newline>:
test   %rdi,%rdi
je     1159 <tsm_screen_newline+0x29>
push   %rbx
mov    %rdi,%rbx
call   1040 <inc_age@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <tsm_screen_move_down@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <tsm_screen_move_line_home@plt>
ret

LLVM IR (-O0):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_newline(%struct.tsm_screen* %0) {
%2 = alloca %struct.tsm_screen*
store %struct.tsm_screen* %0, %struct.tsm_screen** %2
%3 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%4 = icmp ne %struct.tsm_screen* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%8 = call i32 @inc_age(%struct.tsm_screen* %7)
%9 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%10 = call i32 @tsm_screen_move_down(%struct.tsm_screen* %9, i32 1, i32 1)
%11 = load %struct.tsm_screen*, %struct.tsm_screen** %2
%12 = call i32 @tsm_screen_move_line_home(%struct.tsm_screen* %11)
br label %13
13: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_newline(%struct.tsm_screen* %0) {
%2 = icmp eq %struct.tsm_screen* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @inc_age(%struct.tsm_screen* %0)
%5 = tail call i32 @tsm_screen_move_down(%struct.tsm_screen* %0, i32 1, i32 1)
%6 = tail call i32 @tsm_screen_move_line_home(%struct.tsm_screen* %0)
br label %7
7: ; preds = %1, %3
ret void
}
/* Variables and functions */
scalar_t__ Parray();
scalar_t__ PnameDef();
PinstanceNameDef() {
  int b = -1;
  ;
  b = PnameDef() || Parray();
  return (b);
}


x86 assembly (clang, -O0):
<PinstanceNameDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    $0x0,%al
call   1030 <PnameDef@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1159 <PinstanceNameDef+0x39>
mov    $0x0,%al
call   1040 <Parray@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PinstanceNameDef>:
push   %rax
xor    %eax,%eax
call   1030 <PnameDef@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <PinstanceNameDef+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <Parray@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @PinstanceNameDef() {
%1 = tail call i64 (...) @PnameDef()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @Parray()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long, long, char *);
scalar_t__ getpid();
scalar_t__ gettid();
int /*<<< orphan*/ stderr;
void whoami(char *msg) {
  fprintf(stderr, "pid %ld Thread %ld %s\n", (long)getpid(), (long)gettid(),
          msg);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<whoami>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
mov    -0x8(%rbp),%r8
lea    0xe81(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<whoami>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e8f(%rip),%r15
mov    (%r15),%ebp
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <gettid@plt>
lea    0xe94(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
mov    %r14,%r8
call   1050 <fprintf@plt>
mov    (%r15),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"pid %ld Thread %ld %s\0A\00"
define void @whoami(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i64 (...) @getpid()
%5 = call i64 (...) @gettid()
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %5, i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"pid %ld Thread %ld %s\0A\00"
define void @whoami(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @getpid()
%4 = tail call i64 (...) @gettid()
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %4, i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x0;
  int /*<<< orphan*/ cmd;
};
typedef TYPE_1__ osd_cmd_t;

/* Variables and functions */
int /*<<< orphan*/ OSD_SEND_CMD;
int /*<<< orphan*/ OSD_SetWindow;
int ioctl(int, int /*<<< orphan*/, TYPE_1__ *);
int OSDSetWindow(int dev, int win) {
  osd_cmd_t dc;
  dc.cmd = OSD_SetWindow;
  dc.x0 = win;
  return ioctl(dev, OSD_SEND_CMD, &dc);
}


x86 assembly (clang, -O0):
<OSDSetWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSDSetWindow>:
push   %rax
mov    0x2ee0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
mov    %esi,(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@OSD_SetWindow = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDSetWindow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.TYPE_3__
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* @OSD_SetWindow
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = load i32, i32* @OSD_SEND_CMD
%12 = call i32 @ioctl(i32 %10, i32 %11, %struct.TYPE_3__* %5)
ret i32 %12
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@OSD_SetWindow = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDSetWindow(i32 %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = bitcast %struct.TYPE_3__* %3 to i8*
%5 = load i32, i32* @OSD_SetWindow
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 1
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
store i32 %1, i32* %7
%8 = load i32, i32* @OSD_SEND_CMD
%9 = call i32 @ioctl(i32 %0, i32 %8, %struct.TYPE_3__* %3)
ret i32 %9
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int getTimestamp() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (unsigned int)(tv.tv_sec) * 1000 + (unsigned int)(tv.tv_usec) / 1000;
}


x86 assembly (clang, -O0):
<getTimestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%ecx
mov    0x8(%rsp),%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @getTimestamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = udiv i32 %9, 1000
%11 = add i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @getTimestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = udiv i32 %10, 1000
%12 = add i32 %11, %7
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int str_starts_with(char *str, char *prefix) {
  if (!str || !prefix) {
    return 0;
  }
  return strncmp(str, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<str_starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <str_starts_with+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1152 <str_starts_with+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1189 <str_starts_with+0x69>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_starts_with>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1156 <str_starts_with+0x36>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1156 <str_starts_with+0x36>
mov    %rdi,%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @str_starts_with(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int tfd_xpropPresent(void) {
  static int lXpropPresent = -1;
  if (lXpropPresent < 0) {
    lXpropPresent = detectPresence("xprop");
  }
  return lXpropPresent && graphicMode();
}


x86 assembly (clang, -O0):
<tfd_xpropPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <tfd_xpropPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <tfd_xpropPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfd_xpropPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <tfd_xpropPresent+0x23>
test   %eax,%eax
je     1159 <tfd_xpropPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <tfd_xpropPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@tfd_xpropPresent.lXpropPresent = internal global i32 -1
@.str = [6 x i8] c"xprop\00"
define i32 @tfd_xpropPresent() {
%1 = load i32, i32* @tfd_xpropPresent.lXpropPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @tfd_xpropPresent.lXpropPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @tfd_xpropPresent.lXpropPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@tfd_xpropPresent.lXpropPresent = internal unnamed_addr global i32 -1
@.str = [6 x i8] c"xprop\00"
define i32 @tfd_xpropPresent() {
%1 = load i32, i32* @tfd_xpropPresent.lXpropPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @tfd_xpropPresent.lXpropPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
void obtener_cociente_y_resto(unsigned a, unsigned b, int *cociente,
                              int *resto) {
  *cociente = a / b;
  *resto = a % b;
}


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

x86 assembly (clang, -O2):
<obtener_cociente_y_resto>:
mov    %rdx,%r8
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %eax,(%r8)
mov    %edx,(%rcx)
ret

LLVM IR (-O0):
define void @obtener_cociente_y_resto(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = udiv i32 %9, %10
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = urem i32 %13, %14
%16 = load i32*, i32** %8
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @obtener_cociente_y_resto(i32 %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = udiv i32 %0, %1
store i32 %5, i32* %2
%6 = urem i32 %0, %1
store i32 %6, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void sumar_valor(int numero) {
  numero++;
  printf("Valor de numero dentro sumar_valor() es: %d\n", numero);
  return;
}


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

x86 assembly (clang, -O2):
<sumar_valor>:
lea    0x1(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Valor de numero dentro sumar_valor() es: %d\0A\00"
define void @sumar_valor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Valor de numero dentro sumar_valor() es: %d\0A\00"
define void @sumar_valor(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int core5_swap(char *, int);
int U_EMRWIDENPATH_swap(char *record, int torev) {
  return (core5_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRWIDENPATH_swap>:
jmp    1030 <core5_swap@plt>

LLVM IR (-O0):
define i32 @U_EMRWIDENPATH_swap(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* %4
%7 = call i32 @core5_swap(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U_EMRWIDENPATH_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core5_swap(i8* %0, i32 %1)
ret i32 %3
}
int Cyc_Absyn_cmp_ptr(void *a, void *b) {
  return (int)((unsigned)a - (unsigned)b);
}


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

x86 assembly (clang, -O2):
<Cyc_Absyn_cmp_ptr>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @Cyc_Absyn_cmp_ptr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i32
%9 = sub i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @Cyc_Absyn_cmp_ptr(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t usb_lo(uint16_t val) { return val & 0xff; }


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

x86 assembly (clang, -O2):
<usb_lo>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @usb_lo(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int i, n = __VERIFIER_nondet_int(), sn = 0;
  for (i = 1; i <= n; i++) {
    sn = sn + 1;
  }
  __VERIFIER_assert(sn == n || sn == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     116a <main+0x4a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
mov    -0x10(%rbp),%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
je     1185 <main+0x65>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%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>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vazio();
int main(void) { vazio(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @vazio()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @vazio()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die_usage(void) {
  fputs("Usage: bench hashfunc [totaldata] [chunksize]\n", stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<die_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: bench hashfunc [totaldata] [chunksize]\0A\00"
@stderr = global i32 0
define void @die_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [47 x i8] c"Usage: bench hashfunc [totaldata] [chunksize]\0A\00"
@stderr = global i32 0
define void @die_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct Cyc___cycFILE {
  int dummy;
};

/* Variables and functions */
int Cyc_fgetc(struct Cyc___cycFILE *);
int /*<<< orphan*/ Cyc_ungetc(int, struct Cyc___cycFILE *);
int Cyc_peekc(struct Cyc___cycFILE *stream) {
  int _T0;
  int c = Cyc_fgetc(stream);
  Cyc_ungetc(c, stream);
  _T0 = c;
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_peekc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <Cyc_fgetc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <Cyc_ungetc@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_peekc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <Cyc_fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <Cyc_ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.Cyc___cycFILE = type { i32 }
define i32 @Cyc_peekc(%struct.Cyc___cycFILE* %0) {
%2 = alloca %struct.Cyc___cycFILE*
%3 = alloca i32
%4 = alloca i32
store %struct.Cyc___cycFILE* %0, %struct.Cyc___cycFILE** %2
%5 = load %struct.Cyc___cycFILE*, %struct.Cyc___cycFILE** %2
%6 = call i32 @Cyc_fgetc(%struct.Cyc___cycFILE* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load %struct.Cyc___cycFILE*, %struct.Cyc___cycFILE** %2
%9 = call i32 @Cyc_ungetc(i32 %7, %struct.Cyc___cycFILE* %8)
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.Cyc___cycFILE = type { i32 }
define i32 @Cyc_peekc(%struct.Cyc___cycFILE* %0) {
%2 = tail call i32 @Cyc_fgetc(%struct.Cyc___cycFILE* %0)
%3 = tail call i32 @Cyc_ungetc(i32 %2, %struct.Cyc___cycFILE* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_XOR(int r, int v) { C67_asm("XOR.L", v, r, v); }


x86 assembly (clang, -O0):
<C67_XOR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed2(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"XOR.L\00"
define void @C67_XOR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"XOR.L\00"
define void @C67_XOR(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void oi(void) {
  printf("\nOi!\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"\0AOi!\00"
define void @oi() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
void skip_over_whites(c) int c;
{
  while (is_white(c))
    c = s_getchar();
  s_unput(c);
}


x86 assembly (clang, -O0):
<skip_over_whites>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1050 <is_white@plt>
cmp    $0x0,%eax
je     115d <skip_over_whites+0x2d>
mov    $0x0,%al
call   1040 <s_getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    113b <skip_over_whites+0xb>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <s_unput@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_over_whites>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <is_white@plt>
test   %eax,%eax
je     1158 <skip_over_whites+0x28>
xor    %eax,%eax
call   1040 <s_getchar@plt>
mov    %eax,%ebx
mov    %eax,%edi
jmp    1140 <skip_over_whites+0x10>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <s_unput@plt>

LLVM IR (-O0):
define void @skip_over_whites(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @is_white to i32 (i32, ...)*)(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @s_getchar()
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = call i32 (i32, ...) bitcast (i32 (...)* @s_unput to i32 (i32, ...)*)(i32 %10)
ret void
}

LLVM IR (-O2):
define void @skip_over_whites(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @is_white to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 (...) @s_getchar()
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @is_white to i32 (i32, ...)*)(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %1
%9 = phi i32 [ %0, %1 ], [ %5, %4 ]
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @s_unput to i32 (i32, ...)*)(i32 %9)
ret void
}
/* Variables and functions */
int access(char const *, int);
int dir_mutex_lock(int);
int /*<<< orphan*/ dir_mutex_unlock();
int faccessat(int dirfd, const char *pathname, int mode, int flags) {
  int rc;
  if (flags) {
  }
  rc = dir_mutex_lock(dirfd);
  if (rc < 0)
    return rc;
  rc = access(pathname, mode);
  dir_mutex_unlock();
  return rc;
}


x86 assembly (clang, -O0):
<faccessat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1154 <faccessat+0x24>
jmp    1154 <faccessat+0x24>
mov    -0x8(%rbp),%edi
call   1030 <dir_mutex_lock@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1174 <faccessat+0x44>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <faccessat+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <access@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <dir_mutex_unlock@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<faccessat>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <dir_mutex_lock@plt>
test   %eax,%eax
js     1156 <faccessat+0x26>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <access@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dir_mutex_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @faccessat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %9
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %4
br label %14
14: ; preds = %13, %4
%15 = load i32, i32* %6
%16 = call i32 @dir_mutex_lock(i32 %15)
store i32 %16, i32* %10
%17 = load i32, i32* %10
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %10
store i32 %20, i32* %5
br label %27
21: ; preds = %14
%22 = load i8*, i8** %7
%23 = load i32, i32* %8
%24 = call i32 @access(i8* %22, i32 %23)
store i32 %24, i32* %10
%25 = call i32 (...) @dir_mutex_unlock()
%26 = load i32, i32* %10
store i32 %26, i32* %5
br label %27
27: ; preds = %21, %19
%28 = load i32, i32* %5
ret i32 %28
}

LLVM IR (-O2):
define i32 @faccessat(i32 %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @dir_mutex_lock(i32 %0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @access(i8* %1, i32 %2)
%9 = tail call i32 (...) @dir_mutex_unlock()
br label %10
10: ; preds = %4, %7
%11 = phi i32 [ %8, %7 ], [ %5, %4 ]
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long event;
};
struct TYPE_4__ {
  TYPE_1__ xunmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xunmap_event(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xunmap.event = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xunmap_event(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xunmap_event(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void chan(int a, int b) {
  a = 1;
  b = 2;
}


x86 assembly (clang, -O0):
<chan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @chan(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int fixsize(uint16_t size) {
  if ((!((size) & (size - 1))))
    return size;
  size |= size >> 1;
  size |= size >> 2;
  size |= size >> 4;
  size |= size >> 8;
  return size + 1;
}


x86 assembly (clang, -O0):
<fixsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1126 <fixsize+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <fixsize+0x5f>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixsize>:
mov    %edi,%eax
lea    -0x1(%rax),%ecx
test   %ecx,%edi
je     1127 <fixsize+0x27>
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x8,%eax
or     %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fixsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 1
%7 = and i32 %4, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %30
11: ; preds = %1
%12 = load i32, i32* %3
%13 = ashr i32 %12, 1
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = ashr i32 %16, 2
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = ashr i32 %20, 4
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = ashr i32 %24, 8
%26 = load i32, i32* %3
%27 = or i32 %26, %25
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %30
30: ; preds = %11, %9
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @fixsize(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = ashr i32 %0, 1
%6 = or i32 %5, %0
%7 = ashr i32 %6, 2
%8 = or i32 %7, %6
%9 = ashr i32 %8, 4
%10 = or i32 %9, %8
%11 = ashr i32 %10, 8
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
br label %14
14: ; preds = %1, %4
%15 = phi i32 [ %13, %4 ], [ %0, %1 ]
ret i32 %15
}
bar() {
  static int funclocal = 4;
  static int funclocal_bss;
  funclocal_bss = 104;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x68,0x2f1a(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@bar.funclocal = internal global i32 4
@bar.funclocal_bss = internal global i32 0
define i32 @bar() {
%1 = alloca i32
store i32 104, i32* @bar.funclocal_bss
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hellow world\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%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 = [14 x i8] c"Hellow world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hellow world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(unsigned long);
void or_reg32_m32(unsigned long reg32, void *_m32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x0B);
  put8((reg32 << 3) | 5);
  put32((unsigned long)(m32));
}


x86 assembly (clang, -O0):
<or_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0xb,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
or     $0x5,%rdi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xb,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%rdi
call   1030 <put8@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @or_reg32_m32(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i64 11)
%9 = load i64, i64* %3
%10 = shl i64 %9, 3
%11 = or i64 %10, 5
%12 = call i32 @put8(i64 %11)
%13 = load i64*, i64** %5
%14 = ptrtoint i64* %13 to i64
%15 = call i32 @put32(i64 %14)
ret void
}

LLVM IR (-O2):
define void @or_reg32_m32(i64 %0, i8* %1) {
%3 = tail call i32 @put8(i64 11)
%4 = shl i64 %0, 3
%5 = or i64 %4, 5
%6 = tail call i32 @put8(i64 %5)
%7 = ptrtoint i8* %1 to i64
%8 = tail call i32 @put32(i64 %7)
ret void
}
/* Variables and functions */
int IPC_CREAT;
int get_key_or_die(char *);
int mutex_get(int, int);
int mutex_lock(int);
int lock_dss(char *config_file) {
  int ret, key = get_key_or_die(config_file);
  ret = mutex_get(key, IPC_CREAT | 0600);
  if (ret < 0)
    return ret;
  return mutex_lock(ret);
}


x86 assembly (clang, -O0):
<lock_dss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_key_or_die@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
or     $0x180,%esi
call   1040 <mutex_get@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1177 <lock_dss+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <lock_dss+0x52>
mov    -0x14(%rbp),%edi
call   1030 <mutex_lock@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_dss>:
push   %rax
call   1050 <get_key_or_die@plt>
mov    0x2ea3(%rip),%rcx
mov    $0x180,%esi
or     (%rcx),%esi
mov    %eax,%edi
call   1040 <mutex_get@plt>
test   %eax,%eax
js     1157 <lock_dss+0x27>
mov    %eax,%edi
pop    %rax
jmp    1030 <mutex_lock@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @lock_dss(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @get_key_or_die(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* @IPC_CREAT
%10 = or i32 %9, 384
%11 = call i32 @mutex_get(i32 %8, i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i32, i32* %4
store i32 %15, i32* %2
br label %19
16: ; preds = %1
%17 = load i32, i32* %4
%18 = call i32 @mutex_lock(i32 %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @lock_dss(i8* %0) {
%2 = tail call i32 @get_key_or_die(i8* %0)
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 %3, 384
%5 = tail call i32 @mutex_get(i32 %2, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @mutex_lock(i32 %5)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ %8, %7 ], [ %5, %1 ]
ret i32 %10
}
/* Type definitions */
struct sprd_mcdt_chan {
  int dummy;
};

/* Variables and functions */
void sprd_mcdt_free_chan(struct sprd_mcdt_chan *chan) {}


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

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

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

LLVM IR (-O2):
%struct.sprd_mcdt_chan = type { i32 }
define void @sprd_mcdt_free_chan(%struct.sprd_mcdt_chan* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flush();
int prompt(char *);
int /*<<< orphan*/ scanf(char *, int *);
int valid_selection(int upper) {
  int select;
  scanf("%d", &select);
  flush();
  if (select < 1 || select > upper)
    return prompt("\nInvalid selection.");
  return select;
}


x86 assembly (clang, -O0):
<valid_selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xebe(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1030 <flush@plt>
cmpl   $0x1,-0xc(%rbp)
jl     1168 <valid_selection+0x38>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    117c <valid_selection+0x4c>
lea    0xe94(%rip),%rdi
call   1040 <prompt@plt>
mov    %eax,-0x4(%rbp)
jmp    1182 <valid_selection+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_selection>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xec2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1030 <flush@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    115b <valid_selection+0x2b>
cmp    %ebx,%eax
jle    1167 <valid_selection+0x37>
lea    0xea1(%rip),%rdi
call   1040 <prompt@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [20 x i8] c"\0AInvalid selection.\00"
define i32 @valid_selection(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = call i32 (...) @flush()
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9, %1
%14 = call i32 @prompt(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i32 %14, i32* %2
br label %17
15: ; preds = %9
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [20 x i8] c"\0AInvalid selection.\00"
define i32 @valid_selection(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = call i32 (...) @flush()
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
%8 = icmp sgt i32 %6, %0
%9 = or i1 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @prompt(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %1, %10
%13 = phi i32 [ %11, %10 ], [ %6, %1 ]
ret i32 %13
}