xunge/DecIR huggingface dataset:
/* Variables and functions */
int sscanf(int /*<<< orphan*/, char *, double *);
int /*<<< orphan*/ wcsutil_dot_to_locale(char const *, char *);
int wcsutil_str2double(const char *buf, double *value) {
  char ctmp[72];
  return sscanf(wcsutil_dot_to_locale(buf, ctmp), "%lf", value) < 1;
}


x86 assembly (clang, -O0):
<wcsutil_str2double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <wcsutil_dot_to_locale@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rdx
lea    0xeb6(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsutil_str2double>:
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
call   1040 <wcsutil_dot_to_locale@plt>
lea    0xec9(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @wcsutil_str2double(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca [72 x i8]
store i8* %0, i8** %3
store double* %1, double** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds [72 x i8], [72 x i8]* %5, i64 0, i64 0
%8 = call i32 @wcsutil_dot_to_locale(i8* %6, i8* %7)
%9 = load double*, double** %4
%10 = call i32 @sscanf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %9)
%11 = icmp slt i32 %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @wcsutil_str2double(i8* %0, double* %1) {
%3 = alloca [72 x i8]
%4 = getelementptr inbounds [72 x i8], [72 x i8]* %3, i64 0, i64 0
%5 = call i32 @wcsutil_dot_to_locale(i8* %0, i8* %4)
%6 = call i32 @sscanf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%7 = icmp slt i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
char tolower(char in) { return in | 0x20; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
mov    %edi,%eax
or     $0x20,%al
ret

LLVM IR (-O0):
define signext i8 @tolower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = or i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @tolower(i8 signext %0) {
%2 = or i8 %0, 32
ret i8 %2
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int directory_exists(char *path) {
  struct stat s;
  int rv;
  rv = stat(path, &s);
  return rv ? 0 : S_ISDIR(s.st_mode);
}


x86 assembly (clang, -O0):
<directory_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1150 <directory_exists+0x30>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    115b <directory_exists+0x3b>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<directory_exists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %eax,%eax
je     1131 <directory_exists+0x11>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @directory_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @S_ISDIR(i32 %12)
br label %14
14: ; preds = %10, %9
%15 = phi i32 [ 0, %9 ], [ %13, %10 ]
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @directory_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_event_new(void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_event_new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_event_new>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_event_new(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_event_new(i8** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
int __attribute__((no)) op3(int op, int c) { return op << c; }


x86 assembly (clang, -O0):
<op3>:
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):
<op3>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @op3(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 @op3(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
void CL_ForwardCommandToServer(const char *string) {}


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

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

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

LLVM IR (-O2):
define void @CL_ForwardCommandToServer(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char getTexChar();
int /*<<< orphan*/ parseBrace();
void CmdIgnoreDef(int code) {
  char cThis;
  while ((cThis = getTexChar()) && cThis != '{') {
  }
  parseBrace();
}


x86 assembly (clang, -O0):
<CmdIgnoreDef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getTexChar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x6(%rbp)
je     1153 <CmdIgnoreDef+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x7b,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    1163 <CmdIgnoreDef+0x43>
jmp    1168 <CmdIgnoreDef+0x48>
jmp    112b <CmdIgnoreDef+0xb>
mov    $0x0,%al
call   1040 <parseBrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdIgnoreDef>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getTexChar@plt>
cmp    $0x7b,%al
je     113f <CmdIgnoreDef+0x1f>
test   %al,%al
jne    1130 <CmdIgnoreDef+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <parseBrace@plt>

LLVM IR (-O0):
define void @CmdIgnoreDef(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
br label %4
4: ; preds = %14, %1
%5 = call signext i8 (...) @getTexChar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 123
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %4
15: ; preds = %12
%16 = call i32 (...) @parseBrace()
ret void
}

LLVM IR (-O2):
define void @CmdIgnoreDef(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 (...) @getTexChar()
switch i8 %3, label %2 [
i8 123, label %4
i8 0, label %4
]
4: ; preds = %2, %2
%5 = tail call i32 (...) @parseBrace()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CAN_TIMER_RestoreConfig();
void CAN_TIMER_Wakeup(void) { CAN_TIMER_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @CAN_TIMER_Wakeup() {
%1 = tail call i32 (...) @CAN_TIMER_RestoreConfig()
ret void
}
const char *hvc_nvram_get(char *item) {
  ((void)(item));
  return 0L;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @hvc_nvram_get(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int readlink(char *, char *, int);
char *safe_malloc(int);
char *get_executable_path(void) {
  char *path = safe_malloc(4096);
  int len = readlink("/proc/self/exe", path, 4096 - 1);
  if (len == -1) {
    free(path);
    path = NULL;
  } else {
    path[len] = '\0';
  }
  return path;
}


x86 assembly (clang, -O0):
<get_executable_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000,%edi
call   1040 <safe_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0xfff,%edx
call   1050 <readlink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    117e <get_executable_path+0x4e>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    118a <get_executable_path+0x5a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_executable_path>:
push   %rbx
mov    $0x1000,%edi
call   1040 <safe_malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rdi
mov    %rax,%rsi
mov    $0xfff,%edx
call   1050 <readlink@plt>
cmp    $0xffffffff,%eax
je     115f <get_executable_path+0x2f>
cltq
movb   $0x0,(%rbx,%rax,1)
jmp    1169 <get_executable_path+0x39>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
define i8* @get_executable_path() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @safe_malloc(i32 4096)
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4, i32 4095)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
store i8* null, i8** %1
br label %16
11: ; preds = %0
%12 = load i8*, i8** %1
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %11, %8
%17 = load i8*, i8** %1
ret i8* %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
define i8* @get_executable_path() {
%1 = tail call i8* @safe_malloc(i32 4096)
%2 = tail call i32 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i32 4095)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @free(i8* %1)
br label %9
6: ; preds = %0
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ null, %4 ], [ %1, %6 ]
ret i8* %10
}
/* Type definitions */
struct tree_node {
  int dummy;
};

/* Variables and functions */
struct tree_node *random_node_aux(struct tree_node *, int /*<<< orphan*/ *,
                                  int *);
struct tree_node *random_node(struct tree_node *root) {
  int seen = 0;
  return random_node_aux(root, NULL, &seen);
}


x86 assembly (clang, -O0):
<random_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1030 <random_node_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_node>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
xor    %esi,%esi
call   1030 <random_node_aux@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tree_node = type { i32 }
define %struct.tree_node* @random_node(%struct.tree_node* %0) {
%2 = alloca %struct.tree_node*
%3 = alloca i32
store %struct.tree_node* %0, %struct.tree_node** %2
store i32 0, i32* %3
%4 = load %struct.tree_node*, %struct.tree_node** %2
%5 = call %struct.tree_node* @random_node_aux(%struct.tree_node* %4, i32* null, i32* %3)
ret %struct.tree_node* %5
}

LLVM IR (-O2):
%struct.tree_node = type { i32 }
define %struct.tree_node* @random_node(%struct.tree_node* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call %struct.tree_node* @random_node_aux(%struct.tree_node* %0, i32* null, i32* %2)
ret %struct.tree_node* %4
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int BMK_GetMilliStart() {
  struct timeval tv;
  int nCount;
  gettimeofday(&tv, NULL);
  nCount = (int)(tv.tv_usec / 1000 + (tv.tv_sec & 0xfffff) * 1000);
  return nCount;
}


x86 assembly (clang, -O0):
<BMK_GetMilliStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x4(%rbp),%ecx
and    $0xfffff,%ecx
imul   $0x3e8,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMK_GetMilliStart>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x26,%rcx
add    %eax,%ecx
mov    $0xfffff,%eax
and    0x4(%rsp),%eax
imul   $0x3e8,%eax,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @BMK_GetMilliStart() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = and i32 %8, 1048575
%10 = mul nsw i32 %9, 1000
%11 = add nsw i32 %6, %10
store i32 %11, i32* %2
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @BMK_GetMilliStart() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = and i32 %8, 1048575
%10 = mul nuw nsw i32 %9, 1000
%11 = add nsw i32 %10, %6
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mul2(uint8_t b) { return (b & 0x80) ? b << 1 : (b << 1) ^ 0x1b; }


x86 assembly (clang, -O0):
<mul2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1126 <mul2+0x26>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <mul2+0x32>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
xor    $0x1b,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul2>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
xor    $0x1b,%eax
test   $0x80,%dil
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mul2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = shl i32 %7, 1
br label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = shl i32 %10, 1
%12 = xor i32 %11, 27
br label %13
13: ; preds = %9, %6
%14 = phi i32 [ %8, %6 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @mul2(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
%4 = shl i32 %0, 1
%5 = xor i32 %4, 27
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_pi(void) { m68ki_write_8(EA_AY_PI_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_pi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AY_PI_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_pi>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AY_PI_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_pi() {
%1 = call i32 (...) @EA_AY_PI_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_pi() {
%1 = tail call i32 (...) @EA_AY_PI_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
double score_inplace(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ *wcsdup(int /*<<< orphan*/ const *);
double score(const wchar_t *st1, const wchar_t *st2, int normalizeString) {
  wchar_t *s1 = wcsdup(st1);
  wchar_t *s2 = wcsdup(st2);
  double rc;
  rc = score_inplace(s1, s2, normalizeString);
  free(s1);
  free(s2);
  return rc;
}


x86 assembly (clang, -O0):
<score>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <wcsdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wcsdup@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <score_inplace@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<score>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
call   1040 <wcsdup@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1040 <wcsdup@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %r14d,%edx
call   1050 <score_inplace@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @score(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca double
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%10 = load i32*, i32** %4
%11 = call i32* @wcsdup(i32* %10)
store i32* %11, i32** %7
%12 = load i32*, i32** %5
%13 = call i32* @wcsdup(i32* %12)
store i32* %13, i32** %8
%14 = load i32*, i32** %7
%15 = load i32*, i32** %8
%16 = load i32, i32* %6
%17 = call double @score_inplace(i32* %14, i32* %15, i32 %16)
store double %17, double* %9
%18 = load i32*, i32** %7
%19 = call i32 @free(i32* %18)
%20 = load i32*, i32** %8
%21 = call i32 @free(i32* %20)
%22 = load double, double* %9
ret double %22
}

LLVM IR (-O2):
define double @score(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32* @wcsdup(i32* %0)
%5 = tail call i32* @wcsdup(i32* %1)
%6 = tail call double @score_inplace(i32* %4, i32* %5, i32 %2)
%7 = tail call i32 @free(i32* %4)
%8 = tail call i32 @free(i32* %5)
ret double %6
}
/* Variables and functions */
int sscanf(char *, char *, float *);
float strtofloat(char *str) {
  float value;
  if (str == NULL) {
    return 0;
  }
  if (sscanf(str, "%f", &value) != 1) {
    return 0;
  }
  return value;
}


x86 assembly (clang, -O0):
<strtofloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strtofloat+0x24>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1168 <strtofloat+0x58>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     115e <strtofloat+0x4e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1168 <strtofloat+0x58>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtofloat>:
test   %rdi,%rdi
je     1134 <strtofloat+0x24>
push   %rax
lea    0xee3(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1138 <strtofloat+0x28>
xorps  %xmm0,%xmm0
add    $0x8,%rsp
ret
xorps  %xmm0,%xmm0
ret
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define float @strtofloat(i8* %0) {
%2 = alloca float
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store float 0.000000e+00, float* %2
br label %15
13: ; preds = %8
%14 = load float, float* %4
store float %14, float* %2
br label %15
15: ; preds = %13, %12, %7
%16 = load float, float* %2
ret float %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @strtofloat(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = icmp eq i32 %6, 1
%8 = load float, float* %2
%9 = select i1 %7, float %8, float 0.000000e+00
br label %10
10: ; preds = %5, %1
%11 = phi float [ 0.000000e+00, %1 ], [ %9, %5 ]
ret float %11
}
/* Type definitions */
struct subcommand {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ generic_usage(struct subcommand *);
int /*<<< orphan*/ printf(char *);
void help_usage(struct subcommand *scp) {
  generic_usage(scp);
  printf("\n");
  printf("Pseudo-commands:\n");
  printf("   arg-summary      print a summary of commands and arguments\n");
}


x86 assembly (clang, -O0):
<help_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <generic_usage@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_usage>:
push   %rax
call   1050 <generic_usage@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb9(%rip),%rdi
call   1040 <puts@plt>
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
%struct.subcommand = type { i32 }
@.str = [2 x i8] c"\0A\00"
@.str.1 = [18 x i8] c"Pseudo-commands:\0A\00"
@.str.2 = [63 x i8] c" arg-summary print a summary of commands and arguments\0A\00"
define void @help_usage(%struct.subcommand* %0) {
%2 = alloca %struct.subcommand*
store %struct.subcommand* %0, %struct.subcommand** %2
%3 = load %struct.subcommand*, %struct.subcommand** %2
%4 = call i32 @generic_usage(%struct.subcommand* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.subcommand = type { i32 }
@str = [17 x i8] c"Pseudo-commands:\00"
@str.3 = [62 x i8] c" arg-summary print a summary of commands and arguments\00"
define void @help_usage(%struct.subcommand* %0) {
%2 = tail call i32 @generic_usage(%struct.subcommand* %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.3, i64 0, i64 0))
ret void
}
int many2(int x, char c, ...) {
  c;
  return x;
}


x86 assembly (clang, -O0):
<many2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @many2(i32 returned %0, i8 signext %1, ...) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ task_exit(int);
void exit(int status) { task_exit(status); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <task_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <task_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @task_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @task_exit(i32 %0)
unreachable
}
int (*x2(_Atomic int x[3][3]))[3] { return x; }


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

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

LLVM IR (-O0):
define [3 x i32]* @x2([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
ret [3 x i32]* %3
}

LLVM IR (-O2):
define [3 x i32]* @x2([3 x i32]* readnone returned %0) {
ret [3 x i32]* %0
}
int imswapped() {
  char *ctest;
  int itest;
  itest = 1;
  ctest = (char *)&itest;
  if (*ctest)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<imswapped>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <imswapped+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <imswapped+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @imswapped() {
ret i32 1
}
int convert_utype(int units) {
  switch (units) {
  case 12:
  case 13:
  case 14:
    return (4);
  case 27:
    return (1);
  case 1:
  case 2:
  case 3:
  case 4:
    return (5);
  case 5:
  case 6:
  case 7:
  case 8:
  case 9:
  case 10:
  case 11:
    return (2);
  case 15:
  case 16:
    return (6);
  case 17:
  case 18:
  case 19:
  case 20:
  case 21:
  case 22:
  case 23:
  case 24:
  case 25:
  case 26:
    return (3);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<convert_utype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x1a,%eax
ja     1178 <convert_utype+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x4(%rbp)
jmp    117f <convert_utype+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    117f <convert_utype+0x7f>
movl   $0x5,-0x4(%rbp)
jmp    117f <convert_utype+0x7f>
movl   $0x2,-0x4(%rbp)
jmp    117f <convert_utype+0x7f>
movl   $0x6,-0x4(%rbp)
jmp    117f <convert_utype+0x7f>
movl   $0x3,-0x4(%rbp)
jmp    117f <convert_utype+0x7f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_utype>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
ja     1117 <convert_utype+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @convert_utype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 12, label %5
i32 13, label %5
i32 14, label %5
i32 27, label %6
i32 1, label %7
i32 2, label %7
i32 3, label %7
i32 4, label %7
i32 5, label %8
i32 6, label %8
i32 7, label %8
i32 8, label %8
i32 9, label %8
i32 10, label %8
i32 11, label %8
i32 15, label %9
i32 16, label %9
i32 17, label %10
i32 18, label %10
i32 19, label %10
i32 20, label %10
i32 21, label %10
i32 22, label %10
i32 23, label %10
i32 24, label %10
i32 25, label %10
i32 26, label %10
]
5: ; preds = %1, %1, %1
store i32 4, i32* %2
br label %12
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1, %1, %1, %1
store i32 5, i32* %2
br label %12
8: ; preds = %1, %1, %1, %1, %1, %1, %1
store i32 2, i32* %2
br label %12
9: ; preds = %1, %1
store i32 6, i32* %2
br label %12
10: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 3, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.convert_utype = [27 x i32] [i32 5, i32 5, i32 5, i32 5, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 4, i32 4, i32 4, i32 6, i32 6, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 1]
define i32 @convert_utype(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 27
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [27 x i32], [27 x i32]* @switch.table.convert_utype, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t);
__attribute__((visibility("hidden"))) void *xzmalloc(size_t size) {
  void *ptr = xmalloc(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<xzmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define hidden i8* @xzmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @xmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define hidden i8* @xzmalloc(i64 %0) {
%2 = tail call i8* @xmalloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
struct fins_t {
  int dummy;
};

/* Variables and functions */
int fins_command(struct fins_t *, int, int, int const, int const, int const,
                 int /*<<< orphan*/, int /*<<< orphan*/ *, int const,
                 unsigned short *);
int fins_read(struct fins_t *c, const int type, const int from, const int nb,
              short unsigned int *oData) {
  return fins_command(c, 1, 1, type, from, nb, 0, NULL, nb, oData);
}


x86 assembly (clang, -O0):
<fins_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x14(%rbp),%r10d
mov    -0x20(%rbp),%rax
mov    $0x1,%edx
xor    %esi,%esi
xor    %esi,%esi
mov    %edx,%esi
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <fins_command@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fins_read>:
push   %rax
mov    %r8,%rax
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %esi,%ecx
mov    $0x1,%esi
mov    $0x1,%edx
push   %rax
push   %r9
push   $0x0
push   $0x0
call   1030 <fins_command@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.fins_t = type { i32 }
define i32 @fins_read(%struct.fins_t* %0, i32 %1, i32 %2, i32 %3, i16* %4) {
%6 = alloca %struct.fins_t*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i16*
store %struct.fins_t* %0, %struct.fins_t** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i16* %4, i16** %10
%11 = load %struct.fins_t*, %struct.fins_t** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %9
%16 = load i16*, i16** %10
%17 = call i32 @fins_command(%struct.fins_t* %11, i32 1, i32 1, i32 %12, i32 %13, i32 %14, i32 0, i32* null, i32 %15, i16* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.fins_t = type { i32 }
define i32 @fins_read(%struct.fins_t* %0, i32 %1, i32 %2, i32 %3, i16* %4) {
%6 = tail call i32 @fins_command(%struct.fins_t* %0, i32 1, i32 1, i32 %1, i32 %2, i32 %3, i32 0, i32* null, i32 %3, i16* %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void writeGpxMetadata(FILE *OUT) {
  fprintf(OUT,
          "\n<metadata>\n<name>Osmawalk track</name>\n<desc>Walk track found "
          "by Osmawalk</desc>\n<author>\n<name>Tomas Pokorny</name>\n<email "
          "id=\"xtompok\" domain=\"gmail.com\" />\n<link "
          "href=\"https://github.com/xtompok/osmawalk\"><text>Osmawalk on "
          "Github</text></link>\n</author>\n</metadata>\n");
}


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

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

LLVM IR (-O0):
@.str = [271 x i8] c"\0A<metadata>\0A<name>Osmawalk track</name>\0A<desc>Walk track found by Osmawalk</desc>\0A<author>\0A<name>Tomas Pokorny</name>\0A<email id=\22xtompok\22 domain=\22gmail.com\22 />\0A<link href=\22https://github.com/xtompok/osmawalk\22><text>Osmawalk on Github</text></link>\0A</author>\0A</metadata>\0A\00"
define void @writeGpxMetadata(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([271 x i8], [271 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [271 x i8] c"\0A<metadata>\0A<name>Osmawalk track</name>\0A<desc>Walk track found by Osmawalk</desc>\0A<author>\0A<name>Tomas Pokorny</name>\0A<email id=\22xtompok\22 domain=\22gmail.com\22 />\0A<link href=\22https://github.com/xtompok/osmawalk\22><text>Osmawalk on Github</text></link>\0A</author>\0A</metadata>\0A\00"
define void @writeGpxMetadata(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([271 x i8], [271 x i8]* @.str, i64 0, i64 0), i64 270, i64 1, i32* %0)
ret void
}
/* Type definitions */
struct tree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bst_sequences_aux(struct tree_node **, int, int);
void bst_sequences(struct tree_node *root) {
  static struct tree_node *array_buff[4096];
  if (root != NULL) {
    array_buff[0] = root;
    bst_sequences_aux(array_buff, 1, 1);
  }
}


x86 assembly (clang, -O0):
<bst_sequences>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <bst_sequences+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,0x2f0e(%rip)
lea    0x2f07(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <bst_sequences_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bst_sequences>:
test   %rdi,%rdi
je     1132 <bst_sequences+0x22>
mov    %rdi,0x2f24(%rip)
lea    0x2f1d(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <bst_sequences_aux@plt>
ret

LLVM IR (-O0):
%struct.tree_node = type { i32 }
@bst_sequences.array_buff = internal global [4096 x %struct.tree_node*] zeroinitializer
define void @bst_sequences(%struct.tree_node* %0) {
%2 = alloca %struct.tree_node*
store %struct.tree_node* %0, %struct.tree_node** %2
%3 = load %struct.tree_node*, %struct.tree_node** %2
%4 = icmp ne %struct.tree_node* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.tree_node*, %struct.tree_node** %2
store %struct.tree_node* %6, %struct.tree_node** getelementptr inbounds ([4096 x %struct.tree_node*], [4096 x %struct.tree_node*]* @bst_sequences.array_buff, i64 0, i64 0)
%7 = call i32 @bst_sequences_aux(%struct.tree_node** getelementptr inbounds ([4096 x %struct.tree_node*], [4096 x %struct.tree_node*]* @bst_sequences.array_buff, i64 0, i64 0), i32 1, i32 1)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.tree_node = type { i32 }
@bst_sequences.array_buff = internal global [4096 x %struct.tree_node*] zeroinitializer
define void @bst_sequences(%struct.tree_node* %0) {
%2 = icmp eq %struct.tree_node* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
store %struct.tree_node* %0, %struct.tree_node** getelementptr inbounds ([4096 x %struct.tree_node*], [4096 x %struct.tree_node*]* @bst_sequences.array_buff, i64 0, i64 0)
%4 = tail call i32 @bst_sequences_aux(%struct.tree_node** getelementptr inbounds ([4096 x %struct.tree_node*], [4096 x %struct.tree_node*]* @bst_sequences.array_buff, i64 0, i64 0), i32 1, i32 1)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_A2int8_mem(signed char *val) {
  return ((*val) & (0xA2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A2int8_mem>:
testb  $0xa2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A2int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -94
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct roff_man {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ post_fa(struct roff_man *);
int /*<<< orphan*/ post_fname(struct roff_man *);
void post_fn(struct roff_man *mdoc) {
  post_fname(mdoc);
  post_fa(mdoc);
}


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

x86 assembly (clang, -O2):
<post_fn>:
push   %rbx
mov    %rdi,%rbx
call   1040 <post_fname@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <post_fa@plt>

LLVM IR (-O0):
%struct.roff_man = type { i32 }
define void @post_fn(%struct.roff_man* %0) {
%2 = alloca %struct.roff_man*
store %struct.roff_man* %0, %struct.roff_man** %2
%3 = load %struct.roff_man*, %struct.roff_man** %2
%4 = call i32 @post_fname(%struct.roff_man* %3)
%5 = load %struct.roff_man*, %struct.roff_man** %2
%6 = call i32 @post_fa(%struct.roff_man* %5)
ret void
}

LLVM IR (-O2):
%struct.roff_man = type { i32 }
define void @post_fn(%struct.roff_man* %0) {
%2 = tail call i32 @post_fname(%struct.roff_man* %0)
%3 = tail call i32 @post_fa(%struct.roff_man* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void loudbug_stringpost(char *s) { fputs(s, stderr); }


x86 assembly (clang, -O0):
<loudbug_stringpost>:
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 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@stderr = global i32 0
define void @loudbug_stringpost(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mumble_queryusers_callback(uint32_t n_ids, uint32_t *ids, uint32_t n_names,
                                char **names, void *user_data) {
  printf("queryusers_callback\n");
}


x86 assembly (clang, -O0):
<mumble_queryusers_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"queryusers_callback\0A\00"
define void @mumble_queryusers_callback(i32 %0, i32* %1, i32 %2, i8** %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8**
%10 = alloca i8*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i8** %3, i8*** %9
store i8* %4, i8** %10
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"queryusers_callback\00"
define void @mumble_queryusers_callback(i32 %0, i32* nocapture readnone %1, i32 %2, i8** nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *chomp(char *);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
char *leer_linea(FILE *fp) {
  size_t tam = 0;
  char *linea = NULL;
  if (getline(&linea, &tam, fp) != -1) {
    return chomp(linea);
  } else {
    free(linea);
    return NULL;
  }
}


x86 assembly (clang, -O0):
<leer_linea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x20(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <getline@plt>
cmp    $0xffffffff,%eax
je     1178 <leer_linea+0x48>
mov    -0x20(%rbp),%rdi
call   1040 <chomp@plt>
mov    %rax,-0x8(%rbp)
jmp    1189 <leer_linea+0x59>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leer_linea>:
sub    $0x18,%rsp
mov    %rdi,%rdx
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1050 <getline@plt>
mov    0x8(%rsp),%rdi
cmp    $0xffffffff,%eax
je     116c <leer_linea+0x3c>
call   1040 <chomp@plt>
add    $0x18,%rsp
ret
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i8* @leer_linea(i32* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = call i32 @getline(i8** %3, i64* %2, i32* %0)
%7 = icmp eq i32 %6, -1
%8 = load i8*, i8** %3
br i1 %7, label %11, label %9
9: ; preds = %1
%10 = call i8* @chomp(i8* %8)
br label %13
11: ; preds = %1
%12 = call i32 @free(i8* %8)
br label %13
13: ; preds = %11, %9
%14 = phi i8* [ %10, %9 ], [ null, %11 ]
ret i8* %14
}
int quantchar(char x) {
  if (x == 'A' || x == 'E') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<quantchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
je     1124 <quantchar+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x45,%eax
jne    1130 <quantchar+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <quantchar+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantchar>:
and    $0xfb,%dil
xor    %eax,%eax
cmp    $0x41,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @quantchar(i8 signext %0) {
%2 = and i8 %0, -5
%3 = icmp eq i8 %2, 65
%4 = zext i1 %3 to i32
ret i32 %4
}