xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ setopt(char *, char *);
char *strtok(char *, char *);
void evalueateopt(char *evaluation) {
  char *parname;
  char *parvalue;
  parname = strtok(evaluation, "=");
  parvalue = strtok(NULL, "=");
  setopt(parname, parvalue);
}


x86 assembly (clang, -O0):
<evalueateopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb5(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <setopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalueateopt>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %r14,%rsi
call   1030 <strtok@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <setopt@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
define void @evalueateopt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @setopt(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @evalueateopt(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @setopt(i8* %2, i8* %3)
ret void
}
/* Type definitions */
typedef scalar_t__ cl_int;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
char *get_error_string(scalar_t__);
int /*<<< orphan*/ stderr;
void assert(int cond, cl_int err, const char *desc) {
  if (!cond) {
    fprintf(stderr, "ERROR: %s %s\n", get_error_string(err), desc);
    exit((int)err);
  }
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1183 <assert+0x53>
mov    0x2e8c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_error_string@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rdx
mov    -0x18(%rbp),%rcx
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1135 <assert+0x5>
ret
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    0x2e9a(%rip),%rax
mov    (%rax),%ebp
mov    %rsi,%rdi
call   1030 <get_error_string@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    %r14d,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"ERROR: %s %s\0A\00"
define void @assert(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %18, label %9
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = load i64, i64* %5
%12 = call i8* @get_error_string(i64 %11)
%13 = load i8*, i8** %6
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = load i64, i64* %5
%16 = trunc i64 %15 to i32
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"ERROR: %s %s\0A\00"
define void @assert(i32 %0, i64 %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i8* @get_error_string(i64 %1)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %2)
%9 = trunc i64 %1 to i32
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_value(int, int);
void module_motor_on(void) { gpio_set_value(21, 1); }


x86 assembly (clang, -O0):
<module_motor_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
mov    $0x1,%esi
call   1030 <gpio_set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_motor_on>:
mov    $0x15,%edi
mov    $0x1,%esi
jmp    1030 <gpio_set_value@plt>

LLVM IR (-O0):
define void @module_motor_on() {
%1 = call i32 @gpio_set_value(i32 21, i32 1)
ret void
}

LLVM IR (-O2):
define void @module_motor_on() {
%1 = tail call i32 @gpio_set_value(i32 21, i32 1)
ret void
}
int tlbtrace_init(void) {}


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

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

LLVM IR (-O0):
define i32 @tlbtrace_init() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @tlbtrace_init() {
ret i32 undef
}
void ARGBToARGB4444Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB4444Row_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lcd_cmd(int);
void lcd_on() { lcd_cmd(0x0E); }


x86 assembly (clang, -O0):
<lcd_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe,%edi
call   1030 <lcd_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_on>:
mov    $0xe,%edi
jmp    1030 <lcd_cmd@plt>

LLVM IR (-O0):
define void @lcd_on() {
%1 = call i32 @lcd_cmd(i32 14)
ret void
}

LLVM IR (-O2):
define void @lcd_on() {
%1 = tail call i32 @lcd_cmd(i32 14)
ret void
}
int print(const char *format, ...) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @print(i8* nocapture readnone %0, ...) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr, "Usage: muss-with-environ command [command args..]\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: muss-with-environ command [command args..]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: muss-with-environ command [command args..]\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ i;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(int *, int, int, int /*<<< orphan*/ *);
size_t write_int(FILE *fp, int i) { return fwrite(&i, sizeof(i), 1, fp); }


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rax
mov    %rdi,%rcx
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @write_int(i32* nocapture %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putendl(char const *s) {
  int i;
  if (s) {
    i = 0;
    while (s[i]) {
      ft_putchar(s[i++]);
    }
  }
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <ft_putendl+0x55>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1160 <ft_putendl+0x50>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    112e <ft_putendl+0x1e>
jmp    1165 <ft_putendl+0x55>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rbx
test   %rdi,%rdi
je     1143 <ft_putendl+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <ft_putendl+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putendl+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8 [ %12, %6 ], [ %4, %3 ]
%9 = add nuw i64 %7, 1
%10 = tail call i32 @ft_putchar(i8 signext %8)
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
%15 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stpncpy(char *, char *, int);
int main(int argc, char *argv[]) {
  char testData[4];
  testData[0] = 'A';
  testData[1] = 'B';
  testData[2] = 'C';
  testData[3] = '\0';
  stpncpy(&testData[0], &testData[2], 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x41,-0x14(%rbp)
movb   $0x42,-0x13(%rbp)
movb   $0x43,-0x12(%rbp)
movb   $0x0,-0x11(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x14(%rbp),%rsi
add    $0x2,%rsi
mov    $0x2,%edx
call   1030 <stpncpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x434241,0x4(%rsp)
lea    0x6(%rsp),%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <stpncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
store i8 65, i8* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
store i8 66, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
store i8 67, i8* %9
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 3
store i8 0, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
%13 = call i32 @stpncpy(i8* %11, i8* %12, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 65, i8* %4
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 66, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 67, i8* %6
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 0, i8* %7
%8 = call i32 @stpncpy(i8* %4, i8* %6, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EA_A7_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_pd7(void) { m68ki_write_8(EA_A7_PD_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_pd7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_A7_PD_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_st_8_pd7>:
push   %rax
xor    %eax,%eax
call   1030 <EA_A7_PD_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_st_8_pd7() {
%1 = call i32 (...) @EA_A7_PD_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_pd7() {
%1 = tail call i32 (...) @EA_A7_PD_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_error_string(int /*<<< orphan*/, char *);
int /*<<< orphan*/ ERR_get_error();
int /*<<< orphan*/ ERR_load_crypto_strings();
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void print_last_error() {
  char *err = calloc(1, sizeof(char) * 130);
  ERR_load_crypto_strings();
  ERR_error_string(ERR_get_error(), err);
  printf("rsa error: %s\n", err);
  free(err);
}


x86 assembly (clang, -O0):
<print_last_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x82,%esi
call   1050 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1080 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1070 <ERR_get_error@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1060 <ERR_error_string@plt>
mov    -0x8(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_last_error>:
push   %rbx
mov    $0x1,%edi
mov    $0x82,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1080 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   1070 <ERR_get_error@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1060 <ERR_error_string@plt>
lea    0xe6e(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"rsa error: %s\0A\00"
define void @print_last_error() {
%1 = alloca i8*
%2 = call i8* @calloc(i32 1, i32 130)
store i8* %2, i8** %1
%3 = call i32 (...) @ERR_load_crypto_strings()
%4 = call i32 (...) @ERR_get_error()
%5 = load i8*, i8** %1
%6 = call i32 @ERR_error_string(i32 %4, i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"rsa error: %s\0A\00"
define void @print_last_error() {
%1 = tail call dereferenceable_or_null(130) i8* @calloc(i32 1, i32 130)
%2 = tail call i32 (...) @ERR_load_crypto_strings()
%3 = tail call i32 (...) @ERR_get_error()
%4 = tail call i32 @ERR_error_string(i32 %3, i8* %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @free(i8* %1)
ret void
}
int do_457() { return 457; }


x86 assembly (clang, -O0):
<do_457>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c9,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_457() {
ret i32 457
}

LLVM IR (-O2):
define i32 @do_457() {
ret i32 457
}
double valkii(double e) {
  double ten_e = 10 * e;
  double sqr_e = e * e;
  double sqr_ten_e = ten_e * ten_e;
  return sqr_ten_e - sqr_e;
}


x86 assembly (clang, -O0):
<valkii>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<valkii>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @valkii(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fmul double 1.000000e+01, %6
store double %7, double* %3
%8 = load double, double* %2
%9 = load double, double* %2
%10 = fmul double %8, %9
store double %10, double* %4
%11 = load double, double* %3
%12 = load double, double* %3
%13 = fmul double %11, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = load double, double* %4
%16 = fsub double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @valkii(double %0) {
%2 = fmul double %0, 1.000000e+01
%3 = fmul double %0, %0
%4 = fmul double %2, %2
%5 = fsub double %4, %3
ret double %5
}
int putshort(char **dst, unsigned short value) {
  unsigned char *p;
  p = (unsigned char *)*dst;
  *p++ = (value >> 8);
  *p++ = value;
  (*dst) = (char *)p;
  return sizeof(short);
}


x86 assembly (clang, -O0):
<putshort>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0xa(%rbp),%ax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<putshort>:
mov    (%rdi),%rax
rol    $0x8,%si
mov    %si,(%rax)
add    $0x2,%rax
mov    %rax,(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @putshort(i8** %0, i16 zeroext %1) {
%3 = alloca i8**
%4 = alloca i16
%5 = alloca i8*
store i8** %0, i8*** %3
store i16 %1, i16* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
store i8 %11, i8* %12
%14 = load i16, i16* %4
%15 = trunc i16 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %5
store i8 %15, i8* %16
%18 = load i8*, i8** %5
%19 = load i8**, i8*** %3
store i8* %18, i8** %19
ret i32 2
}

LLVM IR (-O2):
define i32 @putshort(i8** nocapture %0, i16 zeroext %1) {
%3 = load i8*, i8** %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %7, i8* %6
store i8* %8, i8** %0
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ isAlive();
int isDead(void) { return !isAlive(); }


x86 assembly (clang, -O0):
<isDead>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <isAlive@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDead>:
push   %rax
xor    %eax,%eax
call   1030 <isAlive@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isDead() {
%1 = call i32 (...) @isAlive()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @isDead() {
%1 = tail call i32 (...) @isAlive()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int __test_and_clear_bit(int nr, unsigned long *p) {
  unsigned long oldval;
  unsigned long mask;
  mask = 1UL << (nr & 31);
  p += nr >> 5;
  oldval = (unsigned long)(*p);
  (*p) = (unsigned long)(oldval & ~mask);
  return ((int)(oldval & mask));
}


x86 assembly (clang, -O0):
<__test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
and    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_clear_bit>:
mov    %edi,%ecx
mov    %edi,%eax
mov    %ecx,%edx
and    $0x1f,%dl
sar    $0x5,%eax
movslq %eax,%r8
mov    (%rsi,%r8,8),%rax
mov    %rax,%rdi
btr    %rdx,%rdi
mov    %rdi,(%rsi,%r8,8)
mov    $0x1,%edx
shl    %cl,%edx
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = and i32 %7, 31
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
store i64 %10, i64* %6
%11 = load i32, i32* %3
%12 = ashr i32 %11, 5
%13 = load i64*, i64** %4
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i64, i64* %13, i64 %14
store i64* %15, i64** %4
%16 = load i64*, i64** %4
%17 = load i64, i64* %16
store i64 %17, i64* %5
%18 = load i64, i64* %5
%19 = load i64, i64* %6
%20 = xor i64 %19, -1
%21 = and i64 %18, %20
%22 = load i64*, i64** %4
store i64 %21, i64* %22
%23 = load i64, i64* %5
%24 = load i64, i64* %6
%25 = and i64 %23, %24
%26 = trunc i64 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @__test_and_clear_bit(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = ashr i32 %0, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = xor i64 %5, -1
%11 = and i64 %9, %10
store i64 %11, i64* %8
%12 = and i64 %9, %5
%13 = trunc i64 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int read_array(int arr[]) {
  int i, n;
  scanf("%d", &n);
  for (i = 0; i < n; i++)
    scanf("%d", &arr[i]);
  return n;
}


x86 assembly (clang, -O0):
<read_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1168 <read_array+0x58>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1030 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <read_array+0x23>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_array>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r15
lea    0xedd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    115d <read_array+0x4d>
xor    %ebx,%ebx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1140 <read_array+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @read_array(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1, %7
%8 = phi i64 [ %11, %7 ], [ 0, %1 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %1
%16 = phi i32 [ %5, %1 ], [ %12, %7 ]
ret i32 %16
}
/* Variables and functions */
double __infer_nondet_double();
double nearbyint(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<nearbyint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @nearbyint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @nearbyint(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ mpack_load_u16(char const *);
int16_t mpack_load_i16(const char *p) { return (int16_t)mpack_load_u16(p); }


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

x86 assembly (clang, -O2):
<mpack_load_i16>:
jmp    1030 <mpack_load_u16@plt>

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

LLVM IR (-O2):
define i32 @mpack_load_i16(i8* %0) {
%2 = tail call i32 @mpack_load_u16(i8* %0)
ret i32 %2
}
int __tsan_symbolize(void *pc, char **img, char **rtn, char **file, int *l) {
  return 0;
}


x86 assembly (clang, -O0):
<__tsan_symbolize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__tsan_symbolize(i8* %0, i8** %1, i8** %2, i8** %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32*
store i8* %0, i8** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32* %4, i32** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @__tsan_symbolize(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2, i8** nocapture readnone %3, i32* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
char *get_talpa_device(char *, char *);
char *get_talpa_pedevice(void) {
  return get_talpa_device(
      "talpa-pe", "/filter-interfaces/DeviceDriverProcessExclusion/device");
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"talpa-pe\00"
@.str.1 = [55 x i8] c"/filter-interfaces/DeviceDriverProcessExclusion/device\00"
define i8* @get_talpa_pedevice() {
%1 = call i8* @get_talpa_device(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"talpa-pe\00"
@.str.1 = [55 x i8] c"/filter-interfaces/DeviceDriverProcessExclusion/device\00"
define i8* @get_talpa_pedevice() {
%1 = tail call i8* @get_talpa_device(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B, X;
  scanf("%d %d", &A, &B);
  X = A + B;
  printf("X = %d\n", X);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
void foo(int *buf, int len) {
  for (int i = 0; i < len; i++)
    buf[i] = 0;
  int x = buf[len];
  buf[len] = x + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <foo+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <foo+0x12>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   %esi,%esi
jle    112c <foo+0x1c>
mov    %ebp,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
movslq %ebp,%rax
addl   $0x1,(%rbx,%rax,4)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
ret void
}
/* Variables and functions */
int u_is_ascii_only_impl(char const *, int /*<<< orphan*/, int);
bool u_is_ascii_only(const char *string) {
  return u_is_ascii_only_impl(string, 0, false);
}


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

x86 assembly (clang, -O2):
<u_is_ascii_only>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <u_is_ascii_only_impl@plt>

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

LLVM IR (-O2):
define i32 @u_is_ascii_only(i8* %0) {
%2 = tail call i32 @u_is_ascii_only_impl(i8* %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
char *strrchr(char *, char);
int checkExtension(char *s, char *extension) {
  char *dot = strrchr(s, '.');
  if (dot == NULL)
    return 0;
  return strcmp(dot, extension) == 0;
}


x86 assembly (clang, -O0):
<checkExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <checkExtension+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1175 <checkExtension+0x55>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkExtension>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     114b <checkExtension+0x2b>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @checkExtension(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* %1)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
char *strrchr(const char *str, int ch) {
  const char *out = NULL;
  do {
    if (*str == ch) {
      out = str;
    }
  } while (*str++);
  return (char *)out;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <strrchr+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i8* [ null, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = select i1 %8, i8* %4, i8* %5
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = icmp eq i8 %6, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %9
}
/* Variables and functions */
int strtol(char const *const, char **, int);
int strtoint(const char *const str) {
  char *endptr;
  const int r = strtol(str, &endptr, 10);
  if (*endptr)
    return -1;
  return r;
}


x86 assembly (clang, -O0):
<strtoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <strtoint+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <strtoint+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoint>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    (%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @strtoint(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i32 %4, i32 -1
ret i32 %8
}
void fixname(char *s) {
  while (*s && *s++ != 10)
    ;
  if (!*s)
    return;
  *(--s) = 0;
}


x86 assembly (clang, -O0):
<fixname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1138 <fixname+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1148 <fixname+0x48>
jmp    114d <fixname+0x4d>
jmp    1108 <fixname+0x8>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    115f <fixname+0x5f>
jmp    1172 <fixname+0x72>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,-0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixname>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <fixname+0x18>
add    $0x1,%rdi
cmp    $0xa,%al
jne    1100 <fixname>
cmpb   $0x0,(%rdi)
je     1118 <fixname+0x18>
movb   $0x0,-0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @fixname(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = icmp eq i8 %4, 10
br i1 %8, label %9, label %2
9: ; preds = %6
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9
store i8 0, i8* %3
br label %13
13: ; preds = %2, %9, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char);
int /*<<< orphan*/ stdout;
void print_bytes(unsigned char *buffer, int length) {
  int i;
  for (i = 0; i < length; i++) {
    fprintf(stdout, "%#x\n", *(buffer + i));
  }
}


x86 assembly (clang, -O0):
<print_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <print_bytes+0x51>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xeb6(%rip),%rsi
movzbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_bytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bytes>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %esi,%esi
jle    115a <print_bytes+0x4a>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
mov    0x2eb4(%rip),%r13
lea    0xecd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13),%edi
movzbl (%r15,%rbx,1),%edx
mov    %r14,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_bytes+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%#x\0A\00"
define void @print_bytes(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = load i32, i32* @stdout
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
char *double_to_char(double n, char *s) {
  sprintf(s, "%lf", n);
  return (s);
}


x86 assembly (clang, -O0):
<double_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_char>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i8* @double_to_char(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load double, double* %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i8* @double_to_char(double %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %1
}
/* Variables and functions */
double cos(double);
double cbuiltin_cos(double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_cos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @cbuiltin_cos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}