xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ clearLCDLine(int);
int /*<<< orphan*/ displayLCDString(int, int /*<<< orphan*/, char *);
void displayEnterString(int line) {
  clearLCDLine(line);
  displayLCDString(line, 0, "<     Enter    >");
}


x86 assembly (clang, -O0):
<displayEnterString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <clearLCDLine@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
lea    0xec1(%rip),%rdx
call   1040 <displayLCDString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayEnterString>:
push   %rbx
mov    %edi,%ebx
call   1030 <clearLCDLine@plt>
lea    0xed1(%rip),%rdx
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <displayLCDString@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"< Enter >\00"
define void @displayEnterString(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @clearLCDLine(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @displayLCDString(i32 %5, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"< Enter >\00"
define void @displayEnterString(i32 %0) {
%2 = tail call i32 @clearLCDLine(i32 %0)
%3 = tail call i32 @displayLCDString(i32 %0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long quot;
  long rem;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
ldiv_t ldiv(long int numer, long int denom) {
  ldiv_t res;
  res.quot = numer / denom;
  res.rem = numer % denom;
  return res;
}


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

x86 assembly (clang, -O2):
<ldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <ldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @ldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
void av_bitstream_filter_next() {}


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

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

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

LLVM IR (-O2):
define void @av_bitstream_filter_next() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_file(char *);
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; ++i) {
    dump_file(argv[i]);
  }
  return 0;
}


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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <dump_file@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <dump_file@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @dump_file(i8* %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 i32 0
}
void testVLAwithSize(int s) {
  int vla[s];
  int i;
  for (i = 0; i < s; i++) {
    vla[i] = i * i;
  }
}


x86 assembly (clang, -O0):
<testVLAwithSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <testVLAwithSize+0x65>
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%edx
imul   -0x1c(%rbp),%edx
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1139 <testVLAwithSize+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testVLAwithSize(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i32, i64 %7
store i64 %7, i64* %4
store i32 0, i32* %5
br label %10
10: ; preds = %21, %1
%11 = load i32, i32* %5
%12 = load i32, i32* %2
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = mul nsw i32 %15, %16
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %9, i64 %19
store i32 %17, i32* %20
br label %21
21: ; preds = %14
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %10
24: ; preds = %10
%25 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @testVLAwithSize(i32 %0) {
ret void
}
/* Variables and functions */
int write_all(int, char *, int);
int eof_ui_deregister(int sockfd) {
  if (write_all(sockfd, "2101", 4) != 4) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<eof_ui_deregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x4,%edx
call   1030 <write_all@plt>
cmp    $0x4,%eax
je     1144 <eof_ui_deregister+0x34>
movl   $0x0,-0x4(%rbp)
jmp    114b <eof_ui_deregister+0x3b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eof_ui_deregister>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edx
call   1030 <write_all@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"2101\00"
define i32 @eof_ui_deregister(i32 %0) {
%2 = tail call i32 @write_all(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void cleanScreen() { system("cls"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
define void @cleanScreen() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct dhcpmsg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_option_string(struct dhcpmsg *, int, char const *const,
                                     size_t);
void add_option_clientid(struct dhcpmsg *packet, const char *const clientid,
                         size_t clen) {
  add_option_string(packet, 0x3d, clientid, clen);
}


x86 assembly (clang, -O0):
<add_option_clientid>:
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),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x3d,%esi
call   1030 <add_option_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_option_clientid>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x3d,%esi
jmp    1030 <add_option_string@plt>

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

LLVM IR (-O2):
%struct.dhcpmsg = type { i32 }
define void @add_option_clientid(%struct.dhcpmsg* %0, i8* %1, i64 %2) {
%4 = tail call i32 @add_option_string(%struct.dhcpmsg* %0, i32 61, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void clear_pin(volatile uint8_t *port, uint8_t bit_i) {
  *port &= ~(1 << bit_i);
}


x86 assembly (clang, -O0):
<clear_pin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_pin>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clear_pin(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load volatile i32, i32* %8
%10 = and i32 %9, %7
store volatile i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @clear_pin(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* %0
%6 = and i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Variables and functions */
int testrados();
int main(int argc, const char **argv) { return testrados(); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @testrados()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testrados()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DisplayUsage();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void DisplayInvalidParameter(char *param) {
  fprintf(stderr, "ll2cr: Parameter %s is invalid.\n", param);
  DisplayUsage();
}


x86 assembly (clang, -O0):
<DisplayInvalidParameter>:
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    $0x0,%al
call   1040 <DisplayUsage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DisplayInvalidParameter>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <DisplayUsage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"ll2cr: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(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 ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @DisplayUsage()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"ll2cr: Parameter %s is invalid.\0A\00"
define void @DisplayInvalidParameter(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @DisplayUsage()
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ clip2(scalar_t__, int /*<<< orphan*/, int);
uint8_t clip(int32_t v) { return ((uint8_t)v) == v ? v : clip2(v, 0, 255); }


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    1137 <clip+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    114b <clip+0x3b>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1030 <clip2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @clip(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* %2
br label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i64 @clip2(i64 %9, i32 0, i32 255)
br label %11
11: ; preds = %8, %6
%12 = phi i64 [ %7, %6 ], [ %10, %8 ]
ret i64 %12
}

LLVM IR (-O2):
define i64 @clip(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t refcount_diff(uint64_t r1, uint64_t r2) {
  return r1 > r2 ? r1 - r2 : r2 - r1;
}


x86 assembly (clang, -O0):
<refcount_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    112b <refcount_diff+0x2b>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <refcount_diff+0x37>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<refcount_diff>:
mov    %rdi,%rax
sub    %rsi,%rax
neg    %rax
sub    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @refcount_diff(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 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sub nsw i64 %9, %10
br label %16
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %3
%15 = sub nsw i64 %13, %14
br label %16
16: ; preds = %12, %8
%17 = phi i64 [ %11, %8 ], [ %15, %12 ]
ret i64 %17
}

LLVM IR (-O2):
define i64 @refcount_diff(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = sub nsw i64 %0, %1
%5 = sub nsw i64 %1, %0
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int nepim_str_split_plus(char *, int, char **);
int addr_split_sourcegroup(char *buf, int buf_size, char **group) {
  return nepim_str_split_plus(buf, buf_size, group);
}


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

x86 assembly (clang, -O2):
<addr_split_sourcegroup>:
jmp    1030 <nepim_str_split_plus@plt>

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

LLVM IR (-O2):
define i32 @addr_split_sourcegroup(i8* %0, i32 %1, i8** %2) {
%4 = tail call i32 @nepim_str_split_plus(i8* %0, i32 %1, i8** %2)
ret i32 %4
}
/* Type definitions */
struct fb_cmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOPUTCMAP;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_cmap *);
int /*<<< orphan*/ print_strerror_and_exit(char *);
void tfbm_put_cmap(int fh, struct fb_cmap *cmap) {
  if (ioctl(fh, FBIOPUTCMAP, cmap)) {
    print_strerror_and_exit("ioctl FBIOPUTCMAP");
  }
}


x86 assembly (clang, -O0):
<tfbm_put_cmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
je     115a <tfbm_put_cmap+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <print_strerror_and_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tfbm_put_cmap>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1040 <ioctl@plt>
test   %rax,%rax
je     1144 <tfbm_put_cmap+0x24>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <print_strerror_and_exit@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.fb_cmap = type { i32 }
@FBIOPUTCMAP = global i32 0
@.str = [18 x i8] c"ioctl FBIOPUTCMAP\00"
define void @tfbm_put_cmap(i32 %0, %struct.fb_cmap* %1) {
%3 = alloca i32
%4 = alloca %struct.fb_cmap*
store i32 %0, i32* %3
store %struct.fb_cmap* %1, %struct.fb_cmap** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @FBIOPUTCMAP
%7 = load %struct.fb_cmap*, %struct.fb_cmap** %4
%8 = call i64 @ioctl(i32 %5, i32 %6, %struct.fb_cmap* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.fb_cmap = type { i32 }
@FBIOPUTCMAP = global i32 0
@.str = [18 x i8] c"ioctl FBIOPUTCMAP\00"
define void @tfbm_put_cmap(i32 %0, %struct.fb_cmap* %1) {
%3 = load i32, i32* @FBIOPUTCMAP
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_cmap* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @print_strerror_and_exit(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
void gtk_text_buffer_insert_interactive_at_cursor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_insert_interactive_at_cursor() {
ret void
}
void bootblock_cpu_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bootblock_cpu_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void CCP4_fatal(const char *message) {
  printf(" PROGRAM:%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<CCP4_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [13 x i8] c" PROGRAM:%s\0A\00"
define void @CCP4_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c" PROGRAM:%s\0A\00"
define void @CCP4_fatal(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _usage(char *const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ stderr;
void _usage_invalid_opt(int opt, char *const *argv) {
  fprintf(stderr, "Unrecognized option: -%c\n", (char)opt);
  _usage(argv);
}


x86 assembly (clang, -O0):
<_usage_invalid_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%eax
lea    0xebe(%rip),%rsi
movsbl %al,%edx
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <_usage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage_invalid_opt>:
push   %rbx
mov    %rsi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
movsbl %dil,%edx
lea    0xec8(%rip),%rsi
mov    %eax,%edi
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <_usage@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Unrecognized option: -%c\0A\00"
define void @_usage_invalid_opt(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = load i8**, i8*** %4
%10 = call i32 @_usage(i8** %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Unrecognized option: -%c\0A\00"
define void @_usage_invalid_opt(i32 %0, i8** %1) {
%3 = load i32, i32* @stderr
%4 = trunc i32 %0 to i8
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = tail call i32 @_usage(i8** %1)
ret void
}
void test_invalid_clause() {
  int i;
#pragma omp parallel
#pragma omp for foo bar
  for (i = 0; i < 16; ++i)
    ;
#pragma omp for num_teams(3)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp for uniform
  for (i = 0; i < 16; ++i)
    ;
#pragma omp for if (0)
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_invalid_clause+0x4c>
jmp    113e <test_invalid_clause+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_invalid_clause+0x2f>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1170 <test_invalid_clause+0x70>
jmp    1162 <test_invalid_clause+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <test_invalid_clause+0x53>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1194 <test_invalid_clause+0x94>
jmp    1186 <test_invalid_clause+0x86>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <test_invalid_clause+0x77>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void time_2(void) {
  time_t now;
  time(&now);
  printf("It is now %s\n", ctime(&now));
}


x86 assembly (clang, -O0):
<time_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1050 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_2>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
lea    0xeaf(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"It is now %s\0A\00"
define void @time_2() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call i8* @ctime(i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"It is now %s\0A\00"
define void @time_2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ euclide(int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
int /*<<< orphan*/ mod8(int /*<<< orphan*/, int);
uint8_t inverse(uint8_t b) {
  if (!b)
    return 0;
  uint32_t a;
  uint32_t c;
  euclide(b, (0x011B), &a, &c);
  return mod8(a, (0x011B));
}


x86 assembly (clang, -O0):
<inverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <inverse+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1166 <inverse+0x46>
mov    -0x8(%rbp),%edi
mov    $0x11b,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <euclide@plt>
mov    -0xc(%rbp),%edi
mov    $0x11b,%esi
call   1040 <mod8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse>:
test   %edi,%edi
je     1149 <inverse+0x29>
push   %rax
mov    %rsp,%rdx
lea    0x4(%rsp),%rcx
mov    $0x11b,%esi
call   1030 <euclide@plt>
mov    (%rsp),%edi
mov    $0x11b,%esi
call   1040 <mod8@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @inverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %1
store i32 0, i32* %2
br label %14
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 @euclide(i32 %10, i32 283, i32* %4, i32* %5)
%12 = load i32, i32* %4
%13 = call i32 @mod8(i32 %12, i32 283)
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @inverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = icmp eq i32 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i32 @euclide(i32 %0, i32 283, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = call i32 @mod8(i32 %9, i32 283)
br label %11
11: ; preds = %1, %5
%12 = phi i32 [ %10, %5 ], [ 0, %1 ]
ret i32 %12
}
void n2t(double *x, double *x1, double *x2, double *x3, int i) {
  x[0] = x1[i];
  x[1] = x2[i];
  x[2] = x3[i];
}


x86 assembly (clang, -O0):
<n2t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<n2t>:
movslq %r8d,%rax
movsd  (%rsi,%rax,8),%xmm0
movsd  %xmm0,(%rdi)
movsd  (%rdx,%rax,8),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @n2t(double* %0, double* %1, double* %2, double* %3, i32 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double*, double** %7
%12 = load i32, i32* %10
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %6
%17 = getelementptr inbounds double, double* %16, i64 0
store double %15, double* %17
%18 = load double*, double** %8
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
%22 = load double, double* %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %9
%26 = load i32, i32* %10
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %25, i64 %27
%29 = load double, double* %28
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 2
store double %29, double* %31
ret void
}

LLVM IR (-O2):
define void @n2t(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2, double* nocapture %3, i32 %4) {
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds double, double* %1, i64 %6
%8 = load double, double* %7
store double %8, double* %0
%9 = getelementptr inbounds double, double* %2, i64 %6
%10 = load double, double* %9
%11 = getelementptr inbounds double, double* %0, i64 1
store double %10, double* %11
%12 = getelementptr inbounds double, double* %3, i64 %6
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %0, i64 2
store double %13, double* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGSEGV;
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
main() {
  void my_segv_handler(int);
  int *y;
  printf("main: %d\n", getpid());
  signal(SIGSEGV, my_segv_handler);
  *y = 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    0x2e9b(%rip),%rsi
call   1050 <signal@plt>
mov    -0x8(%rbp),%rax
movl   $0x5,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rsi
call   1050 <signal@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"main: %d\0A\00"
@SIGSEGV = global i32 0
define i32 @main() {
%1 = alloca i32*
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @SIGSEGV
%5 = call i32 @signal(i32 %4, void (i32)* @my_segv_handler)
%6 = load i32*, i32** %1
store i32 5, i32* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"main: %d\0A\00"
@SIGSEGV = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @SIGSEGV
%4 = tail call i32 @signal(i32 %3, void (i32)* @my_segv_handler)
unreachable
}
void do_child(int do_recursion) {
  int nr_thrs;
  nr_thrs = 1;
  if (do_recursion) {
    printf("%s: pid %d creating thread\n", __FUNCTION__, getpid());
    create_threads(nr_thrs, !do_recursion);
  }
}


x86 assembly (clang, -O0):
<do_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1182 <do_child+0x52>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%edx
lea    0xea4(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
mov    $0x0,%al
call   1030 <create_threads@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_child>:
test   %edi,%edi
je     1162 <do_child+0x32>
push   %rax
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xebd(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <create_threads@plt>
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%s: pid %d creating thread\0A\00"
@__FUNCTION__.do_child = [9 x i8] c"do_child\00"
define void @do_child(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = call i32 (...) @getpid()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.do_child, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
%14 = call i32 (i32, i32, ...) bitcast (i32 (...)* @create_threads to i32 (i32, i32, ...)*)(i32 %9, i32 %13)
br label %15
15: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s: pid %d creating thread\0A\00"
@__FUNCTION__.do_child = [9 x i8] c"do_child\00"
define void @do_child(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.do_child, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @create_threads to i32 (i32, i32, ...)*)(i32 1, i32 0)
br label %7
7: ; preds = %3, %1
ret void
}
void class_dtor_empty(struct vm *vm, struct object *obj) {}


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

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

LLVM IR (-O0):
%struct.vm = type opaque
%struct.object = type opaque
define void @class_dtor_empty(%struct.vm* %0, %struct.object* %1) {
%3 = alloca %struct.vm*
%4 = alloca %struct.object*
store %struct.vm* %0, %struct.vm** %3
store %struct.object* %1, %struct.object** %4
ret void
}

LLVM IR (-O2):
%struct.vm = type opaque
%struct.object = type opaque
define void @class_dtor_empty(%struct.vm* nocapture %0, %struct.object* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ioctl_get_msg(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int file_desc, ret_val;
  file_desc = open("/dev/mysql_seq_dev", 0);
  if (file_desc < 0) {
    printf("Can't open device file: %s\n", "/dev/mysql_seq_dev");
    exit(-1);
  }
  ioctl_get_msg(file_desc);
  close(file_desc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
xor    %esi,%esi
call   1060 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1190 <main+0x40>
lea    0xe99(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x4(%rbp),%edi
call   1050 <ioctl_get_msg@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xea8(%rip),%rdi
xor    %esi,%esi
call   1060 <open@plt>
test   %eax,%eax
js     1177 <main+0x27>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <ioctl_get_msg@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe95(%rip),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"/dev/mysql_seq_dev\00"
@.str.1 = [28 x i8] c"Can't open device file: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
%11 = call i32 @ioctl_get_msg(i32 %10)
%12 = load i32, i32* %1
%13 = call i32 @close(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"/dev/mysql_seq_dev\00"
@.str.1 = [28 x i8] c"Can't open device file: %s\0A\00"
define i32 @main() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %0
%7 = tail call i32 @ioctl_get_msg(i32 %1)
%8 = tail call i32 @close(i32 %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ isOctal(char *);
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int octalToDecimal(char *src) {
  if (isOctal(src)) {
    int number = (int)strtol(src, NULL, 8);
    return number;
  }
}


x86 assembly (clang, -O0):
<octalToDecimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <isOctal@plt>
cmp    $0x0,%rax
je     115a <octalToDecimal+0x3a>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octalToDecimal>:
push   %rbx
mov    %rdi,%rbx
call   1040 <isOctal@plt>
test   %rax,%rax
je     113f <octalToDecimal+0x1f>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <strtol@plt>
pop    %rbx
ret
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @octalToDecimal(i8* %0) {
%2 = tail call i64 @isOctal(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 8)
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %6, %4 ], [ undef, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigint_handler(const int sig) {
  printf("SIGINT handled.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [17 x i8] c"SIGINT handled.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [16 x i8] c"SIGINT handled.\00"
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ parse_value(char const **, int /*<<< orphan*/ *);
int /*<<< orphan*/ skip_space(char const **);
int json_validate(const char *json) {
  const char *s = json;
  skip_space(&s);
  if (!parse_value(&s, NULL))
    return 0;
  skip_space(&s);
  if (*s != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<json_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <skip_space@plt>
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <parse_value@plt>
cmp    $0x0,%eax
jne    115f <json_validate+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    118b <json_validate+0x6b>
lea    -0x18(%rbp),%rdi
call   1040 <skip_space@plt>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1184 <json_validate+0x64>
movl   $0x0,-0x4(%rbp)
jmp    118b <json_validate+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_validate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <skip_space@plt>
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <parse_value@plt>
test   %eax,%eax
je     1157 <json_validate+0x37>
mov    %rsp,%rdi
call   1040 <skip_space@plt>
mov    (%rsp),%rax
xor    %ebx,%ebx
cmpb   $0x0,(%rax)
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @json_validate(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%4 = call i32 @skip_space(i8** %2)
%5 = call i32 @parse_value(i8** %2, i32* null)
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = call i32 @skip_space(i8** %2)
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %1
%14 = phi i32 [ 0, %1 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int ENODEV;
int sandbox_sdl_init_display(int width, int height, int log2_bpp) {
  return -ENODEV;
}


x86 assembly (clang, -O0):
<sandbox_sdl_init_display>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2eca(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sandbox_sdl_init_display>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @sandbox_sdl_init_display(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* @ENODEV
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sandbox_sdl_init_display(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENODEV
%5 = sub nsw i32 0, %4
ret i32 %5
}