xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
scalar_t__ SIG_ERR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ signal(int /*<<< orphan*/, void (*)(int));
int /*<<< orphan*/ stderr;
main() {
  int *y;
  void my_int_handler(int);
  if (signal(SIGINT, my_int_handler) == SIG_ERR) {
    fprintf(stderr, "signal handler registration failed\n");
    exit(1);
  }
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e79(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%rax
jne    1183 <main+0x53>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1188 <main+0x58>
jmp    1188 <main+0x58>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e87(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
je     1162 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1160 <main+0x30>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe8e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_ERR = global i64 0
@stderr = global i32 0
@.str = [36 x i8] c"signal handler registration failed\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = load i32, i32* @SIGINT
%4 = call i64 @signal(i32 %3, void (i32)* @my_int_handler)
%5 = load i64, i64* @SIG_ERR
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
br label %12
12: ; preds = %11, %12
br label %12
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_ERR = global i64 0
@stderr = global i32 0
@.str = [36 x i8] c"signal handler registration failed\0A\00"
define i32 @main() {
%1 = load i32, i32* @SIGINT
%2 = tail call i64 @signal(i32 %1, void (i32)* @my_int_handler)
%3 = load i64, i64* @SIG_ERR
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %0, %9
br label %9
}
/* Variables and functions */
scalar_t__ COND_EQ();
int /*<<< orphan*/ EA_AY_AI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_seq_8_ai(void) {
  m68ki_write_8(EA_AY_AI_8(), COND_EQ() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_seq_8_ai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_AI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_EQ@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_seq_8_ai>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_AI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_EQ@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_seq_8_ai() {
%1 = call i32 (...) @EA_AY_AI_8()
%2 = call i64 (...) @COND_EQ()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_seq_8_ai() {
%1 = tail call i32 (...) @EA_AY_AI_8()
%2 = tail call i64 (...) @COND_EQ()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
double test2(double x) { return __builtin_cos(x); }


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

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @test2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
ret double %4
}

LLVM IR (-O2):
define double @test2(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Type definitions */
typedef int uint32_t;
struct input_event {
  int dummy;
};

/* Variables and functions */
int EPOLLIN;
int read(int, struct input_event *, int);
int ev_get_input(int fd, uint32_t epevents, struct input_event *ev) {
  int r;
  if (epevents & EPOLLIN) {
    r = read(fd, ev, sizeof(*ev));
    if (r == sizeof(*ev))
      return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<ev_get_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ebc(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     116a <ev_get_input+0x5a>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jne    1165 <ev_get_input+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1171 <ev_get_input+0x61>
jmp    116a <ev_get_input+0x5a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_get_input>:
push   %rax
mov    0x2ed0(%rip),%rax
test   %esi,(%rax)
je     1132 <ev_get_input+0x22>
mov    %rdx,%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4,%ecx
je     1137 <ev_get_input+0x27>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.input_event = type { i32 }
@EPOLLIN = global i32 0
define i32 @ev_get_input(i32 %0, i32 %1, %struct.input_event* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.input_event*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.input_event* %2, %struct.input_event** %7
%9 = load i32, i32* %6
%10 = load i32, i32* @EPOLLIN
%11 = and i32 %9, %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load %struct.input_event*, %struct.input_event** %7
%16 = call i32 @read(i32 %14, %struct.input_event* %15, i32 4)
store i32 %16, i32* %8
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = icmp eq i64 %18, 4
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 0, i32* %4
br label %23
21: ; preds = %13
br label %22
22: ; preds = %21, %3
store i32 -1, i32* %4
br label %23
23: ; preds = %22, %20
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
%struct.input_event = type { i32 }
@EPOLLIN = global i32 0
define i32 @ev_get_input(i32 %0, i32 %1, %struct.input_event* nocapture %2) {
%4 = load i32, i32* @EPOLLIN
%5 = and i32 %4, %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @read(i32 %0, %struct.input_event* %2, i32 4)
%9 = icmp eq i32 %8, 4
br i1 %9, label %11, label %10
10: ; preds = %7, %3
br label %11
11: ; preds = %7, %10
%12 = phi i32 [ -1, %10 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void output(int *dat, int input_ct) {
  int i;
  for (i = 0; i < input_ct; ++i) {
    printf("%d\n", dat[i]);
  }
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <output+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <output+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <output+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <output+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @output(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @output(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ RIFF_ReadChunkInfo(int /*<<< orphan*/ *, int, int *, int *,
                                      int *);
int RIFF_NextChunk(FILE *fd, int ofs) {
  int cc1, cc2, sz;
  RIFF_ReadChunkInfo(fd, ofs, &cc1, &sz, &cc2);
  if (sz & 1)
    sz++;
  return (ofs + sz + 8);
}


x86 assembly (clang, -O0):
<RIFF_NextChunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <RIFF_ReadChunkInfo@plt>
mov    -0x18(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <RIFF_NextChunk+0x3f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x18(%rbp),%eax
add    $0x8,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RIFF_NextChunk>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0xc(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <RIFF_ReadChunkInfo@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
and    $0x1,%ecx
add    %eax,%ecx
lea    (%rbx,%rcx,1),%eax
add    $0x8,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @RIFF_NextChunk(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @RIFF_ReadChunkInfo(i32* %0, i32 %1, i32* %3, i32* %5, i32* %4)
%10 = load i32, i32* %5
%11 = and i32 %10, 1
%12 = add nsw i32 %10, %11
%13 = add i32 %1, 8
%14 = add i32 %13, %12
ret i32 %14
}
unsigned xrop3_55_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_55_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_55_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rsi,1),%edx
or     $0xff,%ecx
and    %eax,%ecx
or     %ecx,%edx
xor    %eax,%ecx
not    %edx
not    %eax
and    %esi,%eax
or     %ecx,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_55_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = or i32 %6, 255
%9 = and i32 %8, %4
%10 = xor i32 %9, %4
%11 = or i32 %7, %9
%12 = xor i32 %11, -1
%13 = xor i32 %4, -1
%14 = and i32 %13, %5
%15 = or i32 %14, %12
%16 = or i32 %15, %10
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ init_price_table();
int /*<<< orphan*/ print_price_table();
int main(void) {
  init_price_table();
  print_price_table();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_price_table()
%2 = tail call i32 (...) @print_price_table()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ SSIBaseValid(unsigned long);
void SSIIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(SSIBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000014))) &= ~(ulIntFlags);
}


x86 assembly (clang, -O0):
<SSIIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <SSIBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0x14(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @SSIIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @SSIBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = xor i64 %8, -1
%10 = load i64, i64* %3
%11 = add i64 %10, 20
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @SSIIntDisable(i64 %0, i64 %1) {
%3 = tail call i32 @SSIBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = xor i64 %1, -1
%6 = add i64 %0, 20
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
int StrLen(char *str) {
  int len = 0;
  while (*str++) {
    ++len;
  }
  return len;
}


x86 assembly (clang, -O0):
<StrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <StrLen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <StrLen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrLen>:
cmpb   $0x0,(%rdi)
je     111c <StrLen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <StrLen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @StrLen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void arch_switch_thread(struct thread *restrict old,
                        struct thread *restrict new) {
  (void)old;
  (void)new;
  (void)(0);
}


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

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

LLVM IR (-O0):
%struct.thread = type opaque
define void @arch_switch_thread(%struct.thread* noalias %0, %struct.thread* noalias %1) {
%3 = alloca %struct.thread*
%4 = alloca %struct.thread*
store %struct.thread* %0, %struct.thread** %3
store %struct.thread* %1, %struct.thread** %4
%5 = load %struct.thread*, %struct.thread** %3
%6 = load %struct.thread*, %struct.thread** %4
ret void
}

LLVM IR (-O2):
%struct.thread = type opaque
define void @arch_switch_thread(%struct.thread* noalias nocapture %0, %struct.thread* noalias nocapture %1) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
void set_XSelectionClearEvent_send_event(void *_p, int _v) {
  ((XSelectionClearEvent *)_p)->send_event = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XSelectionClearEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgdiv();
int /*<<< orphan*/ cgpop2();
int /*<<< orphan*/ cgswap();
int /*<<< orphan*/ gentext();
void gendiv(int swap) {
  gentext();
  cgpop2();
  if (swap)
    cgswap();
  cgdiv();
}


x86 assembly (clang, -O0):
<gendiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gentext@plt>
mov    $0x0,%al
call   1040 <cgpop2@plt>
cmpl   $0x0,-0x4(%rbp)
je     116a <gendiv+0x2a>
mov    $0x0,%al
call   1030 <cgswap@plt>
mov    $0x0,%al
call   1060 <cgdiv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gendiv>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <gentext@plt>
xor    %eax,%eax
call   1040 <cgpop2@plt>
test   %ebx,%ebx
je     115c <gendiv+0x1c>
xor    %eax,%eax
call   1030 <cgswap@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <cgdiv@plt>

LLVM IR (-O0):
define void @gendiv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gentext()
%4 = call i32 (...) @cgpop2()
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @cgswap()
br label %9
9: ; preds = %7, %1
%10 = call i32 (...) @cgdiv()
ret void
}

LLVM IR (-O2):
define void @gendiv(i32 %0) {
%2 = tail call i32 (...) @gentext()
%3 = tail call i32 (...) @cgpop2()
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @cgswap()
br label %7
7: ; preds = %5, %1
%8 = tail call i32 (...) @cgdiv()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_memcpy(char *, char const *, size_t);
scalar_t__ malloc(size_t);
char *ft_strndup(const char *s, size_t n) {
  char *str;
  str = (char *)malloc(n + 1);
  if (str) {
    ft_memcpy(str, s, n);
    str[n] = 0;
  }
  return (str);
}


x86 assembly (clang, -O0):
<ft_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <ft_strndup+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <ft_memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114f <ft_strndup+0x2f>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <ft_memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @ft_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @ft_memcpy(i8* %5, i8* %0, i64 %1)
%9 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
void ExttServerGroupAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttServerGroupAuxTable() {
ret void
}
/* Variables and functions */
scalar_t__ is_text(char const);
int __text_len(const char *s) {
  int l;
  for (l = 0; is_text(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__text_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_text@plt>
cmp    $0x0,%rax
je     1153 <__text_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__text_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__text_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_text@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__text_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_text@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__text_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__text_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_text(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_text(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, int, int, int);
int /*<<< orphan*/ f2(int, int, int, int, int, int);
int main() {
  f1(1, 2, 3, 4);
  f2(5, 6, 7, 8, 9, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <f1@plt>
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
call   1030 <f2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1040 <f1@plt>
mov    $0x5,%edi
mov    $0x6,%esi
mov    $0x7,%edx
mov    $0x8,%ecx
mov    $0x9,%r8d
mov    $0xa,%r9d
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 1, i32 2, i32 3, i32 4)
%2 = tail call i32 @f2(i32 5, i32 6, i32 7, i32 8, i32 9, i32 10)
ret i32 0
}
void increment_random_dither(void) { return; }


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

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

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

LLVM IR (-O2):
define void @increment_random_dither() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getegid();
int geteuid();
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(int argc, char *argv[]) {
  printf("Real User ID: %d\nEffective User ID: %d\nReal Group ID %d\nEffective "
         "Group ID: %d\n",
         getuid(), geteuid(), getgid(), getegid());
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    %eax,%r8d
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <getgid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <getegid@plt>
lea    0xe72(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
mov    0x2e3c(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"Real User ID: %d\0AEffective User ID: %d\0AReal Group ID %d\0AEffective Group ID: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getuid()
%7 = call i32 (...) @geteuid()
%8 = call i32 (...) @getgid()
%9 = call i32 (...) @getegid()
%10 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [80 x i8] c"Real User ID: %d\0AEffective User ID: %d\0AReal Group ID %d\0AEffective Group ID: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 (...) @geteuid()
%5 = tail call i32 (...) @getgid()
%6 = tail call i32 (...) @getegid()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
%9 = tail call i32 @exit(i32 %8)
unreachable
}
int module_get_iter_tracepoints(struct tracepoint_iter *iter) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.tracepoint_iter = type opaque
define i32 @module_get_iter_tracepoints(%struct.tracepoint_iter* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct MemoryPage {
  int dummy;
};

/* Variables and functions */
void *MAAddMemoryBlockEx(struct MemoryPage *, void *, long, int /*<<< orphan*/);
void *MAAddMemoryBlock(struct MemoryPage *p_mempage, void *block_data,
                       long block_size) {
  return MAAddMemoryBlockEx(p_mempage, block_data, block_size, 0);
}


x86 assembly (clang, -O0):
<MAAddMemoryBlock>:
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),%rdx
xor    %ecx,%ecx
call   1030 <MAAddMemoryBlockEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAAddMemoryBlock>:
xor    %ecx,%ecx
jmp    1030 <MAAddMemoryBlockEx@plt>

LLVM IR (-O0):
%struct.MemoryPage = type { i32 }
define i8* @MAAddMemoryBlock(%struct.MemoryPage* %0, i8* %1, i64 %2) {
%4 = alloca %struct.MemoryPage*
%5 = alloca i8*
%6 = alloca i64
store %struct.MemoryPage* %0, %struct.MemoryPage** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.MemoryPage*, %struct.MemoryPage** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @MAAddMemoryBlockEx(%struct.MemoryPage* %7, i8* %8, i64 %9, i32 0)
ret i8* %10
}

LLVM IR (-O2):
%struct.MemoryPage = type { i32 }
define i8* @MAAddMemoryBlock(%struct.MemoryPage* %0, i8* %1, i64 %2) {
%4 = tail call i8* @MAAddMemoryBlockEx(%struct.MemoryPage* %0, i8* %1, i64 %2, i32 0)
ret i8* %4
}
/* Type definitions */
struct configuration {
  int dummy;
};

/* Variables and functions */
char **extract_values_delim(char *, char const *);
char *get_value(char const *, struct configuration *);
char **get_values_delim(const char *key, struct configuration *cfg,
                        const char *delim) {
  char *value = get_value(key, cfg);
  return extract_values_delim(value, delim);
}


x86 assembly (clang, -O0):
<get_values_delim>:
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
call   1040 <get_value@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <extract_values_delim@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_values_delim>:
push   %rbx
mov    %rdx,%rbx
call   1040 <get_value@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <extract_values_delim@plt>

LLVM IR (-O0):
%struct.configuration = type { i32 }
define i8** @get_values_delim(i8* %0, %struct.configuration* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.configuration*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store %struct.configuration* %1, %struct.configuration** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load %struct.configuration*, %struct.configuration** %5
%10 = call i8* @get_value(i8* %8, %struct.configuration* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %6
%13 = call i8** @extract_values_delim(i8* %11, i8* %12)
ret i8** %13
}

LLVM IR (-O2):
%struct.configuration = type { i32 }
define i8** @get_values_delim(i8* %0, %struct.configuration* %1, i8* %2) {
%4 = tail call i8* @get_value(i8* %0, %struct.configuration* %1)
%5 = tail call i8** @extract_values_delim(i8* %4, i8* %2)
ret i8** %5
}
/* Variables and functions */
int /*<<< orphan*/ dtrsv_(char *, char *, char *, int *, double *, int *,
                          double *, int *);
void wcc_dtrsv_(char *UPLO, char *TRANS, char *DIAG, int *N, char *A, int *LDA,
                char *X, int *INCX) {
  dtrsv_(UPLO, TRANS, DIAG, N, (double *)A, LDA, (double *)X, INCX);
}


x86 assembly (clang, -O0):
<wcc_dtrsv_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dtrsv_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_dtrsv_>:
jmp    1030 <dtrsv_@plt>

LLVM IR (-O0):
define void @wcc_dtrsv_(i8* %0, i8* %1, i8* %2, i32* %3, i8* %4, i32* %5, i8* %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i32*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32* %3, i32** %12
store i8* %4, i8** %13
store i32* %5, i32** %14
store i8* %6, i8** %15
store i32* %7, i32** %16
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = load i32*, i32** %12
%21 = load i8*, i8** %13
%22 = bitcast i8* %21 to double*
%23 = load i32*, i32** %14
%24 = load i8*, i8** %15
%25 = bitcast i8* %24 to double*
%26 = load i32*, i32** %16
%27 = call i32 @dtrsv_(i8* %17, i8* %18, i8* %19, i32* %20, double* %22, i32* %23, double* %25, i32* %26)
ret void
}

LLVM IR (-O2):
define void @wcc_dtrsv_(i8* %0, i8* %1, i8* %2, i32* %3, i8* %4, i32* %5, i8* %6, i32* %7) {
%9 = bitcast i8* %4 to double*
%10 = bitcast i8* %6 to double*
%11 = tail call i32 @dtrsv_(i8* %0, i8* %1, i8* %2, i32* %3, double* %9, i32* %5, double* %10, i32* %7)
ret void
}
const char *rcsid(const char *p) {
  return rcsid(
      p = "@(#)$File: cdf.c,v 1.30 2009/05/06 14:29:47 christos Exp $");
}


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

x86 assembly (clang, -O2):
<rcsid>:
jmp    1100 <rcsid>

LLVM IR (-O0):
@.str = [59 x i8] c"@(#)$File: cdf.c,v 1.30 2009/05/06 14:29:47 christos Exp $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _assert_null_found(char *func) {
  printf("F");
  return 1;
}


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

x86 assembly (clang, -O2):
<_assert_null_found>:
push   %rax
mov    $0x46,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_assert_null_found(i8* nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 70)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len,
            unsigned int msg_prio) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<mq_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_send>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @mq_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @mq_send(i32 %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
void mem_put_be16_as_int(void *vmem, int val) {
  unsigned char *mem = (unsigned char *)vmem;
  mem[0] = (val >> 8) & 0xff;
  mem[1] = (val >> 0) & 0xff;
}


x86 assembly (clang, -O0):
<mem_put_be16_as_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_put_be16_as_int>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @mem_put_be16_as_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = ashr i32 %13, 0
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
ret void
}

LLVM IR (-O2):
define void @mem_put_be16_as_int(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
void __VERIFIER_assume(int expr) { (void)expr; }


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

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

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

LLVM IR (-O2):
define void @__VERIFIER_assume(i32 %0) {
ret void
}
/* Type definitions */
struct lvalue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ opjump(char *, int);
void jump0(struct lvalue *lval, int label) { opjump("", label); }


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

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

LLVM IR (-O0):
%struct.lvalue = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @jump0(%struct.lvalue* %0, i32 %1) {
%3 = alloca %struct.lvalue*
%4 = alloca i32
store %struct.lvalue* %0, %struct.lvalue** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @opjump(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
%struct.lvalue = type { i32 }
@.str = [1 x i8] zeroinitializer
define void @jump0(%struct.lvalue* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @opjump(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: file [-L] name ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: file [-L] name ...\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"Usage: file [-L] name ...\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fs_path_op(void *, void *, void *, int /*<<< orphan*/);
void dir_list(unsigned char *dir, unsigned char *list) {
  fs_path_op((void *)dir, (void *)0, (void *)list, 0);
}


x86 assembly (clang, -O0):
<dir_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <fs_path_op@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_list>:
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <fs_path_op@plt>

LLVM IR (-O0):
define void @dir_list(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 = load i8*, i8** %4
%7 = call i32 @fs_path_op(i8* %5, i8* null, i8* %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @dir_list(i8* %0, i8* %1) {
%3 = tail call i32 @fs_path_op(i8* %0, i8* null, i8* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_number_to_buffer(void *, unsigned int, int);
void write_word_to_buffer(void *buffer, unsigned number) {
  write_number_to_buffer(buffer, number, 4);
}


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

x86 assembly (clang, -O2):
<write_word_to_buffer>:
mov    $0x4,%edx
jmp    1030 <write_number_to_buffer@plt>

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

LLVM IR (-O2):
define void @write_word_to_buffer(i8* %0, i32 %1) {
%3 = tail call i32 @write_number_to_buffer(i8* %0, i32 %1, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintUsage(char *argv0) {
  printf("Test Client Usage:\n");
  printf("%s [StrGetLength|StrCopy|StrCompare|StrSearch|StrConcat|"
         "\n",
         argv0);
}


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

x86 assembly (clang, -O2):
<PrintUsage>:
push   %rbx
mov    %rdi,%rbx
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Test Client Usage:\0A\00"
@.str.1 = [58 x i8] c"%s [StrGetLength|StrCopy|StrCompare|StrSearch|StrConcat|\0A\00"
define void @PrintUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str.1 = [58 x i8] c"%s [StrGetLength|StrCopy|StrCompare|StrSearch|StrConcat|\0A\00"
@str = [19 x i8] c"Test Client Usage:\00"
define void @PrintUsage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}