xunge/DecIR huggingface dataset:
void freeArgv(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++) {
    (void)free(argv[i]);
  }
  (void)free(argv);
}


x86 assembly (clang, -O0):
<freeArgv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <freeArgv+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <freeArgv+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeArgv>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <freeArgv+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeArgv+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeArgv(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int __get_array_size(char const *);
int __infer_nondet_int();
scalar_t__ malloc(int);
char *readline(const char *prompt) {
  int size_prompt;
  char *ret;
  int size;
  if (prompt != NULL) {
    size_prompt = __get_array_size(prompt);
  }
  size = __infer_nondet_int();
  if (size < 0)
    while (1)
      ;
  ret = (char *)malloc(sizeof(size));
  return ret;
}


x86 assembly (clang, -O0):
<readline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <readline+0x23>
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1171 <readline+0x41>
jmp    116c <readline+0x3c>
jmp    116c <readline+0x3c>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readline>:
push   %rax
test   %rdi,%rdi
je     113b <readline+0xb>
call   1040 <__get_array_size@plt>
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
js     1160 <readline+0x30>
mov    $0x4,%edi
pop    %rax
jmp    1050 <malloc@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1160 <readline+0x30>

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

LLVM IR (-O2):
define i8* @readline(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @__get_array_size(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 (...) @__infer_nondet_int()
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5, %8
br label %8
9: ; preds = %5
%10 = tail call i64 @malloc(i32 4)
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ _write(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void _print(char *str) { _write(100, str, strlen(str)); }


x86 assembly (clang, -O0):
<_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x64,%edi
call   1040 <_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    $0x64,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <_write@plt>

LLVM IR (-O0):
define void @_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @_write(i32 100, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @_print(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @_write(i32 100, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __suite_bug_tests();
int /*<<< orphan*/ __suite_check_tests();
int /*<<< orphan*/ __suite_hydrogen_tests();
void add_suites() {
  __suite_check_tests();
  ;
  __suite_hydrogen_tests();
  __suite_bug_tests();
}


x86 assembly (clang, -O0):
<add_suites>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__suite_check_tests@plt>
mov    $0x0,%al
call   1040 <__suite_hydrogen_tests@plt>
mov    $0x0,%al
call   1050 <__suite_bug_tests@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_suites>:
push   %rax
xor    %eax,%eax
call   1030 <__suite_check_tests@plt>
xor    %eax,%eax
call   1040 <__suite_hydrogen_tests@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <__suite_bug_tests@plt>

LLVM IR (-O0):
define void @add_suites() {
%1 = call i32 (...) @__suite_check_tests()
%2 = call i32 (...) @__suite_hydrogen_tests()
%3 = call i32 (...) @__suite_bug_tests()
ret void
}

LLVM IR (-O2):
define void @add_suites() {
%1 = tail call i32 (...) @__suite_check_tests()
%2 = tail call i32 (...) @__suite_hydrogen_tests()
%3 = tail call i32 (...) @__suite_bug_tests()
ret void
}
void inc16word(workspace) unsigned char *workspace;
{
  workspace[1]++;
  if (!workspace[1])
    workspace[0]++;
}


x86 assembly (clang, -O0):
<inc16word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
add    $0x1,%cl
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,0x1(%rax)
jne    112e <inc16word+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc16word>:
addb   $0x1,0x1(%rdi)
jne    1109 <inc16word+0x9>
addb   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @inc16word(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = add i8 %3, 1
store i8 %4, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %0
%8 = add i8 %7, 1
store i8 %8, i8* %0
br label %9
9: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((no, noclone)) void bar(const char *p) {
  if (p[0] != 'o' || p[1] != 'o' || p[2])
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6f,%eax
jne    114e <bar+0x3e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x6f,%eax
jne    114e <bar+0x3e>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
je     1155 <bar+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
cmpb   $0x6f,(%rdi)
jne    1124 <bar+0x14>
cmpb   $0x6f,0x1(%rdi)
jne    1124 <bar+0x14>
cmpb   $0x0,0x2(%rdi)
jne    1124 <bar+0x14>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define void @bar(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 111
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 111
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %8, %4, %1
%13 = tail call i32 (...) @abort()
unreachable
14: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free4(void *);
void free3(void *ptr) { free4(ptr); }


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

x86 assembly (clang, -O2):
<free3>:
jmp    1030 <free4@plt>

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

LLVM IR (-O2):
define void @free3(i8* %0) {
%2 = tail call i32 @free4(i8* %0)
ret void
}
void SteamAPI_ISteamHTMLSurface_PasteFromClipboard(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamHTMLSurface_PasteFromClipboard>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_PasteFromClipboard = [46 x i8] c"SteamAPI_ISteamHTMLSurface_PasteFromClipboard\00"
define void @SteamAPI_ISteamHTMLSurface_PasteFromClipboard(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_PasteFromClipboard, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamHTMLSurface_PasteFromClipboard = [46 x i8] c"SteamAPI_ISteamHTMLSurface_PasteFromClipboard\00"
define void @SteamAPI_ISteamHTMLSurface_PasteFromClipboard(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @__func__.SteamAPI_ISteamHTMLSurface_PasteFromClipboard, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_OIS_per_write(int, int);
void VCOSET1(void) {
  I2C_OIS_per_write(0x05, 0x000C);
  I2C_OIS_per_write(0x05, 0x000D);
}


x86 assembly (clang, -O0):
<VCOSET1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0xc,%esi
call   1030 <I2C_OIS_per_write@plt>
mov    $0x5,%edi
mov    $0xd,%esi
call   1030 <I2C_OIS_per_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VCOSET1>:
push   %rax
mov    $0x5,%edi
mov    $0xc,%esi
call   1030 <I2C_OIS_per_write@plt>
mov    $0x5,%edi
mov    $0xd,%esi
pop    %rax
jmp    1030 <I2C_OIS_per_write@plt>

LLVM IR (-O0):
define void @VCOSET1() {
%1 = call i32 @I2C_OIS_per_write(i32 5, i32 12)
%2 = call i32 @I2C_OIS_per_write(i32 5, i32 13)
ret void
}

LLVM IR (-O2):
define void @VCOSET1() {
%1 = tail call i32 @I2C_OIS_per_write(i32 5, i32 12)
%2 = tail call i32 @I2C_OIS_per_write(i32 5, i32 13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outChar(char);
void outCharXfer(char c) {
  outChar(c);
  if (c == ((char)0xAA))
    outChar(((char)0xFC));
}


x86 assembly (clang, -O0):
<outCharXfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <outChar@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xffffffaa,%eax
jne    113e <outCharXfer+0x2e>
mov    $0xfffffffc,%edi
call   1030 <outChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outCharXfer>:
push   %rbx
mov    %edi,%ebx
call   1030 <outChar@plt>
cmp    $0xaa,%bl
jne    1128 <outCharXfer+0x18>
mov    $0xfffffffc,%edi
pop    %rbx
jmp    1030 <outChar@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @outCharXfer(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @outChar(i8 signext %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, -86
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @outChar(i8 signext -4)
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @outCharXfer(i8 signext %0) {
%2 = tail call i32 @outChar(i8 signext %0)
%3 = icmp eq i8 %0, -86
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @outChar(i8 signext -4)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_primes(int *mask, int n) {
  if (!n)
    return;
  if (!mask[n])
    printf("%d\n", n);
  print_primes(mask, n - 1);
}


x86 assembly (clang, -O0):
<print_primes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <print_primes+0x1e>
jmp    116e <print_primes+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    115f <print_primes+0x3f>
mov    -0xc(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <print_primes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_primes>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     114a <print_primes+0x3a>
mov    %esi,%ebp
movslq %esi,%rax
lea    (%rdi,%rax,4),%rbx
lea    0xed8(%rip),%r14
jmp    1139 <print_primes+0x29>
nopw   0x0(%rax,%rax,1)
add    $0xfffffffffffffffc,%rbx
add    $0xffffffff,%ebp
je     114a <print_primes+0x3a>
cmpl   $0x0,(%rbx)
jne    1130 <print_primes+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1130 <print_primes+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_primes(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %14
%7 = phi i64 [ %5, %4 ], [ %15, %14 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = trunc i64 %7 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %6
%15 = add nsw i64 %7, -1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %14, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ visual;
};
typedef TYPE_1__ XEDataObject;

/* Variables and functions */
void *get_XEDataObject_visual(void *_p) {
  return (void *)((XEDataObject *)_p)->visual;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEDataObject_visual(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int brk(void *end_data_segment) {
  int ret;
  asm("movl $45, %%eax\n\t"
      "movl %1, %%ebx\n\t"
      "int $0x80\n\t"
      "movl %%eax, %0"
      : "=r"(ret)
      : "m"(end_data_segment));
}


x86 assembly (clang, -O0):
<brk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x2d,%eax
mov    -0x10(%rbp),%ebx
int    $0x80
mov    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brk>:
mov    %rdi,-0x8(%rsp)
mov    $0x2d,%eax
mov    -0x8(%rsp),%ebx
int    $0x80
mov    %eax,%eax
ret

LLVM IR (-O0):
define i32 @brk(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 asm "movl $$45, %eax\0A\09movl $1, %ebx\0A\09int $$0x80\0A\09movl %eax, $0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %3)
store i32 %5, i32* %4
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @brk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 asm "movl $$45, %eax\0A\09movl $1, %ebx\0A\09int $$0x80\0A\09movl %eax, $0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i8** elementtype(i8*) %2)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
void rewind(FILE *stream) { (void)fseek(stream, 0L, SEEK_SET); }


x86 assembly (clang, -O0):
<rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <fseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i32 @fseek(i32* %3, i64 0, i32 %4)
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @rewind(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
const uint64_t rotr64(uint64_t x, uint8_t n) {
  return (x >> n) | (x << (64 - n));
}


x86 assembly (clang, -O0):
<rotr64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr64>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotr64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotr64(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Sample Program...\n");
  printf("This program was compiled without thread support.\n");
  return 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    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Sample Program...\0A\00"
@.str.1 = [51 x i8] c"This program was compiled without thread support.\0A\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 ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"Sample Program...\00"
@str.2 = [50 x i8] c"This program was compiled without thread support.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vpicx_set_rff(uint8_t *p_mp2vpicx) { p_mp2vpicx[7] |= 0x2; }


x86 assembly (clang, -O0):
<mp2vpicx_set_rff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
or     $0x2,%ecx
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_set_rff>:
orb    $0x2,0x1c(%rdi)
ret

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

LLVM IR (-O2):
define void @mp2vpicx_set_rff(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = or i32 %3, 2
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void eoi_s() { outb(0xA0, 0x20); }


x86 assembly (clang, -O0):
<eoi_s>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eoi_s>:
mov    $0xa0,%edi
mov    $0x20,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @eoi_s() {
%1 = call i32 @outb(i32 160, i32 32)
ret void
}

LLVM IR (-O2):
define void @eoi_s() {
%1 = tail call i32 @outb(i32 160, i32 32)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void strip_linefeed(char search_for[]) {
  char *c = strchr(search_for, '\n');
  if (c) {
    *c = 0;
  }
}


x86 assembly (clang, -O0):
<strip_linefeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <strip_linefeed+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_linefeed>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <strip_linefeed+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @strip_linefeed(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void fuword(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


x86 assembly (clang, -O0):
<fuword>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuword>:
xor    %edi,%edi
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
define void @fuword() {
%1 = call i32 @nsc_assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @fuword() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
int is_prime(int n) {
  int d = 2;
  while (d < n) {
    if (n % d == 0) {
      d++;
      return 0;
    }
    if (n % d != 0)
      return 1;
  }
  if (n <= 1)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1160 <is_prime+0x60>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113f <is_prime+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
jmp    117d <is_prime+0x7d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     115b <is_prime+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    117d <is_prime+0x7d>
jmp    110e <is_prime+0xe>
cmpl   $0x1,-0x8(%rbp)
jg     1176 <is_prime+0x76>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <is_prime+0x7d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %edi,%ecx
and    $0x1,%ecx
cmp    $0x3,%edi
lea    -0x1(%rax,%rax,1),%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
%3 = icmp eq i32 %0, 2
%4 = select i1 %3, i32 1, i32 -1
%5 = and i32 %0, 1
%6 = select i1 %2, i32 %5, i32 %4
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysTickEnable(void) {
  (*((volatile uint32_t *)(0xE000E010))) |= 0x00000004 | 0x00000001;
}


x86 assembly (clang, -O0):
<SysTickEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%ecx
or     $0x5,%ecx
mov    $0xe000e010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickEnable>:
mov    $0xe000e010,%eax
orl    $0x5,(%rax)
ret

LLVM IR (-O0):
define void @SysTickEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%2 = or i32 %1, 5
store volatile i32 %2, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysTickEnable() {
%1 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%2 = or i32 %1, 5
store volatile i32 %2, i32* inttoptr (i64 3758153744 to i32*)
ret void
}
int hexdigit(int c) {
  unsigned d;
  d = (unsigned)(c - '0');
  if (d < 10)
    return d;
  d = (unsigned)(c - 'a');
  if (d < 6)
    return d + 10;
  d = (unsigned)(c - 'A');
  if (d < 6)
    return d + 10;
  return -1;
}


x86 assembly (clang, -O0):
<hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jae    1125 <hexdigit+0x25>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <hexdigit+0x6e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jae    1146 <hexdigit+0x46>
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <hexdigit+0x6e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jae    1167 <hexdigit+0x67>
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <hexdigit+0x6e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hexdigit+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hexdigit+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hexdigit(i32 %0) {
%2 = add nsw i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add nsw i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add i32 %0, -55
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %9, %1, %7
%15 = phi i32 [ %8, %7 ], [ %2, %1 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int vobb();
int main(int argc, const char *argv[]) {
  int v = 0;
  if (argc > 1)
    v = vobb();
  printf("First: V is %d\n", v);
}


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   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1151 <main+0x31>
mov    $0x0,%al
call   1030 <vobb@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %esi,%esi
cmp    $0x2,%edi
jl     1131 <main+0x11>
xor    %eax,%eax
call   1030 <vobb@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"First: V is %d\0A\00"
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 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @vobb()
store i32 %10, i32* %6
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"First: V is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @vobb()
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LPTMR0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void LPTMR0_IRQHandler(void) {
  LPTMR0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @LPTMR0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @LPTMR0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @LPTMR0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @LPTMR0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_ascii_apple();
int main(int argc, char **argv) {
  ((void)argc);
  ((void)argv);
  print_ascii_apple();
  return 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)
mov    $0x0,%al
call   1030 <print_ascii_apple@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @print_ascii_apple()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @print_ascii_apple()
ret i32 0
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
int /*<<< orphan*/ gfx_pci_config_write(int, unsigned long);
int gfx_disable_softvga(void) {
  unsigned long reg_val;
  reg_val = gfx_pci_config_read(0x80009444);
  reg_val |= 0x1;
  gfx_pci_config_write(0x80009444, reg_val);
  reg_val = gfx_pci_config_read(0x80009444);
  if ((reg_val & 0x1) == 0x1)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<gfx_disable_softvga>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x80009444,%edi
call   1030 <gfx_pci_config_write@plt>
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x1,%rax
jne    117c <gfx_disable_softvga+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <gfx_disable_softvga+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_disable_softvga>:
push   %rax
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
or     $0x1,%rax
mov    $0x80009444,%edi
mov    %rax,%rsi
call   1030 <gfx_pci_config_write@plt>
mov    $0x80009444,%edi
call   1040 <gfx_pci_config_read@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gfx_disable_softvga() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 @gfx_pci_config_read(i32 -2147445692)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = or i64 %4, 1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = call i32 @gfx_pci_config_write(i32 -2147445692, i64 %6)
%8 = call i64 @gfx_pci_config_read(i32 -2147445692)
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = and i64 %9, 1
%11 = icmp eq i64 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 1, i32* %1
br label %14
13: ; preds = %0
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @gfx_disable_softvga() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147445692)
%2 = or i64 %1, 1
%3 = tail call i32 @gfx_pci_config_write(i32 -2147445692, i64 %2)
%4 = tail call i64 @gfx_pci_config_read(i32 -2147445692)
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int U_WMRCORENONE_get(char *string) {
  printf("unimplemented creator for:%s\n", string);
  return (0);
}


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

x86 assembly (clang, -O2):
<U_WMRCORENONE_get>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"unimplemented creator for:%s\0A\00"
define i32 @U_WMRCORENONE_get(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int check_xcr0_ymm() {
  int xcr0;
  int mask = (1 << 1) | (1 << 2);
  __asm__("xgetbv" : "=a"(xcr0) : "c"(0) : "%edx");
  return (xcr0 & mask) == mask;
}


x86 assembly (clang, -O0):
<check_xcr0_ymm>:
push   %rbp
mov    %rsp,%rbp
movl   $0x6,-0x8(%rbp)
xor    %ecx,%ecx
xgetbv
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_xcr0_ymm>:
xor    %ecx,%ecx
xgetbv
not    %eax
xor    %ecx,%ecx
test   $0x6,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @check_xcr0_ymm() {
%1 = alloca i32
%2 = alloca i32
store i32 6, i32* %2
%3 = call i32 asm "xgetbv", "={ax},{cx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = and i32 %4, %5
%7 = load i32, i32* %2
%8 = icmp eq i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @check_xcr0_ymm() {
%1 = tail call i32 asm "xgetbv", "={ax},{cx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = and i32 %1, 6
%3 = icmp eq i32 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t ectp_htons(uint16_t i) { return (uint16_t)bswap_16(i); }


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

x86 assembly (clang, -O2):
<ectp_htons>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @ectp_htons(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int print(char **, size_t, char const *, int /*<<< orphan*/);
int kvsnprintf(char *str, size_t size, const char *format, va_list ap) {
  return print(&str, size, format, ap);
}


x86 assembly (clang, -O0):
<kvsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    -0x8(%rbp),%rdi
call   1030 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvsnprintf>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <print@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @kvsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
store i8* %0, i8** %5
%6 = call i32 @print(i8** %5, i64 %1, i8* %2, i32 %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vulnerable();
int main(void) {
  setvbuf(stdin, NULL, _IONBF, 0);
  setvbuf(stdout, NULL, _IONBF, 0);
  vulnerable();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    $0x0,%al
call   1040 <vulnerable@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rbx
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <setvbuf@plt>
xor    %eax,%eax
call   1040 <vulnerable@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@_IONBF = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = load i32, i32* @_IONBF
%4 = call i32 @setvbuf(i32 %2, i32* null, i32 %3, i32 0)
%5 = load i32, i32* @stdout
%6 = load i32, i32* @_IONBF
%7 = call i32 @setvbuf(i32 %5, i32* null, i32 %6, i32 0)
%8 = call i32 (...) @vulnerable()
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
@_IONBF = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = load i32, i32* @_IONBF
%3 = tail call i32 @setvbuf(i32 %1, i32* null, i32 %2, i32 0)
%4 = load i32, i32* @stdout
%5 = load i32, i32* @_IONBF
%6 = tail call i32 @setvbuf(i32 %4, i32* null, i32 %5, i32 0)
%7 = tail call i32 (...) @vulnerable()
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct xdg_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int);
void xdg_surface_set_minimized(struct xdg_surface *xdg_surface) {
  wl_proxy_marshal((struct wl_proxy *)xdg_surface, 12);
}


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

x86 assembly (clang, -O2):
<xdg_surface_set_minimized>:
mov    $0xc,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_set_minimized(%struct.xdg_surface* %0) {
%2 = alloca %struct.xdg_surface*
store %struct.xdg_surface* %0, %struct.xdg_surface** %2
%3 = load %struct.xdg_surface*, %struct.xdg_surface** %2
%4 = bitcast %struct.xdg_surface* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 12)
ret void
}

LLVM IR (-O2):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_set_minimized(%struct.xdg_surface* %0) {
%2 = bitcast %struct.xdg_surface* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_file(char *, char *, int);
int /*<<< orphan*/ mkdir(char *, int);
void setup() {
  mkdir("nocanread", 0111);
  mkdir("foobar", 0777);
  create_file("foobar/file.txt", "ride into the danger zone", 0666);
}


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x49,%esi
call   1030 <mkdir@plt>
lea    0xece(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
lea    0xec4(%rip),%rdi
lea    0xecd(%rip),%rsi
mov    $0x1b6,%edx
call   1040 <create_file@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x49,%esi
call   1030 <mkdir@plt>
lea    0xed1(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
lea    0xec7(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x1b6,%edx
pop    %rax
jmp    1040 <create_file@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"nocanread\00"
@.str.1 = [7 x i8] c"foobar\00"
@.str.2 = [16 x i8] c"foobar/file.txt\00"
@.str.3 = [26 x i8] c"ride into the danger zone\00"
define void @setup() {
%1 = call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 73)
%2 = call i32 @mkdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 511)
%3 = call i32 @create_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 438)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"nocanread\00"
@.str.1 = [7 x i8] c"foobar\00"
@.str.2 = [16 x i8] c"foobar/file.txt\00"
@.str.3 = [26 x i8] c"ride into the danger zone\00"
define void @setup() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 73)
%2 = tail call i32 @mkdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 511)
%3 = tail call i32 @create_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 438)
ret void
}