xunge/DecIR huggingface dataset:
/* Type definitions */
struct usb_hcd {
  int dummy;
};

/* Variables and functions */
int xen_dbgp_external_startup(struct usb_hcd *);
int dbgp_external_startup(struct usb_hcd *hcd) {
  return xen_dbgp_external_startup(hcd);
}


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

x86 assembly (clang, -O2):
<dbgp_external_startup>:
jmp    1030 <xen_dbgp_external_startup@plt>

LLVM IR (-O0):
%struct.usb_hcd = type { i32 }
define i32 @dbgp_external_startup(%struct.usb_hcd* %0) {
%2 = alloca %struct.usb_hcd*
store %struct.usb_hcd* %0, %struct.usb_hcd** %2
%3 = load %struct.usb_hcd*, %struct.usb_hcd** %2
%4 = call i32 @xen_dbgp_external_startup(%struct.usb_hcd* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.usb_hcd = type { i32 }
define i32 @dbgp_external_startup(%struct.usb_hcd* %0) {
%2 = tail call i32 @xen_dbgp_external_startup(%struct.usb_hcd* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
double newtons_method(double const, int const);
int /*<<< orphan*/ stderr;
int main(void) {
  const int ITERATIONS = 7;
  const double INITIAL_GUESS = -0.7;
  double root;
  root = newtons_method(INITIAL_GUESS, ITERATIONS);
  fprintf(stderr, "%.8f\n", root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb5(%rip),%xmm0
mov    $0x7,%edi
call   1030 <newtons_method@plt>
movsd  %xmm0,-0x18(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
movsd  -0x18(%rbp),%xmm0
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x7,%edi
call   1030 <newtons_method@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%.8f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store i32 7, i32* %2
store double 0xBFE6666666666666, double* %3
%5 = call double @newtons_method(double 0xBFE6666666666666, i32 7)
store double %5, double* %4
%6 = load i32, i32* @stderr
%7 = load double, double* %4
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%.8f\0A\00"
define i32 @main() {
%1 = tail call double @newtons_method(double 0xBFE6666666666666, i32 7)
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printMessage();
int main(void) {
  printMessage();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printMessage()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rotr(int *, int *, int *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int first, second, third;
  scanf("%d %d %d", &first, &second, &third);
  rotr(&first, &second, &third);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <rotr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rbx
lea    0x8(%rsp),%r14
lea    0x4(%rsp),%r15
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <rotr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = call i32 @rotr(i32* %1, i32* %2, i32* %3)
ret i32 0
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int matedialogPresent(void) {
  static int lMatedialogPresent = -1;
  if (lMatedialogPresent < 0) {
    lMatedialogPresent = detectPresence("matedialog");
  }
  return lMatedialogPresent && graphicMode();
}


x86 assembly (clang, -O0):
<matedialogPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <matedialogPresent+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 <matedialogPresent+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):
<matedialogPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <matedialogPresent+0x23>
test   %eax,%eax
je     1159 <matedialogPresent+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 <matedialogPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@matedialogPresent.lMatedialogPresent = internal global i32 -1
@.str = [11 x i8] c"matedialog\00"
define i32 @matedialogPresent() {
%1 = load i32, i32* @matedialogPresent.lMatedialogPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @matedialogPresent.lMatedialogPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @matedialogPresent.lMatedialogPresent
%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):
@matedialogPresent.lMatedialogPresent = internal unnamed_addr global i32 -1
@.str = [11 x i8] c"matedialog\00"
define i32 @matedialogPresent() {
%1 = load i32, i32* @matedialogPresent.lMatedialogPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @matedialogPresent.lMatedialogPresent
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
}
int rtl838x_mac_force_mode_ctrl(int p) { return (0xa104) + (p << 2); }


x86 assembly (clang, -O0):
<rtl838x_mac_force_mode_ctrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0xa104,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl838x_mac_force_mode_ctrl>:
lea    0xa104(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @rtl838x_mac_force_mode_ctrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 2
%5 = add nsw i32 41220, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @rtl838x_mac_force_mode_ctrl(i32 %0) {
%2 = shl i32 %0, 2
%3 = add nsw i32 %2, 41220
ret i32 %3
}
int foo2(int **a, int *b, int *c) {
  return __sync_bool_compare_and_swap(a, b, c);
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
mov    %rax,%rcx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
mov    %rsi,%rax
xor    %ecx,%ecx
lock cmpxchg %rdx,(%rdi)
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo2(i32** %0, i32* %1, i32* %2) {
%4 = alloca i32**
%5 = alloca i32*
%6 = alloca i32*
store i32** %0, i32*** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32**, i32*** %4
%8 = bitcast i32** %7 to i64*
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = cmpxchg i64* %8, i64 %10, i64 %12 seq_cst seq_cst
%14 = extractvalue { i64, i1 } %13, 1
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @foo2(i32** nocapture %0, i32* %1, i32* %2) {
%4 = bitcast i32** %0 to i64*
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = cmpxchg i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
decll(ps) char *ps;
{ brcstr(ps, 'q'); }


x86 assembly (clang, -O0):
<decll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x71,%esi
mov    $0x0,%al
call   1030 <brcstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decll>:
mov    $0x71,%esi
xor    %eax,%eax
jmp    1030 <brcstr@plt>

LLVM IR (-O0):
define i32 @decll(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @brcstr to i32 (i8*, i32, ...)*)(i8* %4, i32 113)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @decll(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @brcstr to i32 (i8*, i32, ...)*)(i8* %0, i32 113)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _HibernateCalendarSet(int, struct tm *);
void HibernateCalendarMatchSet(uint32_t ui32Index, struct tm *psTime) {
  _HibernateCalendarSet(0x400FC330, psTime);
}


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

x86 assembly (clang, -O2):
<HibernateCalendarMatchSet>:
mov    $0x400fc330,%edi
jmp    1030 <_HibernateCalendarSet@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @HibernateCalendarMatchSet(i32 %0, %struct.tm* %1) {
%3 = alloca i32
%4 = alloca %struct.tm*
store i32 %0, i32* %3
store %struct.tm* %1, %struct.tm** %4
%5 = load %struct.tm*, %struct.tm** %4
%6 = call i32 @_HibernateCalendarSet(i32 1074774832, %struct.tm* %5)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @HibernateCalendarMatchSet(i32 %0, %struct.tm* %1) {
%3 = tail call i32 @_HibernateCalendarSet(i32 1074774832, %struct.tm* %1)
ret void
}
/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
void good_echo(void) {
  char buf[12];
  while (1) {
    char *p = fgets(buf, 12, stdin);
    if (p == NULL) {
      break;
    }
    printf("%s", p);
  }
  return;
}


x86 assembly (clang, -O0):
<good_echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xc(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    $0xc,%esi
call   1040 <fgets@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <good_echo+0x33>
jmp    1168 <good_echo+0x48>
mov    -0x18(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1128 <good_echo+0x8>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_echo>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0x4(%rsp),%rdi
mov    $0xc,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1180 <good_echo+0x60>
lea    0xeb2(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    1160 <good_echo+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%s\00"
define void @good_echo() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i8* @fgets(i8* %2, i32 12, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i8* [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stdin
%10 = call i8* @fgets(i8* %2, i32 12, i32 %9)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr, "usage: %s [--32] [--64] [--key <key>] data\n", progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [--32] [--64] [--key <key>] data\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [--32] [--64] [--key <key>] data\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int f302(int *);
int f303(int *p) { return f302(p); }


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

x86 assembly (clang, -O2):
<f303>:
jmp    1030 <f302@plt>

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

LLVM IR (-O2):
define i32 @f303(i32* %0) {
%2 = tail call i32 @f302(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strsep(char *, char);
int isM(char *str) {
  if ((str[0] == ',')) {
    strsep(str, ',');
  }
}


x86 assembly (clang, -O0):
<isM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    113a <isM+0x2a>
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strsep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isM>:
push   %rax
cmpb   $0x2c,(%rdi)
jne    1120 <isM+0x10>
mov    $0x2c,%esi
call   1030 <strsep@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isM(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 44
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @strsep(i8* %0, i8 signext 44)
br label %6
6: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ fmt_u32_hex(char *, int /*<<< orphan*/);
int /*<<< orphan*/ print(char *, int);
void print_u32_hex(uint32_t val) {
  char buf[8];
  fmt_u32_hex(buf, val);
  print(buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<print_u32_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <fmt_u32_hex@plt>
lea    -0xc(%rbp),%rdi
mov    $0x8,%esi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_u32_hex>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%esi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <fmt_u32_hex@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <print@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @print_u32_hex(i32 %0) {
%2 = alloca i32
%3 = alloca [8 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @fmt_u32_hex(i8* %4, i32 %5)
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%8 = call i32 @print(i8* %7, i32 8)
ret void
}

LLVM IR (-O2):
define void @print_u32_hex(i32 %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @fmt_u32_hex(i8* %3, i32 %0)
%5 = call i32 @print(i8* %3, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char **argv) {
  printf("char *build_target_id = \"%s USEX_VERSION %s\";\n", "UNKNOWN",
         "1.9-23");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xeec(%rip),%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf00(%rip),%rsi
lea    0xf01(%rip),%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"char *build_target_id = \22%s USEX_VERSION %s\22;\0A\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
@.str.2 = [7 x i8] c"1.9-23\00"
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 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [47 x i8] c"char *build_target_id = \22%s USEX_VERSION %s\22;\0A\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
@.str.2 = [7 x i8] c"1.9-23\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_lerp(float *, float *, float *, float);
__attribute__((always_)) struct vec2 *
psvec2_lerp(struct vec2 *result, struct vec2 *a, struct vec2 *b, float p) {
  vec2_lerp((float *)result, (float *)a, (float *)b, p);
  return result;
}


x86 assembly (clang, -O0):
<psvec2_lerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movss  -0x1c(%rbp),%xmm0
call   1030 <vec2_lerp@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2_lerp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_lerp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_lerp(%struct.vec2* %0, %struct.vec2* %1, %struct.vec2* %2, float %3) {
%5 = alloca %struct.vec2*
%6 = alloca %struct.vec2*
%7 = alloca %struct.vec2*
%8 = alloca float
store %struct.vec2* %0, %struct.vec2** %5
store %struct.vec2* %1, %struct.vec2** %6
store %struct.vec2* %2, %struct.vec2** %7
store float %3, float* %8
%9 = load %struct.vec2*, %struct.vec2** %5
%10 = bitcast %struct.vec2* %9 to float*
%11 = load %struct.vec2*, %struct.vec2** %6
%12 = bitcast %struct.vec2* %11 to float*
%13 = load %struct.vec2*, %struct.vec2** %7
%14 = bitcast %struct.vec2* %13 to float*
%15 = load float, float* %8
%16 = call i32 @vec2_lerp(float* %10, float* %12, float* %14, float %15)
%17 = load %struct.vec2*, %struct.vec2** %5
ret %struct.vec2* %17
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_lerp(%struct.vec2* returned %0, %struct.vec2* %1, %struct.vec2* %2, float %3) {
%5 = bitcast %struct.vec2* %0 to float*
%6 = bitcast %struct.vec2* %1 to float*
%7 = bitcast %struct.vec2* %2 to float*
%8 = tail call i32 @vec2_lerp(float* %5, float* %6, float* %7, float %3)
ret %struct.vec2* %0
}
/* Variables and functions */
int backup_sync_msg(int, int, int, int, void *);
int Backup_write(int subsystem_id, int id, void *addr) {
  return backup_sync_msg(8, 3, subsystem_id, id, addr);
}


x86 assembly (clang, -O0):
<Backup_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    $0x8,%edi
mov    $0x3,%esi
call   1030 <backup_sync_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Backup_write>:
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x8,%edi
mov    $0x3,%esi
jmp    1030 <backup_sync_msg@plt>

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

LLVM IR (-O2):
define i32 @Backup_write(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @backup_sync_msg(i32 8, i32 3, i32 %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
int /*<<< orphan*/ sum(short *, short *, int);
int main() {
  short Array[2];
  short Sum = 0;
  int i;
  for (i = 0; i != 2; ++i)
    Array[i] = i;
  sum(&Sum, Array, 2);
  printf("Sum is %d\n", Sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x0,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
je     1163 <main+0x43>
mov    -0x10(%rbp),%eax
mov    %ax,%cx
movslq -0x10(%rbp),%rax
mov    %cx,-0x8(%rbp,%rax,2)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <main+0x1c>
lea    -0x8(%rbp),%rsi
lea    -0xa(%rbp),%rdi
mov    $0x2,%edx
call   1040 <sum@plt>
lea    0xe84(%rip),%rdi
movswl -0xa(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x0,0x2(%rsp)
movl   $0x10000,0x4(%rsp)
lea    0x2(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1040 <sum@plt>
movswl 0x2(%rsp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Sum is %d\0A\00"
define i32 @main() {
%1 = alloca [2 x i16]
%2 = alloca i16
%3 = bitcast [2 x i16]* %1 to i8*
%4 = bitcast i16* %2 to i8*
store i16 0, i16* %2
%5 = getelementptr inbounds [2 x i16], [2 x i16]* %1, i64 0, i64 0
store i16 0, i16* %5
%6 = getelementptr inbounds [2 x i16], [2 x i16]* %1, i64 0, i64 1
store i16 1, i16* %6
%7 = call i32 @sum(i16* %2, i16* %5, i32 2)
%8 = load i16, i16* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 signext %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ shutdown();
void sigterm_handler(int signum) { shutdown(); }


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

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

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

LLVM IR (-O2):
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 (...) @shutdown()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_OutputSyntaxArgumentMustBindToOutParameter(long p_position) {
  _Error(p_position, "'output' syntax argument must bind to out parameter");
}


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

x86 assembly (clang, -O2):
<Error_OutputSyntaxArgumentMustBindToOutParameter>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"'output' syntax argument must bind to out parameter\00"
define void @Error_OutputSyntaxArgumentMustBindToOutParameter(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"'output' syntax argument must bind to out parameter\00"
define void @Error_OutputSyntaxArgumentMustBindToOutParameter(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}
void assign(void) {
  unsigned x = 0;
  x += 2;
  x -= 2;
  x *= 2;
  x /= 2;
  x %= 2;
  x &= 2;
  x |= 2;
  x ^= 2;
  x <<= 2;
  x >>= 2;
}


x86 assembly (clang, -O0):
<assign>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @assign() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add i32 %2, 2
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sub i32 %4, 2
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = mul i32 %6, 2
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = udiv i32 %8, 2
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = urem i32 %10, 2
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = and i32 %12, 2
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = or i32 %14, 2
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = xor i32 %16, 2
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = shl i32 %18, 2
store i32 %19, i32* %1
%20 = load i32, i32* %1
%21 = lshr i32 %20, 2
store i32 %21, i32* %1
ret void
}

LLVM IR (-O2):
define void @assign() {
ret void
}
void INT_Excep_AD1_ADI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_AD1_ADI1() {
ret void
}
void write_xattr(char *pathname, unsigned int xattr) {}


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

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

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

LLVM IR (-O2):
define void @write_xattr(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: hostap_rid <device> <get/set> <rid id> [data]\n"
         "\n"
         "Examples:\n"
         "   hostap_rid wlan0 get fc00\n"
         "   hostap_rid wlan0 set fc00 06 00\n"
         "   hostap_rid wlan0 set fc0e 06 00 66 6f 6f 62 61 72\n"
         "\n"
         "Note:\n"
         "- Prism2/2.5/3 uses little-endian byte order\n"
         "- The most common word size is 16 bits\n"
         "- Set command needs the raw RID contents, i.e., it will be "
         "written as is to the device\n");
}


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

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

LLVM IR (-O0):
@.str = [360 x i8] c"Usage: hostap_rid <device> <get/set> <rid id> [data]\0A\0AExamples:\0A hostap_rid wlan0 get fc00\0A hostap_rid wlan0 set fc00 06 00\0A hostap_rid wlan0 set fc0e 06 00 66 6f 6f 62 61 72\0A\0ANote:\0A- Prism2/2.5/3 uses little-endian byte order\0A- The most common word size is 16 bits\0A- Set command needs the raw RID contents, i.e., it will be written as is to the device\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([360 x i8], [360 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [359 x i8] c"Usage: hostap_rid <device> <get/set> <rid id> [data]\0A\0AExamples:\0A hostap_rid wlan0 get fc00\0A hostap_rid wlan0 set fc00 06 00\0A hostap_rid wlan0 set fc0e 06 00 66 6f 6f 62 61 72\0A\0ANote:\0A- Prism2/2.5/3 uses little-endian byte order\0A- The most common word size is 16 bits\0A- Set command needs the raw RID contents, i.e., it will be written as is to the device\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([359 x i8], [359 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

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


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

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

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

LLVM IR (-O2):
define i32 @ip_get_len(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ cli_fatal(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int open(char const *, int, int);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void cli_file_open(const char *fpath, int flags, int *fd) {
  if ((*fd = open(fpath, flags, 0755)) == -1)
    cli_fatal("cli_file_open(%s): %s", fpath, strerror(errno));
}


x86 assembly (clang, -O0):
<cli_file_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1ed,%edx
call   1040 <open@plt>
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0xffffffff,%eax
jne    118b <cli_file_open+0x5b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe7a(%rip),%rdi
call   1030 <cli_fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_file_open>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    $0x1ed,%edx
call   1040 <open@plt>
mov    %eax,(%rbx)
cmp    $0xffffffff,%eax
je     1153 <cli_file_open+0x23>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe98(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <cli_fatal@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"cli_file_open(%s): %s\00"
@errno = global i32 0
define void @cli_file_open(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @open(i8* %7, i32 %8, i32 493)
%10 = load i32*, i32** %6
store i32 %9, i32* %10
%11 = icmp eq i32 %9, -1
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = load i32, i32* @errno
%15 = call i32 @strerror(i32 %14)
%16 = call i32 @cli_fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %15)
br label %17
17: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"cli_file_open(%s): %s\00"
@errno = global i32 0
define void @cli_file_open(i8* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 493)
store i32 %4, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @cli_fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8)
br label %10
10: ; preds = %6, %3
ret void
}
/* Variables and functions */
float GeometrySchlick(float, float, float);
float Geometry(float roughness, float NdotH, float NdotV, float NdotL,
               float VdotH) {
  return GeometrySchlick(NdotL, NdotV, roughness);
}


x86 assembly (clang, -O0):
<Geometry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
call   1030 <GeometrySchlick@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Geometry>:
movaps %xmm2,%xmm1
movaps %xmm0,%xmm2
movaps %xmm3,%xmm0
jmp    1030 <GeometrySchlick@plt>

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

LLVM IR (-O2):
define float @Geometry(float %0, float %1, float %2, float %3, float %4) {
%6 = tail call float @GeometrySchlick(float %3, float %2, float %0)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ handleError(int /*<<< orphan*/, char *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void unlock(pthread_mutex_t *mutex) {
  handleError(pthread_mutex_unlock(mutex),
              "Error occured during unlocking mutex.\n");
}


x86 assembly (clang, -O0):
<unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %eax,%edi
lea    0xec2(%rip),%rsi
call   1040 <handleError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlock>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
lea    0xed3(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1040 <handleError@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Error occured during unlocking mutex.\0A\00"
define void @unlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @pthread_mutex_unlock(i32* %3)
%5 = call i32 @handleError(i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Error occured during unlocking mutex.\0A\00"
define void @unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = tail call i32 @handleError(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
void strcats(char *s, char *t) {
  while (*s++ != '\0')
    ;
  while ((*s++ = *t++) != '\0')
    ;
}


x86 assembly (clang, -O0):
<strcats>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112c <strcats+0x2c>
jmp    110c <strcats+0xc>
jmp    1131 <strcats+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1164 <strcats+0x64>
jmp    1131 <strcats+0x31>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcats>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcats>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcats+0x10>
ret

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

LLVM IR (-O2):
define void @strcats(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %5, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void def_xfree(void *p) {
  if (!p)
    return;
  free(p);
}


x86 assembly (clang, -O0):
<def_xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <def_xfree+0x1c>
jmp    1135 <def_xfree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_xfree>:
test   %rdi,%rdi
je     111a <def_xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @def_xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @def_xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
void free_long_matrix(long **m, long nrl, long ncl) {
  free((m[nrl] + ncl - 1));
  free((m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_long_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_long_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rdx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_long_matrix(i64** %0, i64 %1, i64 %2) {
%4 = alloca i64**
%5 = alloca i64
%6 = alloca i64
store i64** %0, i64*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64**, i64*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i64*, i64** %7, i64 %8
%10 = load i64*, i64** %9
%11 = load i64, i64* %6
%12 = getelementptr inbounds i64, i64* %10, i64 %11
%13 = getelementptr inbounds i64, i64* %12, i64 -1
%14 = bitcast i64* %13 to i8*
%15 = load i64**, i64*** %4
%16 = load i64, i64* %5
%17 = getelementptr inbounds i64*, i64** %15, i64 %16
%18 = getelementptr inbounds i64*, i64** %17, i64 -1
%19 = bitcast i64** %18 to i8*
ret void
}

LLVM IR (-O2):
define void @free_long_matrix(i64** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64*, i64** %0, i64 %1
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 %2
%7 = getelementptr inbounds i64, i64* %6, i64 -1
%8 = bitcast i64* %7 to i8*
tail call void @free(i8* %8)
%9 = getelementptr inbounds i64*, i64** %4, i64 -1
%10 = bitcast i64** %9 to i8*
tail call void @free(i8* %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
size_t lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
size_t fileLen(int f) {
  size_t r;
  r = lseek(f, 0, SEEK_END);
  lseek(f, 0, SEEK_SET);
  return r;
}


x86 assembly (clang, -O0):
<fileLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileLen>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecb(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,%r14
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fileLen(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SEEK_END
%6 = call i64 @lseek(i32 %4, i32 0, i32 %5)
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @SEEK_SET
%9 = call i64 @lseek(i32 %7, i32 0, i32 %8)
%10 = load i64, i64* %3
ret i64 %10
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fileLen(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i64 @lseek(i32 %0, i32 0, i32 %2)
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @lseek(i32 %0, i32 0, i32 %4)
ret i64 %3
}
/* Variables and functions */
double vector_magnitude_2d(double *);
int /*<<< orphan*/ vector_sub_nd(double const *, double const *, int, double *);
double vector_dist_2d(const double v1[2], const double v2[2]) {
  double v[2];
  vector_sub_nd(v1, v2, 2, v);
  return vector_magnitude_2d(v);
}


x86 assembly (clang, -O0):
<vector_dist_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rcx
mov    $0x2,%edx
call   1040 <vector_sub_nd@plt>
lea    -0x20(%rbp),%rdi
call   1030 <vector_magnitude_2d@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_dist_2d>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    $0x2,%edx
mov    %rbx,%rcx
call   1040 <vector_sub_nd@plt>
mov    %rbx,%rdi
call   1030 <vector_magnitude_2d@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @vector_dist_2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [2 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%9 = call i32 @vector_sub_nd(double* %6, double* %7, i32 2, double* %8)
%10 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%11 = call double @vector_magnitude_2d(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @vector_dist_2d(double* %0, double* %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%6 = call i32 @vector_sub_nd(double* %0, double* %1, i32 2, double* %5)
%7 = call double @vector_magnitude_2d(double* %5)
ret double %7
}