xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int passwd(char *key) {
  key[0] = '\0';
  while (key[0] == '\0') {
    printf("Password:");
    fscanf(stdin, "%s", key);
  }
  return 0;
}


x86 assembly (clang, -O0):
<passwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116d <passwd+0x4d>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1040 <fscanf@plt>
jmp    1133 <passwd+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passwd>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
movb   $0x0,(%rdi)
lea    0xecb(%rip),%r14
mov    0x2eac(%rip),%r12
lea    0xec7(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%r12),%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <fscanf@plt>
cmpb   $0x0,(%rbx)
je     1150 <passwd+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"Password:\00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%s\00"
define i32 @passwd(i8* %0) {
store i8 0, i8* %0
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = tail call i32 @fscanf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stpcpy(char *, char const *);
char *strcpy(char *restrict dst, const char *restrict src) {
  stpcpy(dst, src);
  return dst;
}


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

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

LLVM IR (-O0):
define i8* @strcpy(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @stpcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned %0, i8* noalias %1) {
%3 = tail call i32 @stpcpy(i8* %0, i8* %1)
ret i8* %0
}
int sync_ubx(unsigned char *buff, unsigned char data) {
  buff[0] = buff[1];
  buff[1] = data;
  return buff[0] == 0xB5 && buff[1] == 0x62;
}


x86 assembly (clang, -O0):
<sync_ubx>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xb5,%ecx
mov    %al,-0xa(%rbp)
jne    114e <sync_ubx+0x4e>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x62,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_ubx>:
mov    0x1(%rdi),%cl
mov    %cl,(%rdi)
mov    %sil,0x1(%rdi)
xor    $0xb5,%cl
xor    $0x62,%sil
xor    %eax,%eax
or     %cl,%sil
sete   %al
ret

LLVM IR (-O0):
define i32 @sync_ubx(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8, i8* %4
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 181
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = icmp eq i32 %22, 98
br label %24
24: ; preds = %18, %2
%25 = phi i1 [ false, %2 ], [ %23, %18 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @sync_ubx(i8* nocapture %0, i8 zeroext %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %1, i8* %3
%5 = icmp eq i8 %4, -75
%6 = icmp eq i8 %1, 98
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x89() {
  Assert_real((isspace(137) == 0),
              "/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_isspace.c",
              690, ("isspace should be 0 for 0x89"));
}


x86 assembly (clang, -O0):
<t_isspace_0x89>:
push   %rbp
mov    %rsp,%rbp
mov    $0x89,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2b2,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x89>:
push   %rax
mov    $0x89,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b2,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x89\00"
define void @t_isspace_0x89() {
%1 = call i64 @isspace(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x89\00"
define void @t_isspace_0x89() {
%1 = tail call i64 @isspace(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int atoi(char *);
void Get_args(int argc, char *argv[], int *n_p) { *n_p = atoi(argv[1]); }


x86 assembly (clang, -O0):
<Get_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_args>:
push   %rbx
mov    %rdx,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @Get_args(i32 %0, i8** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @Get_args(i32 %0, i8** nocapture %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @atoi(i8* %5)
store i32 %6, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void EXPECT_INT(int result, int expect) {
  if ((result) == (expect)) {
    printf(" result is \"%d\", expect is \"%d\"(SUCCESS)\n\n", (result),
           (expect));
  } else {
    printf(" result is \"%d\", expect is \"%d\"(FAILED)\n\n", (result),
           (expect));
  }
}


x86 assembly (clang, -O0):
<EXPECT_INT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <EXPECT_INT+0x31>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    1153 <EXPECT_INT+0x43>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EXPECT_INT>:
mov    %esi,%edx
mov    %edi,%esi
cmp    %edx,%edi
jne    1126 <EXPECT_INT+0x16>
lea    0xee1(%rip),%rdi
mov    %esi,%edx
jmp    1030 <printf@plt>
lea    0xefe(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c" result is \22%d\22, expect is \22%d\22(SUCCESS)\0A\0A\00"
@.str.1 = [42 x i8] c" result is \22%d\22, expect is \22%d\22(FAILED)\0A\0A\00"
define void @EXPECT_INT(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 eq i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %16
12: ; preds = %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
br label %16
16: ; preds = %12, %8
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c" result is \22%d\22, expect is \22%d\22(SUCCESS)\0A\0A\00"
@.str.1 = [42 x i8] c" result is \22%d\22, expect is \22%d\22(FAILED)\0A\0A\00"
define void @EXPECT_INT(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char const, int /*<<< orphan*/ *);
void show_char(FILE *fp, const char c) { fputc(c, fp); }


x86 assembly (clang, -O0):
<show_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_char>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @show_char(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i32*, i32** %3
%7 = call i32 @fputc(i8 signext %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @show_char(i32* nocapture %0, i8 signext %1) {
%3 = tail call i32 @fputc(i8 signext %1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astG3DLine(int n, float *x, float *y, float *z) {
  Report("astG3DLine");
  return 0;
}


x86 assembly (clang, -O0):
<astG3DLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <Report@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"astG3DLine\00"
define i32 @astG3DLine(i32 %0, float* %1, float* %2, float* %3) {
%5 = alloca i32
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store i32 %0, i32* %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = call i32 @Report(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"astG3DLine\00"
define i32 @astG3DLine(i32 %0, float* nocapture readnone %1, float* nocapture readnone %2, float* nocapture readnone %3) {
%5 = tail call i32 @Report(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct oscap_string {
  int dummy;
};
struct oscap_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oscap_buffer_free(struct oscap_buffer *);
void oscap_string_free(struct oscap_string *s) {
  oscap_buffer_free((struct oscap_buffer *)s);
}


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

x86 assembly (clang, -O2):
<oscap_string_free>:
jmp    1030 <oscap_buffer_free@plt>

LLVM IR (-O0):
%struct.oscap_string = type { i32 }
%struct.oscap_buffer = type { i32 }
define void @oscap_string_free(%struct.oscap_string* %0) {
%2 = alloca %struct.oscap_string*
store %struct.oscap_string* %0, %struct.oscap_string** %2
%3 = load %struct.oscap_string*, %struct.oscap_string** %2
%4 = bitcast %struct.oscap_string* %3 to %struct.oscap_buffer*
%5 = call i32 @oscap_buffer_free(%struct.oscap_buffer* %4)
ret void
}

LLVM IR (-O2):
%struct.oscap_string = type { i32 }
%struct.oscap_buffer = type { i32 }
define void @oscap_string_free(%struct.oscap_string* %0) {
%2 = bitcast %struct.oscap_string* %0 to %struct.oscap_buffer*
%3 = tail call i32 @oscap_buffer_free(%struct.oscap_buffer* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
char *strdup(char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
char *xstrdup(char *s) {
  if ((s = strdup(s)) == NULL)
    die("strdup: %s\n", strerror(errno));
  return s;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    116f <xstrdup+0x3f>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <xstrdup+0x2a>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"strdup: %s\0A\00"
@errno = global i32 0
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @die(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int bar(int, int);
int foo(int a, int b) {
  (void)bar(a, b);
  return bar(a, b);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <bar@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(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 = call i32 @bar(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @bar(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @bar(i32 %0, i32 %1)
%4 = tail call i32 @bar(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ perf_uncore_start(int);
int perf_uncore_setup(int nid) {
  if (perf_uncore_start(nid) != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<perf_uncore_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <perf_uncore_start@plt>
cmp    $0x0,%rax
je     1139 <perf_uncore_setup+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1140 <perf_uncore_setup+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_uncore_setup>:
push   %rax
call   1030 <perf_uncore_start@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @perf_uncore_setup(i32 %0) {
%2 = tail call i64 @perf_uncore_start(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void SNDDummyUnMuteAudio() {}


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

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

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

LLVM IR (-O2):
define void @SNDDummyUnMuteAudio() {
ret void
}
void QEIIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000028))) = ulIntFlags;
}


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

x86 assembly (clang, -O2):
<QEIIntClear>:
mov    %rsi,0x28(%rdi)
ret

LLVM IR (-O0):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 40
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = add i64 %0, 40
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
long umfpack_dl_scale(double *, double *, void *);
void umf4scal(double x[], double b[], void **Numeric, long *status) {
  *status = umfpack_dl_scale(x, b, *Numeric);
}


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

x86 assembly (clang, -O2):
<umf4scal>:
push   %rbx
mov    %rcx,%rbx
mov    (%rdx),%rdx
call   1030 <umfpack_dl_scale@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @umf4scal(double* %0, double* %1, i8** %2, i64* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i8**
%8 = alloca i64*
store double* %0, double** %5
store double* %1, double** %6
store i8** %2, i8*** %7
store i64* %3, i64** %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load i8**, i8*** %7
%12 = load i8*, i8** %11
%13 = call i64 @umfpack_dl_scale(double* %9, double* %10, i8* %12)
%14 = load i64*, i64** %8
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
define void @umf4scal(double* %0, double* %1, i8** nocapture %2, i64* nocapture writeonly %3) {
%5 = load i8*, i8** %2
%6 = tail call i64 @umfpack_dl_scale(double* %0, double* %1, i8* %5)
store i64 %6, i64* %3
ret void
}
/* Type definitions */
struct sysinfo {
  int totalram;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
int64_t get_totalmem(void) {
  struct sysinfo memInfo;
  sysinfo(&memInfo);
  int64_t totalVirtualMem = memInfo.totalram;
  totalVirtualMem = totalVirtualMem / 1024 / 1024;
  return totalVirtualMem;
}


x86 assembly (clang, -O0):
<get_totalmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <sysinfo@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_totalmem>:
push   %rax
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
mov    (%rsp),%ecx
lea    0xfffff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x14,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sysinfo = type { i32 }
define i32 @get_totalmem() {
%1 = alloca %struct.sysinfo
%2 = alloca i32
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 1024
%8 = sdiv i32 %7, 1024
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.sysinfo = type { i32 }
define i32 @get_totalmem() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1048576
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free2(void **);
void free2float(float **p) { free2((void **)p); }


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

x86 assembly (clang, -O2):
<free2float>:
jmp    1030 <free2@plt>

LLVM IR (-O0):
define void @free2float(float** %0) {
%2 = alloca float**
store float** %0, float*** %2
%3 = load float**, float*** %2
%4 = bitcast float** %3 to i8**
%5 = call i32 @free2(i8** %4)
ret void
}

LLVM IR (-O2):
define void @free2float(float** %0) {
%2 = bitcast float** %0 to i8**
%3 = tail call i32 @free2(i8** %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
void f(uint8_t *x) {
  uint8_t y[8];
  memcpy(x, y, 0);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <memcpy@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define void @f(i32* %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i32* %0, i32* %4, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
scalar_t__ isupper(int);
int isalpha(int c) { return (islower(c) || isupper(c)); }


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <isalpha+0x37>
mov    -0x4(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isalpha+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isupper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isupper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void BN_GF2m_mod_div_arr(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_mod_div_arr() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ randval;

/* Variables and functions */
int /*<<< orphan*/ cw_rand(int /*<<< orphan*/ *, int);
uint16_t cw_randint(int min, int max) {
  uint16_t randval;
  uint32_t diff;
  diff = max - min;
  cw_rand((uint8_t *)(&randval), sizeof(randval));
  return min + diff * randval / 0xffff;
}


x86 assembly (clang, -O0):
<cw_randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
call   1030 <cw_rand@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    $0xffff,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cw_randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %edi,%ebx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <cw_rand@plt>
imul   0x4(%rsp),%ebx
movslq %ebx,%rax
imul   $0xffffffff80008001,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xf,%eax
add    %ecx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cw_randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %6
%10 = call i32 @cw_rand(i32* %5, i32 4)
%11 = load i32, i32* %3
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = sdiv i32 %14, 65535
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @cw_randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = sub nsw i32 %1, %0
%6 = call i32 @cw_rand(i32* %3, i32 4)
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, %5
%9 = sdiv i32 %8, 65535
%10 = add nsw i32 %9, %0
ret i32 %10
}
float tenToMinus(int exp) {
  float result = 1;
  while (exp > 0) {
    result /= 10.0;
    exp--;
  }
  return result;
}


x86 assembly (clang, -O0):
<tenToMinus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  0xef1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114a <tenToMinus+0x4a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1114 <tenToMinus+0x14>
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tenToMinus>:
test   %edi,%edi
jle    1134 <tenToMinus+0x34>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x3,%ecx
je     113d <tenToMinus+0x3d>
xor    %edx,%edx
movss  0xee8(%rip),%xmm0
movss  0xee4(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x1,%edx
cmp    %edx,%ecx
jne    1120 <tenToMinus+0x20>
sub    %edx,%edi
cmp    $0x3,%eax
jae    114a <tenToMinus+0x4a>
jmp    1178 <tenToMinus+0x78>
movss  0xec4(%rip),%xmm0
ret
movss  0xebb(%rip),%xmm0
cmp    $0x3,%eax
jb     1178 <tenToMinus+0x78>
add    $0xffffffff,%edi
movss  0xeaf(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nop
divss  %xmm1,%xmm0
divss  %xmm1,%xmm0
divss  %xmm1,%xmm0
divss  %xmm1,%xmm0
add    $0xfffffffc,%edi
cmp    $0xfffffffe,%edi
jb     1160 <tenToMinus+0x60>
ret

LLVM IR (-O0):
define float @tenToMinus(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
store float 1.000000e+00, float* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fdiv double %9, 1.000000e+01
%11 = fptrunc double %10 to float
store float %11, float* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %12, -1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load float, float* %3
ret float %15
}

LLVM IR (-O2):
define float @tenToMinus(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %30
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %3, %7
%8 = phi float [ %11, %7 ], [ 1.000000e+00, %3 ]
%9 = phi i32 [ %12, %7 ], [ %0, %3 ]
%10 = phi i32 [ %13, %7 ], [ 0, %3 ]
%11 = fdiv float %8, 1.000000e+01
%12 = add nsw i32 %9, -1
%13 = add i32 %10, 1
%14 = icmp eq i32 %13, %5
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = phi float [ 1.000000e+00, %3 ], [ %11, %7 ]
%17 = phi i32 [ %0, %3 ], [ %12, %7 ]
%18 = phi float [ undef, %3 ], [ %11, %7 ]
%19 = icmp ult i32 %4, 3
br i1 %19, label %30, label %20
20: ; preds = %15, %20
%21 = phi float [ %26, %20 ], [ %16, %15 ]
%22 = phi i32 [ %27, %20 ], [ %17, %15 ]
%23 = fdiv float %21, 1.000000e+01
%24 = fdiv float %23, 1.000000e+01
%25 = fdiv float %24, 1.000000e+01
%26 = fdiv float %25, 1.000000e+01
%27 = add nsw i32 %22, -4
%28 = add i32 %22, -5
%29 = icmp ult i32 %28, -2
br i1 %29, label %20, label %30
30: ; preds = %15, %20, %1
%31 = phi float [ 1.000000e+00, %1 ], [ %18, %15 ], [ %26, %20 ]
ret float %31
}
/* Variables and functions */
scalar_t__ lua_check_number(int, char *);
scalar_t__ lua_getparam(int);
long lua_opt_number(int numArg, long def, char *funcname) {
  return (lua_getparam(numArg) == 0) ? def
                                     : (long)lua_check_number(numArg, funcname);
}


x86 assembly (clang, -O0):
<lua_opt_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lua_getparam@plt>
cmp    $0x0,%rax
jne    1152 <lua_opt_number+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <lua_opt_number+0x42>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <lua_check_number@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_opt_number>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1040 <lua_getparam@plt>
test   %rax,%rax
je     1144 <lua_opt_number+0x24>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <lua_check_number@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @lua_opt_number(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i64 @lua_getparam(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %16
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %6
%15 = call i64 @lua_check_number(i32 %13, i8* %14)
br label %16
16: ; preds = %12, %10
%17 = phi i64 [ %11, %10 ], [ %15, %12 ]
ret i64 %17
}

LLVM IR (-O2):
define i64 @lua_opt_number(i32 %0, i64 %1, i8* %2) {
%4 = tail call i64 @lua_getparam(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @lua_check_number(i32 %0, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i64 [ %7, %6 ], [ %1, %3 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xef() {
  Assert_real((isgraph(239) == 0),
              "/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_isgraph.c",
              1200, ("isgraph should be 0 for 0xef"));
}


x86 assembly (clang, -O0):
<t_isgraph_0xef>:
push   %rbp
mov    %rsp,%rbp
mov    $0xef,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4b0,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0xef>:
push   %rax
mov    $0xef,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b0,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xef\00"
define void @t_isgraph_0xef() {
%1 = call i64 @isgraph(i32 239)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1200, i8* getelementptr inbounds ([29 x i8], [29 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xef\00"
define void @t_isgraph_0xef() {
%1 = tail call i64 @isgraph(i32 239)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1200, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int track_count(int ch) {}


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

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

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

LLVM IR (-O2):
define i32 @track_count(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ reply(int, char *, char const *);
void nack(const char *s) { reply(502, "%s command not implemented.", s); }


x86 assembly (clang, -O0):
<nack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1f6,%edi
lea    0xed4(%rip),%rsi
call   1030 <reply@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nack>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1f6,%edi
jmp    1030 <reply@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s command not implemented.\00"
define void @nack(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @reply(i32 502, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s command not implemented.\00"
define void @nack(i8* %0) {
%2 = tail call i32 @reply(i32 502, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
void strip_newline(char *str, size_t len) {
  if (str[len] == '\n')
    str[len] = '\0';
}


x86 assembly (clang, -O0):
<strip_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    112d <strip_newline+0x2d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_newline>:
cmpb   $0xa,(%rdi,%rsi,1)
jne    110a <strip_newline+0xa>
movb   $0x0,(%rdi,%rsi,1)
ret

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

LLVM IR (-O2):
define void @strip_newline(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
store i8 0, i8* %3
br label %7
7: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned char volatile IN(int);
volatile unsigned char spiStatus(void) { return IN(0x01); }


x86 assembly (clang, -O0):
<spiStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <IN@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiStatus>:
mov    $0x1,%edi
jmp    1030 <IN@plt>

LLVM IR (-O0):
define zeroext i8 @spiStatus() {
%1 = call zeroext i8 @IN(i32 1)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @spiStatus() {
%1 = tail call zeroext i8 @IN(i32 1)
ret i8 %1
}
int test_imm_5Cint64_midword_reg(long long val) {
  return ((val >> 16) & (0x5C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Cint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x5c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Cint64_midword_reg>:
test   $0x5c0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Cint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 92
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_5Cint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6029312
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int gcd(int, int);
int /*<<< orphan*/ printf(char *);
int gen_publickey(int totient) {
  int i;
  for (i = 2; i < totient; i++) {
    if (gcd(totient, i) == 1)
      return i;
  }
  printf("\nEncryption failed...\n");
  exit(0);
}


x86 assembly (clang, -O0):
<gen_publickey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117e <gen_publickey+0x4e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <gcd@plt>
cmp    $0x1,%eax
jne    116b <gen_publickey+0x3b>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1170 <gen_publickey+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <gen_publickey+0x12>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<gen_publickey>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
jl     1155 <gen_publickey+0x25>
mov    %edi,%ebx
mov    $0x2,%ebp
nop
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <gcd@plt>
cmp    $0x1,%eax
je     1168 <gen_publickey+0x38>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <gen_publickey+0x10>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"\0AEncryption failed...\00"
define i32 @gen_publickey(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %11
3: ; preds = %1, %8
%4 = phi i32 [ %9, %8 ], [ 2, %1 ]
%5 = tail call i32 @gcd(i32 %0, i32 %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %3
ret i32 %4
8: ; preds = %3
%9 = add nuw nsw i32 %4, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %8, %1
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 0)
unreachable
}
char test19(void) { return '\v'; }


x86 assembly (clang, -O0):
<test19>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test19>:
mov    $0xb,%al
ret

LLVM IR (-O0):
define signext i8 @test19() {
ret i8 11
}

LLVM IR (-O2):
define signext i8 @test19() {
ret i8 11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void call(int a, void (*f)(int)) {
  printf("doing stuff\n");
  printf("a: %d\n", a);
  printf("going to call back\n");
  f(a * 2);
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
add    %ebx,%ebx
mov    %ebx,%edi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

LLVM IR (-O0):
@.str = [13 x i8] c"doing stuff\0A\00"
@.str.1 = [7 x i8] c"a: %d\0A\00"
@.str.2 = [20 x i8] c"going to call back\0A\00"
define void @call(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%9 = load void (i32)*, void (i32)** %4
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 2
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"a: %d\0A\00"
@str = [12 x i8] c"doing stuff\00"
@str.3 = [19 x i8] c"going to call back\00"
define void @call(i32 %0, void (i32)* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.3, i64 0, i64 0))
%6 = shl nsw i32 %0, 1
tail call void %1(i32 %6)
ret void
}
void show_buffers(const char *line, int offset,
                  struct sc_mountinfo_entry *entry) {}


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

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

LLVM IR (-O0):
%struct.sc_mountinfo_entry = type opaque
define void @show_buffers(i8* %0, i32 %1, %struct.sc_mountinfo_entry* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.sc_mountinfo_entry*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.sc_mountinfo_entry* %2, %struct.sc_mountinfo_entry** %6
ret void
}

LLVM IR (-O2):
%struct.sc_mountinfo_entry = type opaque
define void @show_buffers(i8* nocapture %0, i32 %1, %struct.sc_mountinfo_entry* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rmdir(char *);
int /*<<< orphan*/ unlink(char *);
void cleanup() {
  unlink("folder/file");
  unlink("folder/file-link");
  rmdir("folder");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed5(%rip),%rdi
call   1030 <unlink@plt>
lea    0xeda(%rip),%rdi
call   1040 <rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xed8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1040 <rmdir@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"folder/file\00"
@.str.1 = [17 x i8] c"folder/file-link\00"
@.str.2 = [7 x i8] c"folder\00"
define void @cleanup() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"folder/file\00"
@.str.1 = [17 x i8] c"folder/file-link\00"
@.str.2 = [7 x i8] c"folder\00"
define void @cleanup() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}