xunge/DecIR huggingface dataset:
/* Type definitions */
struct termios {
  int dummy;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
int /*<<< orphan*/ cfsetispeed(struct termios *, int /*<<< orphan*/);
int /*<<< orphan*/ cfsetospeed(struct termios *, int /*<<< orphan*/);
void set_speed(struct termios *config, speed_t speed) {
  cfsetispeed(config, speed);
  cfsetospeed(config, speed);
}


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

x86 assembly (clang, -O2):
<set_speed>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <cfsetispeed@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <cfsetospeed@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
define void @set_speed(%struct.termios* %0, i32 %1) {
%3 = alloca %struct.termios*
%4 = alloca i32
store %struct.termios* %0, %struct.termios** %3
store i32 %1, i32* %4
%5 = load %struct.termios*, %struct.termios** %3
%6 = load i32, i32* %4
%7 = call i32 @cfsetispeed(%struct.termios* %5, i32 %6)
%8 = load %struct.termios*, %struct.termios** %3
%9 = load i32, i32* %4
%10 = call i32 @cfsetospeed(%struct.termios* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define void @set_speed(%struct.termios* %0, i32 %1) {
%3 = tail call i32 @cfsetispeed(%struct.termios* %0, i32 %1)
%4 = tail call i32 @cfsetospeed(%struct.termios* %0, i32 %1)
ret void
}
/* Variables and functions */
char *getenv(char *);
char *FLAC_plugin__charset_get_current(void) {
  char *charset = getenv("CHARSET");
  if (!charset)
    charset = "ISO-8859-1";
  return charset;
}


x86 assembly (clang, -O0):
<FLAC_plugin__charset_get_current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <FLAC_plugin__charset_get_current+0x2e>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLAC_plugin__charset_get_current>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee1(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"CHARSET\00"
@.str.1 = [11 x i8] c"ISO-8859-1\00"
define i8* @FLAC_plugin__charset_get_current() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [8 x i8] c"CHARSET\00"
@.str.1 = [11 x i8] c"ISO-8859-1\00"
define i8* @FLAC_plugin__charset_get_current() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ draw_balls();
int /*<<< orphan*/ draw_string(int /*<<< orphan*/, scalar_t__, char *);
scalar_t__ screen_height();
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ wait_char();
int main() {
  setup_screen();
  draw_balls();
  draw_string(0, screen_height() - 1, "Press any key to finish...");
  wait_char();
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <setup_screen@plt>
mov    $0x0,%al
call   1060 <draw_balls@plt>
mov    $0x0,%al
call   1040 <screen_height@plt>
mov    %rax,%rsi
sub    $0x1,%rsi
xor    %edi,%edi
lea    0xe6c(%rip),%rdx
call   1080 <draw_string@plt>
mov    $0x0,%al
call   1050 <wait_char@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <setup_screen@plt>
xor    %eax,%eax
call   1060 <draw_balls@plt>
xor    %eax,%eax
call   1040 <screen_height@plt>
lea    -0x1(%rax),%rsi
lea    0xe7f(%rip),%rdx
xor    %edi,%edi
call   1080 <draw_string@plt>
xor    %eax,%eax
call   1050 <wait_char@plt>
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Press any key to finish...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 (...) @draw_balls()
%4 = call i64 (...) @screen_height()
%5 = sub nsw i64 %4, 1
%6 = call i32 @draw_string(i32 0, i64 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @wait_char()
%8 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Press any key to finish...\00"
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 (...) @draw_balls()
%3 = tail call i64 (...) @screen_height()
%4 = add nsw i64 %3, -1
%5 = tail call i32 @draw_string(i32 0, i64 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @wait_char()
%7 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ S_IRWXU;
int mkdir(char const *, int /*<<< orphan*/);
int file_mkdir(const char *dir) { return mkdir(dir, S_IRWXU); }


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

x86 assembly (clang, -O2):
<file_mkdir>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
@S_IRWXU = global i32 0
define i32 @file_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRWXU
%5 = call i32 @mkdir(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
define i32 @file_mkdir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRWXU
%3 = tail call i32 @mkdir(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
struct fifo_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct fifo_buf *);
void fifo_buf_free(struct fifo_buf *b) {
  assert(b != NULL);
  free(b);
}


x86 assembly (clang, -O0):
<fifo_buf_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_buf_free>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.fifo_buf = type { i32 }
define void @fifo_buf_free(%struct.fifo_buf* %0) {
%2 = alloca %struct.fifo_buf*
store %struct.fifo_buf* %0, %struct.fifo_buf** %2
%3 = load %struct.fifo_buf*, %struct.fifo_buf** %2
%4 = icmp ne %struct.fifo_buf* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.fifo_buf*, %struct.fifo_buf** %2
%8 = call i32 @free(%struct.fifo_buf* %7)
ret void
}

LLVM IR (-O2):
%struct.fifo_buf = type { i32 }
define void @fifo_buf_free(%struct.fifo_buf* %0) {
%2 = icmp ne %struct.fifo_buf* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(%struct.fifo_buf* %0)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int BinsonFieldComp(const void *a, const void *b) {
  char *fieldName1 = (char *)a;
  char *fieldName2 = (char *)b;
  int result = strcmp(fieldName1, fieldName2);
  if (result < 0)
    return -1;
  else if (result > 0)
    return 1;
  return result;
}


x86 assembly (clang, -O0):
<BinsonFieldComp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1156 <BinsonFieldComp+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <BinsonFieldComp+0x67>
cmpl   $0x0,-0x2c(%rbp)
jle    116c <BinsonFieldComp+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1177 <BinsonFieldComp+0x67>
jmp    1171 <BinsonFieldComp+0x61>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BinsonFieldComp>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BinsonFieldComp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
store i8* %9, i8** %6
%10 = load i8*, i8** %5
store i8* %10, i8** %7
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = call i32 @strcmp(i8* %11, i8* %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 -1, i32* %3
br label %24
17: ; preds = %2
%18 = load i32, i32* %8
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %3
br label %24
21: ; preds = %17
br label %22
22: ; preds = %21
%23 = load i32, i32* %8
store i32 %23, i32* %3
br label %24
24: ; preds = %22, %20, %16
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @BinsonFieldComp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int sprintf(char *, char *, unsigned char, unsigned char, unsigned char,
            unsigned char, int /*<<< orphan*/);
int unparse_ipv4_port(char *buffer, uint32_t ipaddr, uint16_t port) {
  unsigned char *ip;
  ip = (unsigned char *)&ipaddr;
  return sprintf(buffer, "%hhu.%hhu.%hhu.%hhu:%hu", ip[0], ip[1], ip[2], ip[3],
                 port);
}


x86 assembly (clang, -O0):
<unparse_ipv4_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%r9b
mov    -0x10(%rbp),%eax
lea    0xeab(%rip),%rsi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
mov    %eax,(%rsp)
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unparse_ipv4_port>:
push   %rax
mov    %esi,%ecx
shr    $0x10,%esi
mov    %ecx,%eax
shr    $0x18,%eax
mov    %edx,(%rsp)
movzbl %cl,%edx
movzbl %ch,%ecx
movzbl %sil,%r8d
lea    0xed1(%rip),%rsi
mov    %eax,%r9d
call   1030 <sprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"%hhu.%hhu.%hhu.%hhu:%hu\00"
define i32 @unparse_ipv4_port(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast i32* %5 to i8*
store i8* %8, i8** %7
%9 = load i8*, i8** %4
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = load i8*, i8** %7
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = load i8*, i8** %7
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = load i32, i32* %6
%23 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8 zeroext %12, i8 zeroext %15, i8 zeroext %18, i8 zeroext %21, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
@.str = [24 x i8] c"%hhu.%hhu.%hhu.%hhu:%hu\00"
define i32 @unparse_ipv4_port(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %1 to i8
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = lshr i32 %1, 24
%10 = trunc i32 %9 to i8
%11 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8 zeroext %4, i8 zeroext %6, i8 zeroext %8, i8 zeroext %10, i32 %2)
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_cpl_C(FILE *stream) {
  fprintf(stream, "CPL   C                         ");
}


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

x86 assembly (clang, -O2):
<fprint_cpl_C>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"CPL C \00"
define void @fprint_cpl_C(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"CPL C \00"
define void @fprint_cpl_C(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, long);
long ftell(int /*<<< orphan*/ *);
long fsize(FILE *file) {
  long current_pos = ftell(file);
  fseek(file, 0, SEEK_END);
  long res = ftell(file);
  fseek(file, 0, current_pos);
  return res;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%rdx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i64 0
define i64 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i64, i64* @SEEK_END
%9 = call i32 @fseek(i32* %7, i32 0, i64 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = call i32 @fseek(i32* %12, i32 0, i64 %13)
%15 = load i64, i64* %4
ret i64 %15
}

LLVM IR (-O2):
@SEEK_END = global i64 0
define i64 @fsize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i64, i64* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i32 0, i64 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = tail call i32 @fseek(i32* %0, i32 0, i64 %2)
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ key_L_trans(int /*<<< orphan*/);
int /*<<< orphan*/ s_substitute(int /*<<< orphan*/);
uint32_t key_T_trans(uint32_t x) { return (key_L_trans(s_substitute(x))); }


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

x86 assembly (clang, -O2):
<key_T_trans>:
push   %rax
call   1030 <s_substitute@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <key_L_trans@plt>

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

LLVM IR (-O2):
define i32 @key_T_trans(i32 %0) {
%2 = tail call i32 @s_substitute(i32 %0)
%3 = tail call i32 @key_L_trans(i32 %2)
ret i32 %3
}
/* Type definitions */
struct gdbserv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gdbserv_input_data_packet(struct gdbserv *, char const *,
                                             int);
void gdbserv_fromclient_data(struct gdbserv *gdbserv, const char *buf,
                             int len) {
  gdbserv_input_data_packet(gdbserv, buf, len);
}


x86 assembly (clang, -O0):
<gdbserv_fromclient_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <gdbserv_input_data_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbserv_fromclient_data>:
jmp    1030 <gdbserv_input_data_packet@plt>

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

LLVM IR (-O2):
%struct.gdbserv = type { i32 }
define void @gdbserv_fromclient_data(%struct.gdbserv* %0, i8* %1, i32 %2) {
%4 = tail call i32 @gdbserv_input_data_packet(%struct.gdbserv* %0, i8* %1, i32 %2)
ret void
}
int f(int i) { return ++i; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double criterion_getcputime(void) {
  struct timespec ts;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
  return ts.tv_sec + ts.tv_nsec * 1e-9;
}


x86 assembly (clang, -O0):
<criterion_getcputime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<criterion_getcputime>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @criterion_getcputime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-09, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @criterion_getcputime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
ret double %10
}
/* Variables and functions */
scalar_t__ is_newline(char);
scalar_t__ is_spacing(char);
int is_whitespace(char c) {
  if (is_spacing(c) || is_newline(c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <is_spacing@plt>
cmp    $0x0,%rax
jne    1154 <is_whitespace+0x34>
movsbl -0x5(%rbp),%edi
call   1040 <is_newline@plt>
cmp    $0x0,%rax
je     1160 <is_whitespace+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1167 <is_whitespace+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
%2 = tail call i64 @is_spacing(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_newline(i8 signext %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 gtk_text_iter_backward_visible_word_starts() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_backward_visible_word_starts() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void halt() {
  printf("\n Stopping Execution... \n");
  exit(0);
}


x86 assembly (clang, -O0):
<halt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [26 x i8] c"\0A Stopping Execution... \0A\00"
define void @halt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [25 x i8] c"\0A Stopping Execution... \00"
define void @halt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ft_memdel(void **);
void ft_strdel(char **as) {
  if (as)
    ft_memdel((void **)as);
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ft_strdel+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <ft_memdel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
test   %rdi,%rdi
je     111a <ft_strdel+0xa>
jmp    1030 <ft_memdel@plt>
ret

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @ft_memdel(i8** %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int acpi_detect();
int biosmptable_detect();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("acpi: %d\n", acpi_detect());
  printf("mptable: %d\n", biosmptable_detect());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <acpi_detect@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <biosmptable_detect@plt>
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"acpi: %d\0A\00"
@.str.1 = [13 x i8] c"mptable: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @acpi_detect()
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @biosmptable_detect()
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"acpi: %d\0A\00"
@.str.1 = [13 x i8] c"mptable: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @acpi_detect()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @biosmptable_detect()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello, OpenWRT!!!\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @RTStrDupNTag() {
ret void
}
/* Variables and functions */
unsigned long get_error_values(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
unsigned long ERR_get_error(void) {
  return (get_error_values(1, 0, NULL, NULL, NULL, NULL));
}


x86 assembly (clang, -O0):
<ERR_get_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <get_error_values@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_get_error>:
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <get_error_values@plt>

LLVM IR (-O0):
define i64 @ERR_get_error() {
%1 = call i64 @get_error_values(i32 1, i32 0, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @ERR_get_error() {
%1 = tail call i64 @get_error_values(i32 1, i32 0, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ write_APP0info();
int /*<<< orphan*/ write_DHTinfo();
int /*<<< orphan*/ write_DQTinfo();
int /*<<< orphan*/ write_SOF0info(unsigned int, unsigned int);
int /*<<< orphan*/ write_SOSinfo();
int /*<<< orphan*/ writeword(int);
void write_jpeg_header(unsigned int file_pointer, unsigned int height,
                       unsigned int width) {
  writeword(0xFFD8);
  write_APP0info();
  write_DQTinfo();
  write_SOF0info(height, width);
  write_DHTinfo();
  write_SOSinfo();
}


x86 assembly (clang, -O0):
<write_jpeg_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xffd8,%edi
call   1060 <writeword@plt>
mov    $0x0,%al
call   1030 <write_APP0info@plt>
mov    $0x0,%al
call   1070 <write_DQTinfo@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <write_SOF0info@plt>
mov    $0x0,%al
call   1040 <write_DHTinfo@plt>
mov    $0x0,%al
call   1080 <write_SOSinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_jpeg_header>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    $0xffd8,%edi
call   1060 <writeword@plt>
xor    %eax,%eax
call   1030 <write_APP0info@plt>
xor    %eax,%eax
call   1070 <write_DQTinfo@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <write_SOF0info@plt>
xor    %eax,%eax
call   1040 <write_DHTinfo@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1080 <write_SOSinfo@plt>

LLVM IR (-O0):
define void @write_jpeg_header(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @writeword(i32 65496)
%8 = call i32 (...) @write_APP0info()
%9 = call i32 (...) @write_DQTinfo()
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @write_SOF0info(i32 %10, i32 %11)
%13 = call i32 (...) @write_DHTinfo()
%14 = call i32 (...) @write_SOSinfo()
ret void
}

LLVM IR (-O2):
define void @write_jpeg_header(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @writeword(i32 65496)
%5 = tail call i32 (...) @write_APP0info()
%6 = tail call i32 (...) @write_DQTinfo()
%7 = tail call i32 @write_SOF0info(i32 %1, i32 %2)
%8 = tail call i32 (...) @write_DHTinfo()
%9 = tail call i32 (...) @write_SOSinfo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_GPIO_2bits(int, int);
void FLSv2MBusGPIO_resetCinDin() { set_GPIO_2bits(12, 13); }


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

x86 assembly (clang, -O2):
<FLSv2MBusGPIO_resetCinDin>:
mov    $0xc,%edi
mov    $0xd,%esi
jmp    1030 <set_GPIO_2bits@plt>

LLVM IR (-O0):
define void @FLSv2MBusGPIO_resetCinDin() {
%1 = call i32 @set_GPIO_2bits(i32 12, i32 13)
ret void
}

LLVM IR (-O2):
define void @FLSv2MBusGPIO_resetCinDin() {
%1 = tail call i32 @set_GPIO_2bits(i32 12, i32 13)
ret void
}
/* Variables and functions */
void ft_striter(char *s, void (*f)(char *)) {
  size_t i;
  i = 0;
  while (s[i]) {
    f(&s[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <ft_striter+0x49>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
add    -0x18(%rbp),%rdi
call   *%rax
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <ft_striter+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     1120 <ft_striter+0x20>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1110 <ft_striter+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %9, %5 ], [ %0, %2 ]
%7 = phi i64 [ %8, %5 ], [ 0, %2 ]
tail call void %1(i8* %6)
%8 = add i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
int test_imm_47int16_mem(short *val) {
  return ((*val) & (-0x47 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_47int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffffb9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_47int16_mem>:
movzwl (%rdi),%eax
test   $0xffb9,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_47int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -71
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ BindSocketInNewProc(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char *);
int main(int argc, char *argv[]) { BindSocketInNewProc(atoi(argv[1])); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
call   1040 <BindSocketInNewProc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @BindSocketInNewProc(i32 %5)
ret i32 0
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
void xclose(int fd) {
  if (close(fd) == -1)
    perror("Error in close()");
}


x86 assembly (clang, -O0):
<xclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1148 <xclose+0x28>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xclose>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     112d <xclose+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Error in close()\00"
define void @xclose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Error in close()\00"
define void @xclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fmt;

/* Variables and functions */
int rb_scan_args_trail_idx(char const *);
int rb_scan_args_hash_idx(const char *fmt) {
  const int idx = rb_scan_args_trail_idx(fmt);
  return idx + ((unsigned char)((fmt[idx]) - '0') < 10);
}


x86 assembly (clang, -O0):
<rb_scan_args_hash_idx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rb_scan_args_trail_idx@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
movzbl %cl,%ecx
cmp    $0xa,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_scan_args_hash_idx>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rb_scan_args_trail_idx@plt>
cltq
mov    (%rbx,%rax,1),%cl
add    $0xd0,%cl
cmp    $0xa,%cl
adc    $0x0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rb_scan_args_hash_idx(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @rb_scan_args_trail_idx(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = trunc i32 %13 to i8
%15 = zext i8 %14 to i32
%16 = icmp slt i32 %15, 10
%17 = zext i1 %16 to i32
%18 = add nsw i32 %6, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @rb_scan_args_hash_idx(i8* %0) {
%2 = tail call i32 @rb_scan_args_trail_idx(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = add i8 %5, -48
%7 = icmp ult i8 %6, 10
%8 = zext i1 %7 to i32
%9 = add nsw i32 %2, %8
ret i32 %9
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ buffered_write(int, int /*<<< orphan*/, char *, int);
char *read_buffered(int, int /*<<< orphan*/, int *);
int main(int argc, char *argv[]) {
  int c = 0, t = 0;
  int p = 0;
  char *buf = read_buffered(100, STDIN_FILENO, &c);
  buffered_write(100, STDOUT_FILENO, buf, c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0x2e7e(%rip),%rax
mov    (%rax),%esi
mov    $0x64,%edi
lea    -0x14(%rbp),%rdx
call   1030 <read_buffered@plt>
mov    %rax,-0x28(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x64,%edi
call   1040 <buffered_write@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
mov    $0x64,%edi
call   1030 <read_buffered@plt>
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%esi
mov    0x4(%rsp),%ecx
mov    $0x64,%edi
mov    %rax,%rdx
call   1040 <buffered_write@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%10 = load i32, i32* @STDIN_FILENO
%11 = call i8* @read_buffered(i32 100, i32 %10, i32* %6)
store i8* %11, i8** %9
%12 = load i32, i32* @STDOUT_FILENO
%13 = load i8*, i8** %9
%14 = load i32, i32* %6
%15 = call i32 @buffered_write(i32 100, i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
@STDOUT_FILENO = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = load i32, i32* @STDIN_FILENO
%6 = call i8* @read_buffered(i32 100, i32 %5, i32* %3)
%7 = load i32, i32* @STDOUT_FILENO
%8 = load i32, i32* %3
%9 = call i32 @buffered_write(i32 100, i32 %7, i8* %6, i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
int main(void) {
  int a = 42, foo(int a), b = 2;
  return foo(a + b);
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2c,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = call i32 @foo(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 44)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ EISDIR;
int /*<<< orphan*/ errno;
int readlink(char *, char *, int);
int /*<<< orphan*/ report_test2(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, char *);
void readlink_empty(void) {
  char buf[128];
  int rv;
  rv = readlink("", buf, sizeof(buf));
  report_test2(rv, errno, EISDIR, EINVAL, "readlink on empty string");
}


x86 assembly (clang, -O0):
<readlink_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rsi
lea    0xee2(%rip),%rdi
mov    $0x80,%edx
call   1030 <readlink@plt>
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
mov    0x2e6b(%rip),%rax
mov    (%rax),%ecx
lea    0xe92(%rip),%r8
call   1040 <report_test2@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink_empty>:
sub    $0x88,%rsp
lea    0xeea(%rip),%rdi
mov    %rsp,%rsi
mov    $0x80,%edx
call   1030 <readlink@plt>
mov    0x2e96(%rip),%rcx
mov    (%rcx),%esi
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%edx
mov    0x2e7c(%rip),%rcx
mov    (%rcx),%ecx
lea    0xea3(%rip),%r8
mov    %eax,%edi
add    $0x88,%rsp
jmp    1040 <report_test2@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@errno = global i32 0
@EISDIR = global i32 0
@EINVAL = global i32 0
@.str.1 = [25 x i8] c"readlink on empty string\00"
define void @readlink_empty() {
%1 = alloca [128 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = call i32 @readlink(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3, i32 128)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @errno
%7 = load i32, i32* @EISDIR
%8 = load i32, i32* @EINVAL
%9 = call i32 @report_test2(i32 %5, i32 %6, i32 %7, i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@errno = global i32 0
@EISDIR = global i32 0
@EINVAL = global i32 0
@.str.1 = [25 x i8] c"readlink on empty string\00"
define void @readlink_empty() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @readlink(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2, i32 128)
%4 = load i32, i32* @errno
%5 = load i32, i32* @EISDIR
%6 = load i32, i32* @EINVAL
%7 = tail call i32 @report_test2(i32 %3, i32 %4, i32 %5, i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void display(int *list, int size) {
  int i = 0;
  for (i = 0; i < size; i++)
    printf("%d ", list[i]);
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <display+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <display+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <display+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <display+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @display(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}