xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char);
char *skipSpaces(char *c) {
  char *cc = c;
  while (cc && *cc && isspace(*cc))
    cc++;
  return cc;
}


x86 assembly (clang, -O0):
<skipSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     115f <skipSpaces+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     115f <skipSpaces+0x4f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <skipSpaces+0x5f>
jmp    1180 <skipSpaces+0x70>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <skipSpaces+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpaces>:
push   %rbx
test   %rdi,%rdi
je     113b <skipSpaces+0x2b>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113d <skipSpaces+0x2d>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113d <skipSpaces+0x2d>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skipSpaces+0x10>
jmp    113d <skipSpaces+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipSpaces(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = tail call i64 @isspace(i8 signext %7)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %3, %1
%16 = phi i8* [ null, %1 ], [ %0, %3 ], [ %8, %6 ], [ %12, %11 ]
ret i8* %16
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ getpid();
int /*<<< orphan*/ sprintf(char *, char *, long);
int /*<<< orphan*/ system(char *);
void prmaps() {
  char buf[100];
  sprintf(buf, "/bin/cat /proc/%ld/maps", (long)getpid());
  system(buf);
  exit(1);
}


x86 assembly (clang, -O0):
<prmaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x78(%rbp),%rdi
mov    %rax,%rdx
lea    0xe98(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <system@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<prmaps>:
push   %rbx
sub    $0x70,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xead(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"/bin/cat /proc/%ld/maps\00"
define void @prmaps() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i64 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"/bin/cat /proc/%ld/maps\00"
define void @prmaps() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i64 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = call i32 @system(i8* %2)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ show_file(char *);
void show_events(void) { show_file("available_events"); }


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"available_events\00"
define void @show_events() {
%1 = tail call i32 @show_file(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strv_free(char **);
void strv_freep(char ***l) { strv_free(*l); }


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

x86 assembly (clang, -O2):
<strv_freep>:
mov    (%rdi),%rdi
jmp    1030 <strv_free@plt>

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

LLVM IR (-O2):
define void @strv_freep(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = tail call i32 @strv_free(i8** %2)
ret void
}
void of_reserved_mem_device_release(struct device *pdev) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define void @of_reserved_mem_device_release(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
define void @of_reserved_mem_device_release(%struct.device* nocapture %0) {
ret void
}
void X509_REQ_check_private_key(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_check_private_key() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Out(int, int, char);
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ sprintf(char, char *);
void frasecinco(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "5: Capuccino");
  LCD_Out(1, 3, plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<frasecinco>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1050 <sprintf@plt>
mov    $0x1,%edi
mov    $0x3,%esi
movsbl -0x1(%rbp),%edx
call   1040 <LCD_Out@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frasecinco>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1050 <sprintf@plt>
mov    $0x1,%edi
mov    $0x3,%esi
mov    %ebp,%edx
call   1040 <LCD_Out@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"5: Capuccino\00"
define void @frasecinco(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @LCD_Out(i32 1, i32 3, i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"5: Capuccino\00"
define void @frasecinco(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @LCD_Out(i32 1, i32 3, i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Variables and functions */
int ifile(char *);
int mlreply(char *, char *, int);
int insfile(int f, int n) {
  int s;
  char fname[32];
  if ((s = mlreply("Insert file: ", fname, 32)) != 1)
    return (s);
  return (ifile(fname));
}


x86 assembly (clang, -O0):
<insfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x20,%edx
call   1040 <mlreply@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x1,%eax
je     115a <insfile+0x3a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <insfile+0x46>
lea    -0x30(%rbp),%rdi
call   1030 <ifile@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insfile>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
mov    %rsp,%rsi
mov    $0x20,%edx
call   1040 <mlreply@plt>
cmp    $0x1,%eax
jne    1145 <insfile+0x25>
mov    %rsp,%rdi
call   1030 <ifile@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Insert file: \00"
define i32 @insfile(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [32 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%9 = call i32 @mlreply(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %8, i32 32)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %16
13: ; preds = %2
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%15 = call i32 @ifile(i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"Insert file: \00"
define i32 @insfile(i32 %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @mlreply(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i32 32)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @ifile(i8* %4)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xed() {
  Assert_real((isalpha(237) == 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_isalpha.c",
              1190, ("isalpha should be 0 for 0xed"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xed>:
push   %rax
mov    $0xed,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4a6,%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 = [29 x i8] c"isalpha should be 0 for 0xed\00"
define void @t_isalpha_0xed() {
%1 = call i64 @isalpha(i32 237)
%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 1190, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xed\00"
define void @t_isalpha_0xed() {
%1 = tail call i64 @isalpha(i32 237)
%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 1190, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void d(int x) { fprintf(stderr, "%c%d\n", 'd', x); }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x64,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x64,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 100, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @d(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 100, i32 %0)
ret void
}
void *netsnmp_generic_create_table(const char *name, int flags) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @netsnmp_generic_create_table(i8* nocapture readnone %0, i32 %1) {
ret i8* undef
}
/* Variables and functions */
char *malloc(long);
long read(int /*<<< orphan*/, char *, long);
long read_long();
int /*<<< orphan*/ x_perror(char *);
char *read_string() {
  long length = read_long();
  char *buf = malloc(length + 1);
  if (read(0, buf, length) != length)
    x_perror("read_string");
  buf[length] = 0;
  return buf;
}


x86 assembly (clang, -O0):
<read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <read_long@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
xor    %edi,%edi
call   1040 <read@plt>
cmp    -0x8(%rbp),%rax
je     1189 <read_string+0x49>
lea    0xe7c(%rip),%rdi
call   1030 <x_perror@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <read_long@plt>
mov    %rax,%rbx
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%r14
xor    %edi,%edi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1040 <read@plt>
cmp    %rbx,%rax
je     1178 <read_string+0x38>
lea    0xe8d(%rip),%rdi
call   1030 <x_perror@plt>
movb   $0x0,(%r14,%rbx,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"read_string\00"
define i8* @read_string() {
%1 = alloca i64
%2 = alloca i8*
%3 = call i64 (...) @read_long()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = add nsw i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = load i64, i64* %1
%9 = call i64 @read(i32 0, i8* %7, i64 %8)
%10 = load i64, i64* %1
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @x_perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %0
%15 = load i8*, i8** %2
%16 = load i64, i64* %1
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"read_string\00"
define noalias i8* @read_string() {
%1 = tail call i64 (...) @read_long()
%2 = add nsw i64 %1, 1
%3 = tail call i8* @malloc(i64 %2)
%4 = tail call i64 @read(i32 0, i8* %3, i64 %1)
%5 = icmp eq i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @x_perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = getelementptr inbounds i8, i8* %3, i64 %1
store i8 0, i8* %9
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_clr(void) { printf("\033[H\033[2J"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define void @display_clr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[H\1B[2J\00"
define void @display_clr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double rnd(void) {
  double d;
  d = rand() / (double)RAND_MAX;
  return (d);
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec2(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rnd() {
%1 = alloca double
%2 = call double (...) @rand()
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
store double %5, double* %1
%6 = load double, double* %1
ret double %6
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rnd() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
ret double %4
}
int empty(void *ctx) {
  ((void)ctx);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @empty(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void after() { puts("after====================="); }


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

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"after=====================\00"
define void @after() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *terminated_strncpy(char *dest, const char *src, size_t n) {
  size_t source_length = strlen(src);
  strncpy(dest, src, n);
  if (source_length >= n) {
    dest[n - 1] = '\0';
  } else {
    dest[source_length] = '\0';
  }
  return dest;
}


x86 assembly (clang, -O0):
<terminated_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1175 <terminated_strncpy+0x55>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1181 <terminated_strncpy+0x61>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminated_strncpy>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %rax,%r12
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
lea    -0x1(%rbx),%rax
cmp    %rbx,%r12
cmovb  %r12,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @terminated_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i64, i64* %7
%15 = load i64, i64* %6
%16 = icmp uge i64 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %3
%18 = load i8*, i8** %4
%19 = load i64, i64* %6
%20 = sub i64 %19, 1
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 0, i8* %21
br label %26
22: ; preds = %3
%23 = load i8*, i8** %4
%24 = load i64, i64* %7
%25 = getelementptr inbounds i8, i8* %23, i64 %24
store i8 0, i8* %25
br label %26
26: ; preds = %22, %17
%27 = load i8*, i8** %4
ret i8* %27
}

LLVM IR (-O2):
define i8* @terminated_strncpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%6 = icmp ult i64 %4, %2
%7 = add i64 %2, -1
%8 = select i1 %6, i64 %4, i64 %7
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret i8* %0
}
/* Type definitions */
union i2c_smbus_data {
  int /*<<< orphan*/ word;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u16;
typedef int /*<<< orphan*/ __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_WORD_DATA;
int /*<<< orphan*/ I2C_SMBUS_WRITE;
int /*<<< orphan*/ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/, union i2c_smbus_data *);
__s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 value) {
  union i2c_smbus_data data;
  data.word = value;
  return i2c_smbus_access(file, I2C_SMBUS_WRITE, command, I2C_SMBUS_WORD_DATA,
                          &data);
}


x86 assembly (clang, -O0):
<i2c_smbus_write_word_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2eab(%rip),%rax
mov    (%rax),%ecx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_write_word_data>:
push   %rax
mov    %esi,%eax
mov    %edx,(%rsp)
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
mov    %rsp,%r8
mov    %eax,%edx
call   1030 <i2c_smbus_access@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_WORD_DATA = global i32 0
define i32 @i2c_smbus_write_word_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.i2c_smbus_data
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = bitcast %union.i2c_smbus_data* %7 to i32*
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* @I2C_SMBUS_WRITE
%12 = load i32, i32* %5
%13 = load i32, i32* @I2C_SMBUS_WORD_DATA
%14 = call i32 @i2c_smbus_access(i32 %10, i32 %11, i32 %12, i32 %13, %union.i2c_smbus_data* %7)
ret i32 %14
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_WORD_DATA = global i32 0
define i32 @i2c_smbus_write_word_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.i2c_smbus_data
%5 = bitcast %union.i2c_smbus_data* %4 to i8*
%6 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = load i32, i32* @I2C_SMBUS_WRITE
%8 = load i32, i32* @I2C_SMBUS_WORD_DATA
%9 = call i32 @i2c_smbus_access(i32 %0, i32 %7, i32 %1, i32 %8, %union.i2c_smbus_data* %4)
ret i32 %9
}
/* Variables and functions */
scalar_t__ is_in_set(char, char *);
int is_aa(char x) {
  return (is_in_set(x, "acdefghiklmnpqrstvwy-ACDEFGHIKLMNPQRSTVWY") &&
          !is_in_set(x, "-.#*~"));
}


x86 assembly (clang, -O0):
<is_aa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1030 <is_in_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     115c <is_aa+0x4c>
lea    0xee3(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1030 <is_in_set@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_aa>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rsi
call   1030 <is_in_set@plt>
test   %rax,%rax
je     1140 <is_aa+0x30>
movsbl %bl,%edi
lea    0xefc(%rip),%rsi
call   1030 <is_in_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"acdefghiklmnpqrstvwy-ACDEFGHIKLMNPQRSTVWY\00"
@.str.1 = [6 x i8] c"-.#*~\00"
define i32 @is_aa(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @is_in_set(i8 signext %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @is_in_set(i8 signext %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [42 x i8] c"acdefghiklmnpqrstvwy-ACDEFGHIKLMNPQRSTVWY\00"
@.str.1 = [6 x i8] c"-.#*~\00"
define i32 @is_aa(i8 signext %0) {
%2 = tail call i64 @is_in_set(i8 signext %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @is_in_set(i8 signext %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
unsigned int_hash(const void *key) { return (int)key; }


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

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

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

LLVM IR (-O2):
define i32 @int_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
void __attribute__((format(printf, 3, 4)))
ATH5K_DBG_UNLIMIT(struct ath5k_softc *sc, unsigned int m, const char *fmt,
                  ...) {}


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

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

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

LLVM IR (-O2):
%struct.ath5k_softc = type opaque
define void @ATH5K_DBG_UNLIMIT(%struct.ath5k_softc* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
CS_PLUGIN_NAMESPACE_BEGIN(XMLShader) {}


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

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

LLVM IR (-O0):
define i32 @CS_PLUGIN_NAMESPACE_BEGIN(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 @CS_PLUGIN_NAMESPACE_BEGIN(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int ENODEV;
int /*<<< orphan*/ gpio_free(unsigned int const);
int /*<<< orphan*/ gpio_is_valid_port(unsigned int const);
int __p2ioport_unlock_gpio(const unsigned int gpio) {
  int retval = 0;
  if (!gpio_is_valid_port(gpio)) {
    retval = -ENODEV;
    goto fail;
  }
  gpio_free(gpio);
fail:
  return retval;
}


x86 assembly (clang, -O0):
<__p2ioport_unlock_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gpio_is_valid_port@plt>
cmp    $0x0,%eax
jne    1156 <__p2ioport_unlock_gpio+0x36>
xor    %eax,%eax
mov    0x2e94(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x8(%rbp)
jmp    115e <__p2ioport_unlock_gpio+0x3e>
mov    -0x4(%rbp),%edi
call   1030 <gpio_free@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__p2ioport_unlock_gpio>:
push   %rbx
mov    %edi,%ebx
call   1040 <gpio_is_valid_port@plt>
test   %eax,%eax
je     1137 <__p2ioport_unlock_gpio+0x17>
mov    %ebx,%edi
call   1030 <gpio_free@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2ea2(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @__p2ioport_unlock_gpio(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @gpio_is_valid_port(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @ENODEV
%9 = sub nsw i32 0, %8
store i32 %9, i32* %3
br label %13
10: ; preds = %1
%11 = load i32, i32* %2
%12 = call i32 @gpio_free(i32 %11)
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @__p2ioport_unlock_gpio(i32 %0) {
%2 = tail call i32 @gpio_is_valid_port(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
br label %9
7: ; preds = %1
%8 = tail call i32 @gpio_free(i32 %0)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ 0, %7 ], [ %6, %4 ]
ret i32 %10
}
void nf_defrag_ipv6_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @nf_defrag_ipv6_enable() {
ret void
}
void NodeNumTo2DGridIdx(const int nNode, const double node2xy,
                        int node2grid_x[], int node2grid_y[]) {}


x86 assembly (clang, -O0):
<NodeNumTo2DGridIdx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @NodeNumTo2DGridIdx(i32 %0, double %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store double %1, double* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
define void @NodeNumTo2DGridIdx(i32 %0, double %1, i32* nocapture %2, i32* nocapture %3) {
ret void
}
int inter_mapif_init(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @inter_mapif_init(i32 %0) {
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ timespec_sub(struct timespec *, struct timespec const *,
                                struct timespec const *);
int /*<<< orphan*/ timespec_to_nsec(struct timespec *);
int64_t timespec_sub_to_nsec(const struct timespec *a,
                             const struct timespec *b) {
  struct timespec r;
  timespec_sub(&r, a, b);
  return timespec_to_nsec(&r);
}


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

x86 assembly (clang, -O2):
<timespec_sub_to_nsec>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <timespec_sub@plt>
mov    %rbx,%rdi
call   1030 <timespec_to_nsec@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @timespec_sub_to_nsec(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
%5 = alloca %struct.timespec
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @timespec_sub(%struct.timespec* %5, %struct.timespec* %6, %struct.timespec* %7)
%9 = call i32 @timespec_to_nsec(%struct.timespec* %5)
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @timespec_sub_to_nsec(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = call i32 @timespec_sub(%struct.timespec* %3, %struct.timespec* %0, %struct.timespec* %1)
%6 = call i32 @timespec_to_nsec(%struct.timespec* %3)
ret i32 %6
}
/* Type definitions */
struct nmpa_s {
  int dummy;
};

/* Variables and functions */
scalar_t__ nmpa_alloc(struct nmpa_s *, size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *nmpa_strdup(struct nmpa_s *nmpa, const char *str) {
  size_t len = strlen(str);
  char *dst = (char *)nmpa_alloc(nmpa, len + 1);
  if (dst) {
    strcpy(dst, str);
  }
  return dst;
}


x86 assembly (clang, -O0):
<nmpa_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x1,%rsi
call   1050 <nmpa_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117a <nmpa_strdup+0x4a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmpa_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
call   1050 <nmpa_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <nmpa_strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.nmpa_s = type { i32 }
define i8* @nmpa_strdup(%struct.nmpa_s* %0, i8* %1) {
%3 = alloca %struct.nmpa_s*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store %struct.nmpa_s* %0, %struct.nmpa_s** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load %struct.nmpa_s*, %struct.nmpa_s** %3
%10 = load i64, i64* %5
%11 = add i64 %10, 1
%12 = call i64 @nmpa_alloc(%struct.nmpa_s* %9, i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i8*, i8** %6
%18 = load i8*, i8** %4
%19 = call i32 @strcpy(i8* %17, i8* %18)
br label %20
20: ; preds = %16, %2
%21 = load i8*, i8** %6
ret i8* %21
}

LLVM IR (-O2):
%struct.nmpa_s = type { i32 }
define i8* @nmpa_strdup(%struct.nmpa_s* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add i64 %3, 1
%5 = tail call i64 @nmpa_alloc(%struct.nmpa_s* %0, i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = tail call i32 @strcpy(i8* %6, i8* %1)
br label %10
10: ; preds = %8, %2
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int __unimplemented_syscall(const char *name) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<__unimplemented_syscall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__unimplemented_syscall>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__unimplemented_syscall(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @__unimplemented_syscall(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello 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 = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_5Aint64_lowword_reg(long long val) {
  return ((val) & (0x5A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Aint64_lowword_reg>:
test   $0x5a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Aint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 90
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ crypto_global_cleanup();
void subsys_crypto_shutdown(void) { crypto_global_cleanup(); }


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

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

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

LLVM IR (-O2):
define void @subsys_crypto_shutdown() {
%1 = tail call i32 (...) @crypto_global_cleanup()
ret void
}
int stringLength_a(char string[]) {
  int index = 0;
  while (string[index] != '\0') {
    index++;
  }
  return index;
}


x86 assembly (clang, -O0):
<stringLength_a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <stringLength_a+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stringLength_a+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength_a>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength_a+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLength_a(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int strlen(char *);
char *strest(char *s, int n) { return (s + strlen(s) - n); }


x86 assembly (clang, -O0):
<strest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strest>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
movslq %ebp,%rcx
sub    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strest(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = sub i64 0, %11
%13 = getelementptr inbounds i8, i8* %9, i64 %12
ret i8* %13
}

LLVM IR (-O2):
define i8* @strest(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = sext i32 %1 to i64
%7 = sub nsw i64 0, %6
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}
int __ocl_convert_int_short(short src) { return (int)src; }


x86 assembly (clang, -O0):
<__ocl_convert_int_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_convert_int_short>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @__ocl_convert_int_short(i16 signext %0) {
%2 = sext i16 %0 to i32
ret i32 %2
}
/* Variables and functions */
int add(int, int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
main() {
  int a = 9;
  int b = 4;
  int c = 2;
  assert(a + b + c == add(a, b, c));
  printf("myadd test passed.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <add@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
mov    $0x4,%esi
mov    $0x2,%edx
call   1030 <add@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"myadd test passed.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 9, i32* %2
store i32 4, i32* %3
store i32 2, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @add(i32 %10, i32 %11, i32 %12)
%14 = icmp eq i32 %9, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"myadd test passed.\00"
define i32 @main() {
%1 = tail call i32 @add(i32 9, i32 4, i32 2)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
void set_XKeyEvent_type(void *_p, int _v) { ((XKeyEvent *)_p)->type = (int)_v; }


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

x86 assembly (clang, -O2):
<set_XKeyEvent_type>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XKeyEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}