xunge/DecIR huggingface dataset:
void int2_char(int i, unsigned char *p) {
  int sign = 0;
  if (i < 0) {
    sign = 128;
    i = -i;
  }
  p[0] = ((i >> 8) & 127) | sign;
  p[1] = i & 255;
  return;
}


x86 assembly (clang, -O0):
<int2_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112b <int2_char+0x2b>
movl   $0x80,-0x14(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0x7f,%eax
or     -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2_char>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
shr    $0x18,%edi
and    $0xffffff80,%edi
mov    %eax,%ecx
shr    $0x8,%ecx
and    $0x7f,%ecx
or     %edi,%ecx
mov    %cl,(%rsi)
mov    %al,0x1(%rsi)
ret

LLVM IR (-O0):
define void @int2_char(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
store i32 128, i32* %5
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %3
%13 = ashr i32 %12, 8
%14 = and i32 %13, 127
%15 = load i32, i32* %5
%16 = or i32 %14, %15
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 0
store i8 %17, i8* %19
%20 = load i32, i32* %3
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @int2_char(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = lshr i32 %0, 24
%5 = and i32 %4, 128
%6 = lshr i32 %3, 8
%7 = and i32 %6, 127
%8 = or i32 %7, %5
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = trunc i32 %3 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %10, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help(void) {
  static const char *help =
      "Usage: vpddecode [OPTIONS]\n"
      "Options are:\n"
      " -d, --dev-mem FILE     Read memory from device FILE (default: "
      "/dev/mem"
      ")\n"
      " -h, --help             Display this help text and exit\n"
      " -s, --string KEYWORD   Only display the value of the given VPD string\n"
      " -u, --dump             Do not decode the VPD records\n"
      " -V, --version          Display the version and exit\n";
  printf("%s", help);
}


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

x86 assembly (clang, -O2):
<print_help>:
lea    0x1045(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@print_help.help = internal global i8* getelementptr inbounds ([348 x i8], [348 x i8]* @.str, i32 0, i32 0)
@.str = [348 x i8] c"Usage: vpddecode [OPTIONS]\0AOptions are:\0A -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)\0A -h, --help Display this help text and exit\0A -s, --string KEYWORD Only display the value of the given VPD string\0A -u, --dump Do not decode the VPD records\0A -V, --version Display the version and exit\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = load i8*, i8** @print_help.help
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [348 x i8] c"Usage: vpddecode [OPTIONS]\0AOptions are:\0A -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem)\0A -h, --help Display this help text and exit\0A -s, --string KEYWORD Only display the value of the given VPD string\0A -u, --dump Do not decode the VPD records\0A -V, --version Display the version and exit\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([348 x i8], [348 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello, OpenWrt.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 = [17 x i8] c"Hello, OpenWrt.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello, OpenWrt.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pad_set(int, int);
int(cmd_select)(int c, char **v) {
  pad_set((0x40), v[0][0] == '+');
  return 0;
}


x86 assembly (clang, -O0):
<cmd_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    $0x40,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_select>:
push   %rax
mov    (%rsi),%rax
xor    %esi,%esi
cmpb   $0x2b,(%rax)
sete   %sil
mov    $0x40,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_select(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 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 43
%12 = zext i1 %11 to i32
%13 = call i32 @pad_set(i32 64, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_select(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 43
%6 = zext i1 %5 to i32
%7 = tail call i32 @pad_set(i32 64, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
struct fileset {
  int dummy;
};

/* Variables and functions */
int init_fileset_utc(char *, int *, int *, struct fileset *);
int init_fileset(char *fname, struct fileset *fset) {
  uint32_t t1[2];
  uint32_t t2[2];
  t1[0] = 0;
  t1[1] = 0;
  t2[0] = 0xFFFFFFFFUL;
  t2[1] = 0xFFFFFFFFUL;
  return init_fileset_utc(fname, t1, t2, fset);
}


x86 assembly (clang, -O0):
<init_fileset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0xffffffff,-0x20(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   1030 <init_fileset_utc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_fileset>:
sub    $0x18,%rsp
mov    %rsi,%rcx
movq   $0x0,0x10(%rsp)
movq   $0xffffffffffffffff,0x8(%rsp)
ff ff
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <init_fileset_utc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.fileset = type { i32 }
define i32 @init_fileset(i8* %0, %struct.fileset* %1) {
%3 = alloca i8*
%4 = alloca %struct.fileset*
%5 = alloca [2 x i32]
%6 = alloca [2 x i32]
store i8* %0, i8** %3
store %struct.fileset* %1, %struct.fileset** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 -1, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 -1, i32* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%14 = load %struct.fileset*, %struct.fileset** %4
%15 = call i32 @init_fileset_utc(i8* %11, i32* %12, i32* %13, %struct.fileset* %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.fileset = type { i32 }
define i32 @init_fileset(i8* %0, %struct.fileset* %1) {
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %3 to i8*
%6 = bitcast [2 x i32]* %4 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 -1, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 -1, i32* %10
%11 = call i32 @init_fileset_utc(i8* %0, i32* %7, i32* %9, %struct.fileset* %1)
ret i32 %11
}
int size(char *parola) {
  int c = 0;
  while (parola[c] != '\0') {
    c++;
  }
  return c + 1;
}


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

x86 assembly (clang, -O2):
<size>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <size+0x10>
ret

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

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


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

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

LLVM IR (-O0):
define i8* @x_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @x_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit_error(char const *, int /*<<< orphan*/);
void exit_errno(const char *message) { exit_error(message, errno); }


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

x86 assembly (clang, -O2):
<exit_errno>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <exit_error@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define void @exit_errno(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @exit_error(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *strerror(int err) {
  static char buffer[20];
  snprintf(buffer, 20, "Error number %d\n", err);
  return buffer;
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0x2f1b(%rip),%rdi
mov    $0x14,%esi
lea    0xecf(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2f03(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
push   %rbx
mov    %edi,%ecx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strerror.buffer = internal global [20 x i8] zeroinitializer
@.str = [17 x i8] c"Error number %d\0A\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @snprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.buffer, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@strerror.buffer = internal global [20 x i8] zeroinitializer
@.str = [17 x i8] c"Error number %d\0A\00"
define i8* @strerror(i32 %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.buffer, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @strerror.buffer, i64 0, i64 0)
}
int __crow_add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<__crow_add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @__crow_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int foo(int which_p) {
  int x = 0;
  int *i, *j;
  int **p;
  if (which_p)
    p = &i;
  else
    p = &j;
  *p = &x;
  bar();
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <foo+0x29>
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1141 <foo+0x31>
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    -0x8(%rbp),%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x18,%rsp
movl   $0x0,0x4(%rsp)
test   %edi,%edi
lea    0x8(%rsp),%rax
lea    0x10(%rsp),%rcx
cmove  %rax,%rcx
lea    0x4(%rsp),%rax
mov    %rax,(%rcx)
xor    %eax,%eax
call   1030 <bar@plt>
mov    0x4(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32** %3 to i8*
%7 = bitcast i32** %4 to i8*
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i32** %4, i32** %3
store i32* %2, i32** %9
%10 = call i32 (...) @bar()
%11 = load i32, i32* %2
ret i32 %11
}
void cmovs_(x, y, z) short *x, *y, *z;
{ cmov((float)*x, (float)*y, (float)*z); }


x86 assembly (clang, -O0):
<cmovs_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <cmov@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmovs_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
movswl (%rdx),%eax
cvtsi2sd %eax,%xmm2
mov    $0x3,%al
jmp    1030 <cmov@plt>

LLVM IR (-O0):
define void @cmovs_(i16* %0, i16* %1, i16* %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16*
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = fpext float %9 to double
%11 = load i16*, i16** %5
%12 = load i16, i16* %11
%13 = sitofp i16 %12 to float
%14 = fpext float %13 to double
%15 = load i16*, i16** %6
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @cmov to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @cmovs_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2) {
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to double
%6 = load i16, i16* %1
%7 = sitofp i16 %6 to double
%8 = load i16, i16* %2
%9 = sitofp i16 %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @cmov to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
/* Variables and functions */
int send_bytes(int, char *, size_t);
int send_user_list(int fd) {
  char *msg = "6.";
  size_t len = 2;
  return send_bytes(fd, msg, len);
}


x86 assembly (clang, -O0):
<send_user_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <send_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_user_list>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <send_bytes@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"6.\00"
define i32 @send_user_list(i32 %0) {
%2 = tail call i32 @send_bytes(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2)
ret i32 %2
}
/* Variables and functions */
scalar_t__ find(int);
int test_not_found() {
  return 0 == find(13) && 0 == find(29) && 0 == find(233);
}


x86 assembly (clang, -O0):
<test_not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xd,%edi
call   1030 <find@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    116a <test_not_found+0x5a>
mov    $0x1d,%edi
call   1030 <find@plt>
mov    %rax,%rdx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %rdx,%rcx
mov    %al,-0x1(%rbp)
jne    116a <test_not_found+0x5a>
mov    $0xe9,%edi
call   1030 <find@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_not_found>:
push   %rbx
mov    $0xd,%edi
call   1030 <find@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    1143 <test_not_found+0x33>
mov    $0x1d,%edi
call   1030 <find@plt>
test   %rax,%rax
jne    1143 <test_not_found+0x33>
mov    $0xe9,%edi
call   1030 <find@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_not_found() {
%1 = call i64 @find(i32 13)
%2 = icmp eq i64 0, %1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i64 @find(i32 29)
%5 = icmp eq i64 0, %4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i64 @find(i32 233)
%8 = icmp eq i64 0, %7
br label %9
9: ; preds = %6, %3, %0
%10 = phi i1 [ false, %3 ], [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @test_not_found() {
%1 = tail call i64 @find(i32 13)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 @find(i32 29)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @find(i32 233)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int ftruncate(int fd, off_t length) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<ftruncate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftruncate>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOENT
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ si475xAMRX_set_volume(unsigned char);
void si47xxAMRX_set_volume(int volume) {
  si475xAMRX_set_volume((unsigned char)(volume & 0xff));
}


x86 assembly (clang, -O0):
<si47xxAMRX_set_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
movzbl %al,%edi
call   1030 <si475xAMRX_set_volume@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si47xxAMRX_set_volume>:
movzbl %dil,%edi
jmp    1030 <si475xAMRX_set_volume@plt>

LLVM IR (-O0):
define void @si47xxAMRX_set_volume(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = trunc i32 %4 to i8
%6 = call i32 @si475xAMRX_set_volume(i8 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @si47xxAMRX_set_volume(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @si475xAMRX_set_volume(i8 zeroext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char const *, char *);
char *build_get_query(char *params) {
  static char query[500];
  static const char *format = "GET "
                              "/post"
                              "?%s HTTP/1.1\r\nHost: "
                              "wsprnet.org"
                              "\r\nUser-Agent: "
                              "uploader 1.0"
                              "\r\n\r\n";
  snprintf(query, 500, format, params);
  return query;
}


x86 assembly (clang, -O0):
<build_get_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f05(%rip),%rdx
mov    -0x8(%rbp),%rcx
lea    0x2f12(%rip),%rdi
mov    $0x1f4,%esi
call   1030 <snprintf@plt>
lea    0x2f01(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_get_query>:
push   %rbx
mov    %rdi,%rcx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@build_get_query.query = internal global [500 x i8] zeroinitializer
@build_get_query.format = internal global i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i32 0, i32 0)
@.str = [71 x i8] c"GET /post?%s HTTP/1.1\0D\0AHost: wsprnet.org\0D\0AUser-Agent: uploader 1.0\0D\0A\0D\0A\00"
define i8* @build_get_query(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** @build_get_query.format
%4 = load i8*, i8** %2
%5 = call i32 @snprintf(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @build_get_query.query, i64 0, i64 0), i32 500, i8* %3, i8* %4)
ret i8* getelementptr inbounds ([500 x i8], [500 x i8]* @build_get_query.query, i64 0, i64 0)
}

LLVM IR (-O2):
@build_get_query.query = internal global [500 x i8] zeroinitializer
@.str = [71 x i8] c"GET /post?%s HTTP/1.1\0D\0AHost: wsprnet.org\0D\0AUser-Agent: uploader 1.0\0D\0A\0D\0A\00"
define i8* @build_get_query(i8* %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @build_get_query.query, i64 0, i64 0), i32 500, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* getelementptr inbounds ([500 x i8], [500 x i8]* @build_get_query.query, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ bbspi_transfer(int, int);
uint8_t flash_rsr() {
  uint8_t retval;
  bbspi_transfer(1, 0);
  bbspi_transfer(0, 0x05);
  retval = bbspi_transfer(0, 0);
  bbspi_transfer(1, 0);
  return retval;
}


x86 assembly (clang, -O0):
<flash_rsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <bbspi_transfer@plt>
xor    %edi,%edi
mov    $0x5,%esi
call   1030 <bbspi_transfer@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <bbspi_transfer@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <bbspi_transfer@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_rsr>:
push   %rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <bbspi_transfer@plt>
xor    %edi,%edi
mov    $0x5,%esi
call   1030 <bbspi_transfer@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <bbspi_transfer@plt>
mov    %eax,%ebx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <bbspi_transfer@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @flash_rsr() {
%1 = tail call i32 @bbspi_transfer(i32 1, i32 0)
%2 = tail call i32 @bbspi_transfer(i32 0, i32 5)
%3 = tail call i32 @bbspi_transfer(i32 0, i32 0)
%4 = tail call i32 @bbspi_transfer(i32 1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char num;
  num = 'a';
  printf("%c", 97);
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @av_opt_query_ranges_default() {
ret void
}
double doy2epj(year, doy)
int year;
double doy;
{
  double dj;
  dj = doy2jd(year, doy);
  return (jd2epj(dj));
}


x86 assembly (clang, -O0):
<doy2epj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <doy2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2epj@plt>
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doy2epj>:
push   %rax
mov    $0x1,%al
call   1030 <doy2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1040 <jd2epj@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @doy2epj(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%6 = load i32, i32* %3
%7 = load double, double* %4
%8 = call i32 (i32, double, ...) bitcast (i32 (...)* @doy2jd to i32 (i32, double, ...)*)(i32 %6, double %7)
%9 = sitofp i32 %8 to double
store double %9, double* %5
%10 = load double, double* %5
%11 = call i32 (double, ...) bitcast (i32 (...)* @jd2epj to i32 (double, ...)*)(double %10)
%12 = sitofp i32 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @doy2epj(i32 %0, double %1) {
%3 = tail call i32 (i32, double, ...) bitcast (i32 (...)* @doy2jd to i32 (i32, double, ...)*)(i32 %0, double %1)
%4 = sitofp i32 %3 to double
%5 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epj to i32 (double, ...)*)(double %4)
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int bsd_syscall_socketpair(int, int, int, int, int *);
int uptcp_socketpair(int s, int domain, int type, int protocol, int *rsv) {
  return bsd_syscall_socketpair(s, domain, type, protocol, rsv);
}


x86 assembly (clang, -O0):
<uptcp_socketpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1030 <bsd_syscall_socketpair@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptcp_socketpair>:
jmp    1030 <bsd_syscall_socketpair@plt>

LLVM IR (-O0):
define i32 @uptcp_socketpair(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i32 @bsd_syscall_socketpair(i32 %11, i32 %12, i32 %13, i32 %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @uptcp_socketpair(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = tail call i32 @bsd_syscall_socketpair(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("powerball: usage: powerball filename. Exit.\n"); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"powerball: usage: powerball filename. Exit.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"powerball: usage: powerball filename. Exit.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *get_standard_path(char *, char const *, char const *, char const *);
char *get_config_path(char *path, const char *name) {
  static const char *dir = "/etc";
  static const char *ext = "conf";
  return get_standard_path(path, dir, ext, name);
}


x86 assembly (clang, -O0):
<get_config_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2efd(%rip),%rsi
mov    0x2efe(%rip),%rdx
mov    -0x10(%rbp),%rcx
call   1030 <get_standard_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_config_path>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
lea    0xee4(%rip),%rdx
jmp    1030 <get_standard_path@plt>

LLVM IR (-O0):
@get_config_path.dir = internal global i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0)
@.str = [5 x i8] c"/etc\00"
@get_config_path.ext = internal global i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0)
@.str.1 = [5 x i8] c"conf\00"
define i8* @get_config_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** @get_config_path.dir
%7 = load i8*, i8** @get_config_path.ext
%8 = load i8*, i8** %4
%9 = call i8* @get_standard_path(i8* %5, i8* %6, i8* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"/etc\00"
@.str.1 = [5 x i8] c"conf\00"
define i8* @get_config_path(i8* %0, i8* %1) {
%3 = tail call i8* @get_standard_path(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i8* %3
}
XSetSelectionOwner() {}


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

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

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

LLVM IR (-O2):
define i32 @XSetSelectionOwner() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ srand(scalar_t__);
scalar_t__ times(int /*<<< orphan*/ *);
void __init_random_seq(void) { srand(times(NULL) + getpid()); }


x86 assembly (clang, -O0):
<__init_random_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <times@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__init_random_seq>:
push   %rbx
xor    %edi,%edi
call   1050 <times@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <srand@plt>

LLVM IR (-O0):
define void @__init_random_seq() {
%1 = call i64 @times(i32* null)
%2 = call i64 (...) @getpid()
%3 = add nsw i64 %1, %2
%4 = call i32 @srand(i64 %3)
ret void
}

LLVM IR (-O2):
define void @__init_random_seq() {
%1 = tail call i64 @times(i32* null)
%2 = tail call i64 (...) @getpid()
%3 = add nsw i64 %2, %1
%4 = tail call i32 @srand(i64 %3)
ret void
}
/* Variables and functions */
double __dtand(double);
double intr_wrap_082(double p1) { return __dtand(p1); }


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

x86 assembly (clang, -O2):
<intr_wrap_082>:
jmp    1030 <__dtand@plt>

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

LLVM IR (-O2):
define double @intr_wrap_082(double %0) {
%2 = tail call double @__dtand(double %0)
ret double %2
}
/* Type definitions */
struct ini_section {
  int dummy;
};
struct ini_file {
  int dummy;
};

/* Variables and functions */
char const *ini_find_key(struct ini_section const *, char const *);
struct ini_section *ini_find_section(struct ini_file const *, char const *);
const char *ini_find(const struct ini_file *file, const char *section,
                     const char *key) {
  const struct ini_section *s = ini_find_section(file, section);
  return s ? ini_find_key(s, key) : NULL;
}


x86 assembly (clang, -O0):
<ini_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ini_find_section@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1166 <ini_find+0x46>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <ini_find_key@plt>
mov    %rax,-0x28(%rbp)
jmp    1171 <ini_find+0x51>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1171 <ini_find+0x51>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_find>:
push   %rbx
mov    %rdx,%rbx
call   1030 <ini_find_section@plt>
test   %rax,%rax
je     113a <ini_find+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <ini_find_key@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ini_file = type { i32 }
%struct.ini_section = type { i32 }
define i8* @ini_find(%struct.ini_file* %0, i8* %1, i8* %2) {
%4 = alloca %struct.ini_file*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.ini_section*
store %struct.ini_file* %0, %struct.ini_file** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load %struct.ini_file*, %struct.ini_file** %4
%9 = load i8*, i8** %5
%10 = call %struct.ini_section* @ini_find_section(%struct.ini_file* %8, i8* %9)
store %struct.ini_section* %10, %struct.ini_section** %7
%11 = load %struct.ini_section*, %struct.ini_section** %7
%12 = icmp ne %struct.ini_section* %11, null
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load %struct.ini_section*, %struct.ini_section** %7
%15 = load i8*, i8** %6
%16 = call i8* @ini_find_key(%struct.ini_section* %14, i8* %15)
br label %18
17: ; preds = %3
br label %18
18: ; preds = %17, %13
%19 = phi i8* [ %16, %13 ], [ null, %17 ]
ret i8* %19
}

LLVM IR (-O2):
%struct.ini_file = type { i32 }
%struct.ini_section = type { i32 }
define i8* @ini_find(%struct.ini_file* %0, i8* %1, i8* %2) {
%4 = tail call %struct.ini_section* @ini_find_section(%struct.ini_file* %0, i8* %1)
%5 = icmp eq %struct.ini_section* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @ini_find_key(%struct.ini_section* %4, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i8* [ %7, %6 ], [ null, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ msgw(char *, char *);
int main() {
  msgw("/dev/ms0\0", "ciao\0");
  msgw("/dev/ms0\0", "io tutto bene\0");
  msgw("/dev/ms0\0", "tu?\0");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
lea    0xeeb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <msgw@plt>
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <msgw@plt>
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <msgw@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ms0\00\00"
@.str.1 = [6 x i8] c"ciao\00\00"
@.str.2 = [15 x i8] c"io tutto bene\00\00"
@.str.3 = [5 x i8] c"tu?\00\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @msgw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @msgw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @msgw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ms0\00\00"
@.str.1 = [6 x i8] c"ciao\00\00"
@.str.2 = [15 x i8] c"io tutto bene\00\00"
@.str.3 = [5 x i8] c"tu?\00\00"
define i32 @main() {
%1 = tail call i32 @msgw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @msgw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @msgw(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
void os_prepare_sample(int x) {}


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

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

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

LLVM IR (-O2):
define void @os_prepare_sample(i32 %0) {
ret void
}
int __attribute__((no)) op4(int op, int c) { return op << c; }


x86 assembly (clang, -O0):
<op4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op4>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @op4(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello from distroless C!\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 = [26 x i8] c"Hello from distroless C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Hello from distroless C!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_diagonal_Laurent_homotopy(int a, int b) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(812, &a, &b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_diagonal_Laurent_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x32c,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_diagonal_Laurent_homotopy>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x32c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quaddobl_diagonal_Laurent_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 812, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @quaddobl_diagonal_Laurent_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 812, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ scrprintf(char *, int);
void attrsetstyle(int a) { scrprintf("\033[%dm", a); }


x86 assembly (clang, -O0):
<attrsetstyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <scrprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attrsetstyle>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <scrprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dm\00"
define void @attrsetstyle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @scrprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dm\00"
define void @attrsetstyle(i32 %0) {
%2 = tail call i32 @scrprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t strftime(char *, size_t, char const *, struct tm const *);
size_t strftime_l(char *s, size_t n, const char *f, const struct tm *tm,
                  locale_t l) {
  return strftime(s, n, f, tm);
}


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

x86 assembly (clang, -O2):
<strftime_l>:
jmp    1030 <strftime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @strftime_l(i8* %0, i64 %1, i8* %2, %struct.tm* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca %struct.tm*
%10 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store %struct.tm* %3, %struct.tm** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = load %struct.tm*, %struct.tm** %9
%15 = call i64 @strftime(i8* %11, i64 %12, i8* %13, %struct.tm* %14)
ret i64 %15
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @strftime_l(i8* %0, i64 %1, i8* %2, %struct.tm* %3, i32 %4) {
%6 = tail call i64 @strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3)
ret i64 %6
}