xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int, char const *,
                            char const *);
int wpa_command(char const *, char *);
int set_network(const char *ifname, int id, const char *field,
                const char *value) {
  char buf[200];
  snprintf(buf, sizeof(buf), "SET_NETWORK %d %s %s", id, field, value);
  return wpa_command(ifname, buf);
}


x86 assembly (clang, -O0):
<set_network>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0xf0(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    $0xc8,%esi
lea    0xea8(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1040 <wpa_command@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_network>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rcx,%r9
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xec4(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xc8,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <wpa_command@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"SET_NETWORK %d %s %s\00"
define i32 @set_network(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [200 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @snprintf(i8* %10, i32 200, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12, i8* %13)
%15 = load i8*, i8** %5
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%17 = call i32 @wpa_command(i8* %15, i8* %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [21 x i8] c"SET_NETWORK %d %s %s\00"
define i32 @set_network(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca [200 x i8]
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = call i32 @snprintf(i8* %6, i32 200, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3)
%8 = call i32 @wpa_command(i8* %0, i8* %6)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
FILE *open_file(char *fname, char *mode) {
  FILE *fp;
  if ((fp = fopen(fname, mode)) == NULL) {
    fprintf(stderr, "Error (errno: %d) opening file '%s' for writing.", errno,
            fname);
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1187 <open_file+0x57>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rcx
lea    0xe88(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <open_file+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%edx
lea    0xea7(%rip),%rsi
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"Error (errno: %d) opening file '%s' for writing.\00"
@errno = global i32 0
define i32* @open_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"Error (errno: %d) opening file '%s' for writing.\00"
@errno = global i32 0
define noalias i32* @open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i32* %3
}
acct(t) int *t;
{
  if (t == 0)
    enacct("**gok");
  else if (*t == 2)
    enacct("()");
  else
    enacct(t[5]);
}


x86 assembly (clang, -O0):
<acct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <acct+0x2a>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <enacct@plt>
jmp    116d <acct+0x5d>
mov    -0x10(%rbp),%rax
cmpl   $0x2,(%rax)
jne    115a <acct+0x4a>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <enacct@plt>
jmp    1168 <acct+0x58>
mov    -0x10(%rbp),%rax
mov    0x14(%rax),%edi
mov    $0x0,%al
call   1030 <enacct@plt>
jmp    116d <acct+0x5d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acct>:
push   %rax
test   %rdi,%rdi
je     1124 <acct+0x14>
cmpl   $0x2,(%rdi)
jne    1134 <acct+0x24>
lea    0xee4(%rip),%rdi
jmp    112b <acct+0x1b>
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <enacct@plt>
pop    %rcx
ret
mov    0x14(%rdi),%edi
xor    %eax,%eax
call   1030 <enacct@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"**gok\00"
@.str.1 = [3 x i8] c"()\00"
define i32 @acct(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @enacct to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %20
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @enacct to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %19
14: ; preds = %8
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 5
%17 = load i32, i32* %16
%18 = call i32 (i32, ...) bitcast (i32 (...)* @enacct to i32 (i32, ...)*)(i32 %17)
br label %19
19: ; preds = %14, %12
br label %20
20: ; preds = %19, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"**gok\00"
@.str.1 = [3 x i8] c"()\00"
define i32 @acct(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @enacct to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %14
5: ; preds = %1
%6 = load i32, i32* %0
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @enacct to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %14
10: ; preds = %5
%11 = getelementptr inbounds i32, i32* %0, i64 5
%12 = load i32, i32* %11
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @enacct to i32 (i32, ...)*)(i32 %12)
br label %14
14: ; preds = %8, %10, %3
ret i32 undef
}
int rand_int(unsigned int *seed) {
  *seed = *seed * 196314165 + 907633515;
  return *seed;
}


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xbb38435,(%rax),%ecx
add    $0x3619636b,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
imul   $0xbb38435,(%rdi),%eax
add    $0x3619636b,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @rand_int(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul i32 %4, 196314165
%6 = add i32 %5, 907633515
%7 = load i32*, i32** %2
store i32 %6, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rand_int(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 196314165
%4 = add i32 %3, 907633515
store i32 %4, i32* %0
ret i32 %4
}
int is_same_color(char x, char y) {
  if (x == y || y == 'w')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_same_color>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
je     112d <is_same_color+0x2d>
movsbl -0x6(%rbp),%eax
cmp    $0x77,%eax
jne    1139 <is_same_color+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1140 <is_same_color+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_same_color>:
cmp    %sil,%dil
sete   %al
cmp    $0x77,%sil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_same_color(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = icmp eq i8 %1, 119
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct BoolExpr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct BoolExpr *);
void _lit_del(struct BoolExpr *lit) { free(lit); }


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

x86 assembly (clang, -O2):
<_lit_del>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.BoolExpr = type { i32 }
define void @_lit_del(%struct.BoolExpr* nocapture %0) {
%2 = tail call i32 @free(%struct.BoolExpr* %0)
ret void
}
main() { return (int){5, 6}; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
char *mystrchr(const char *s, char *c) {
  int i = 0;
  while (*s) {
    if (*(s + i) == *c)
      return (s + i);
    i++;
  }
}


x86 assembly (clang, -O0):
<mystrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <mystrchr+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    114f <mystrchr+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    115d <mystrchr+0x5d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <mystrchr+0x13>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrchr>:
mov    (%rdi),%dl
test   %dl,%dl
je     1115 <mystrchr+0x15>
mov    %rdi,%rax
mov    (%rsi),%cl
cmp    %cl,%dl
jne    1116 <mystrchr+0x16>
xor    %ecx,%ecx
add    %rcx,%rax
ret
ret
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rsi
add    $0x1,%rdx
cmp    %cl,0x1(%rax,%rsi,1)
jne    1120 <mystrchr+0x20>
mov    %edx,%ecx
add    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @mystrchr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %30
11: ; preds = %7
%12 = load i8*, i8** %4
%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 = sext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %27
22: ; preds = %11
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8* %26, i8** %3
br label %30
27: ; preds = %11
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %22, %7
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @mystrchr(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %3, %6
br i1 %7, label %16, label %8
8: ; preds = %5, %8
%9 = phi i64 [ %10, %8 ], [ 0, %5 ]
%10 = add nuw i64 %9, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %6
br i1 %13, label %14, label %8
14: ; preds = %8
%15 = and i64 %10, 4294967295
br label %16
16: ; preds = %14, %5
%17 = phi i64 [ %15, %14 ], [ 0, %5 ]
%18 = getelementptr inbounds i8, i8* %0, i64 %17
br label %19
19: ; preds = %2, %16
%20 = phi i8* [ %18, %16 ], [ undef, %2 ]
ret i8* %20
}
adr0adrreg1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*((float *)10000000)) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<adr0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movss  0x10f444(%rax),%xmm0
mov    $0x989680,%eax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrreg1_set>:
movss  0x10f444(%rcx),%xmm0
movss  %xmm0,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adrreg1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = getelementptr inbounds float, float* %16, i64 277777
%18 = load float, float* %17
store float %18, float* inttoptr (i64 10000000 to float*)
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @adr0adrreg1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture %5) {
%7 = getelementptr inbounds float, float* %5, i64 277777
%8 = load float, float* %7
store float %8, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x41() {
  Assert_real((isalpha(65)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              330, ("isalpha should be 1 for A"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x41>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x14a,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x41>:
push   %rax
mov    $0x41,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x14a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for A\00"
define void @t_isalpha_0x41() {
%1 = call i32 @isalpha(i32 65)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for A\00"
define void @t_isalpha_0x41() {
%1 = tail call i32 @isalpha(i32 65)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 330, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *convertToTitle(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  int input = 53;
  char *result = convertToTitle(input);
  printf("%s\n", result);
  free(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x35,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <convertToTitle@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x35,%edi
call   1050 <convertToTitle@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 53, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @convertToTitle(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @convertToTitle(i32 53)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISBLK(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int _keystore_is_block_device(const char *volume) {
  struct stat sb;
  if (stat(volume, &sb))
    return 0;
  if (!S_ISBLK(sb.st_mode))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<_keystore_is_block_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     114f <_keystore_is_block_device+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1173 <_keystore_is_block_device+0x53>
mov    -0x18(%rbp),%edi
call   1040 <S_ISBLK@plt>
cmp    $0x0,%eax
jne    116c <_keystore_is_block_device+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1173 <_keystore_is_block_device+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_keystore_is_block_device>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <_keystore_is_block_device+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISBLK@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_keystore_is_block_device(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISBLK(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int inp_emulate(int);
char TOSH_READ_RED_LED_PIN() { return 0x01 & (inp_emulate(0x35) >> 2); }


x86 assembly (clang, -O0):
<TOSH_READ_RED_LED_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
sar    $0x2,%eax
and    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_READ_RED_LED_PIN>:
push   %rax
mov    $0x35,%edi
call   1030 <inp_emulate@plt>
shr    $0x2,%al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @TOSH_READ_RED_LED_PIN() {
%1 = call i32 @inp_emulate(i32 53)
%2 = ashr i32 %1, 2
%3 = and i32 1, %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @TOSH_READ_RED_LED_PIN() {
%1 = tail call i32 @inp_emulate(i32 53)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 2
%4 = and i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(unsigned char, unsigned char *);
void SensorGetReg_S5KA3AFX(unsigned char uAddr, unsigned short *uVal) {
  VIM_SIF_I2cReadByte((unsigned char)uAddr, (unsigned char *)uVal);
}


x86 assembly (clang, -O0):
<SensorGetReg_S5KA3AFX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
movzbl %al,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorGetReg_S5KA3AFX>:
jmp    1030 <VIM_SIF_I2cReadByte@plt>

LLVM IR (-O0):
define void @SensorGetReg_S5KA3AFX(i8 zeroext %0, i16* %1) {
%3 = alloca i8
%4 = alloca i16*
store i8 %0, i8* %3
store i16* %1, i16** %4
%5 = load i8, i8* %3
%6 = load i16*, i16** %4
%7 = bitcast i16* %6 to i8*
%8 = call i32 @VIM_SIF_I2cReadByte(i8 zeroext %5, i8* %7)
ret void
}

LLVM IR (-O2):
define void @SensorGetReg_S5KA3AFX(i8 zeroext %0, i16* %1) {
%3 = bitcast i16* %1 to i8*
%4 = tail call i32 @VIM_SIF_I2cReadByte(i8 zeroext %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ floydWarshell(int **);
int main() {
  int graph[4][4] = {{0, 5, 99999, 10},
                     {99999, 0, 3, 99999},
                     {99999, 99999, 0, 1},
                     {99999, 99999, 99999, 0}};
  floydWarshell(graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <floydWarshell@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <floydWarshell@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.graph = [4 x [4 x i32]] [[4 x i32] [i32 0, i32 5, i32 99999, i32 10], [4 x i32] [i32 99999, i32 0, i32 3, i32 99999], [4 x i32] [i32 99999, i32 99999, i32 0, i32 1], [4 x i32] [i32 99999, i32 99999, i32 99999, i32 0]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x i32]]
store i32 0, i32* %1
%3 = bitcast [4 x [4 x i32]]* %2 to i8*
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%5 = bitcast [4 x i32]* %4 to i32**
%6 = call i32 @floydWarshell(i32** %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.graph = [4 x [4 x i32]] [[4 x i32] [i32 0, i32 5, i32 99999, i32 10], [4 x i32] [i32 99999, i32 0, i32 3, i32 99999], [4 x i32] [i32 99999, i32 99999, i32 0, i32 1], [4 x i32] [i32 99999, i32 99999, i32 99999, i32 0]]
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = bitcast [4 x [4 x i32]]* %1 to i32**
%4 = call i32 @floydWarshell(i32** %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ LittleEndianWriteU64(int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
void LittleEndianWriteS64(int64_t value, uint8_t *bytes) {
  LittleEndianWriteU64((uint64_t)value, bytes);
}


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

x86 assembly (clang, -O2):
<LittleEndianWriteS64>:
jmp    1030 <LittleEndianWriteU64@plt>

LLVM IR (-O0):
define void @LittleEndianWriteS64(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i32*, i32** %4
%8 = call i32 @LittleEndianWriteU64(i32 %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @LittleEndianWriteS64(i64 %0, i32* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @LittleEndianWriteU64(i32 %3, i32* %1)
ret void
}
signed int int_min(signed int a, signed int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <int_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <int_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @int_min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @int_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ WaitMouseLeft271();
void waitmouseleft() { WaitMouseLeft271(); }


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

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

LLVM IR (-O0):
define void @waitmouseleft() {
%1 = call i32 (...) @WaitMouseLeft271()
ret void
}

LLVM IR (-O2):
define void @waitmouseleft() {
%1 = tail call i32 (...) @WaitMouseLeft271()
ret void
}
void printerror() {}


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

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

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

LLVM IR (-O2):
define void @printerror() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help(void) {
  printf(
      "USAGE: arpscan [OPTIONS]\n"
      "\n"
      "  -h, --help            Show this helpful message.\n"
      "                        (for more in-depth help, check the man page.)\n"
      "\n"
      "  -d, --device NAME     The interface to send ARP requests from.\n"
      "\n"
      "  -n, --network CIDR    Network range to scan, in CIDR notation\n"
      "\n"
      "  -t, --timeout MS      Number of milliseconds to wait on an ARP reply\n"
      "                        before exiting.  Defaults to 500ms\n"
      "\n");
}


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

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

LLVM IR (-O0):
@.str = [411 x i8] c"USAGE: arpscan [OPTIONS]\0A\0A -h, --help Show this helpful message.\0A (for more in-depth help, check the man page.)\0A\0A -d, --device NAME The interface to send ARP requests from.\0A\0A -n, --network CIDR Network range to scan, in CIDR notation\0A\0A -t, --timeout MS Number of milliseconds to wait on an ARP reply\0A before exiting. Defaults to 500ms\0A\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([411 x i8], [411 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [410 x i8] c"USAGE: arpscan [OPTIONS]\0A\0A -h, --help Show this helpful message.\0A (for more in-depth help, check the man page.)\0A\0A -d, --device NAME The interface to send ARP requests from.\0A\0A -n, --network CIDR Network range to scan, in CIDR notation\0A\0A -t, --timeout MS Number of milliseconds to wait on an ARP reply\0A before exiting. Defaults to 500ms\0A\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([410 x i8], [410 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int next_prime(int n) {
  while (!is_prime(++n))
    ;
  return n;
}


x86 assembly (clang, -O0):
<next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x4(%rbp)
call   1030 <is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113e <next_prime+0x2e>
jmp    1143 <next_prime+0x33>
jmp    111b <next_prime+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_prime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <is_prime@plt>
test   %eax,%eax
je     1120 <next_prime+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @next_prime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = call i32 @is_prime(i32 %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %3
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @next_prime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, 1
%5 = tail call i32 @is_prime(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void mystery(int n) {
  n += 5;
  n /= 10;
  printf("%s\n", "**********" + 10 - n);
}


x86 assembly (clang, -O0):
<mystery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
lea    0xec2(%rip),%rsi
add    $0xa,%rsi
add    %rax,%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystery>:
add    $0x5,%edi
movslq %edi,%rax
imul   $0xffffffff99999999,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
cltq
lea    0xed1(%rip),%rcx
lea    (%rax,%rcx,1),%rsi
add    $0xa,%rsi
lea    0xebe(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"**********\00"
define void @mystery(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 5
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = sub i64 0, %8
%10 = getelementptr inbounds i8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 10), i64 %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"**********\00"
define void @mystery(i32 %0) {
%2 = add nsw i32 %0, 5
%3 = sdiv i32 %2, -10
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 10), i64 %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void Dico_String_Start(int nb_consts) {
  Inst_Printf(".section", "\".rodata\"");
}


x86 assembly (clang, -O0):
<Dico_String_Start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dico_String_Start>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c".section\00"
@.str.1 = [10 x i8] c"\22.rodata\22\00"
define void @Dico_String_Start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Inst_Printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c".section\00"
@.str.1 = [10 x i8] c"\22.rodata\22\00"
define void @Dico_String_Start(i32 %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char *, size_t);
ssize_t llistxattr(const char *path, char *list, size_t size) {
  return syscall(233, path, list, size);
}


x86 assembly (clang, -O0):
<llistxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0xe9,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llistxattr>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xe9,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @llistxattr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @syscall(i32 233, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int fstat(int, struct stat *);
off_t get_file_size(FILE *f) {
  struct stat s;
  int fd = fileno(f);
  if (fd == -1)
    return -1;
  if (fstat(fd, &s) == -1)
    return -1;
  return s.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    114e <get_file_size+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <get_file_size+0x55>
mov    -0x1c(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    116f <get_file_size+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <get_file_size+0x55>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rbx
sub    $0x10,%rsp
call   1030 <fileno@plt>
mov    $0xffffffff,%ebx
cmp    $0xffffffff,%eax
je     1149 <get_file_size+0x29>
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
je     1149 <get_file_size+0x29>
mov    0x8(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.stat
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fileno(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* %5
%13 = call i32 @fstat(i32 %12, %struct.stat* %4)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %2
br label %19
16: ; preds = %11
%17 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%18 = load i32, i32* %17
store i32 %18, i32* %2
br label %19
19: ; preds = %16, %15, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = call i32 @fstat(i32 %4, %struct.stat* %2)
%8 = icmp eq i32 %7, -1
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
br label %12
12: ; preds = %6, %1, %9
%13 = phi i32 [ %11, %9 ], [ -1, %1 ], [ -1, %6 ]
ret i32 %13
}
/* Variables and functions */
void *malloc(size_t);
void *__softboundmpx_safe_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<__softboundmpx_safe_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @__softboundmpx_safe_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @__softboundmpx_safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned long);
void to_base_n(unsigned long n, int r) {
  if (n >= r)
    to_base_n(n / r, r);
  putchar('0' + n % r);
}


x86 assembly (clang, -O0):
<to_base_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmp    %rcx,%rax
jb     1158 <to_base_n+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
mov    -0xc(%rbp),%esi
call   1040 <to_base_n@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rdi
add    $0x30,%rdi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_base_n>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
movslq %esi,%rbp
cmp    %rdi,%rbp
ja     115a <to_base_n+0x3a>
mov    %rbx,%rax
or     %rbp,%rax
shr    $0x20,%rax
je     1148 <to_base_n+0x28>
mov    %rbx,%rax
xor    %edx,%edx
div    %rbp
jmp    114f <to_base_n+0x2f>
mov    %ebx,%eax
xor    %edx,%edx
div    %r14d
mov    %rax,%rdi
mov    %r14d,%esi
call   1040 <to_base_n@plt>
mov    %rbx,%rax
or     %rbp,%rax
shr    $0x20,%rax
je     1173 <to_base_n+0x53>
mov    %rbx,%rax
xor    %edx,%edx
div    %rbp
mov    %rdx,%rdi
jmp    117c <to_base_n+0x5c>
mov    %ebx,%eax
xor    %edx,%edx
div    %r14d
mov    %edx,%edi
add    $0x30,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @to_base_n(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp uge i64 %5, %7
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i64, i64* %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = udiv i64 %10, %12
%14 = load i32, i32* %4
br label %15
15: ; preds = %9, %2
%16 = load i64, i64* %3
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = urem i64 %16, %18
%20 = add i64 48, %19
%21 = call i32 @putchar(i64 %20)
ret void
}

LLVM IR (-O2):
define void @to_base_n(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = icmp ugt i64 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = udiv i64 %0, %3
tail call void @to_base_n(i64 %6, i32 %1)
br label %7
7: ; preds = %5, %2
%8 = urem i64 %0, %3
%9 = add i64 %8, 48
%10 = tail call i32 @putchar(i64 %9)
ret void
}
int findComplement(int num) {
  int xorNum = 0;
  for (int num2 = num; num2 > 0; num2 >>= 1) {
    xorNum = (xorNum << 1) + 1;
  }
  return num ^ xorNum;
}


x86 assembly (clang, -O0):
<findComplement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1138 <findComplement+0x38>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <findComplement+0x14>
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findComplement>:
xor    %eax,%eax
test   %edi,%edi
jle    111e <findComplement+0x1e>
mov    %edi,%edx
mov    %edi,%ecx
nopw   0x0(%rax,%rax,1)
add    %eax,%eax
add    $0x1,%eax
shr    %ecx
cmp    $0x2,%edx
mov    %ecx,%edx
jae    1110 <findComplement+0x10>
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @findComplement(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi i32 [ 0, %1 ], [ %10, %6 ]
%5 = xor i32 %4, %0
ret i32 %5
6: ; preds = %1, %6
%7 = phi i32 [ %11, %6 ], [ %0, %1 ]
%8 = phi i32 [ %10, %6 ], [ 0, %1 ]
%9 = shl i32 %8, 1
%10 = or i32 %9, 1
%11 = lshr i32 %7, 1
%12 = icmp ult i32 %7, 2
br i1 %12, label %3, label %6
}
/* Variables and functions */
int EXIT_FAILURE;
int editor_is_vim_wrapper(char **);
scalar_t__ strcmp(char *, char *);
int main(int ac, char **av) {
  (void)(ac);
  if (strcmp(av[1], "editor_is_vim") == 0) {
    return editor_is_vim_wrapper(av);
  } else {
    return EXIT_FAILURE;
  }
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1165 <main+0x45>
mov    -0x10(%rbp),%rdi
call   1040 <editor_is_vim_wrapper@plt>
mov    %eax,-0x4(%rbp)
jmp    1171 <main+0x51>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1144 <main+0x24>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <editor_is_vim_wrapper@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"editor_is_vim\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @editor_is_vim_wrapper(i8** %1)
br label %11
9: ; preds = %2
%10 = load i32, i32* @EXIT_FAILURE
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
int consoleInit() { return 0; }


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

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

LLVM IR (-O0):
define i32 @consoleInit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @consoleInit() {
ret i32 0
}
void gtk_frame_get_shadow_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_frame_get_shadow_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello cruel world");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"Hello cruel world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}