xunge/DecIR huggingface dataset:
int cdops_read_sectors_dma(char *buf, int sec, int num) {
  struct {
    int sec, num;
    void *buffer;
    int dunno;
  } param;
  param.sec = sec;
  param.num = num;
  param.buffer = buf;
  param.dunno = 0;
  return cdops_exec_cmd(17, &param);
}


x86 assembly (clang, -O0):
<cdops_read_sectors_dma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x11,%edi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1030 <cdops_exec_cmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdops_read_sectors_dma>:
sub    $0x18,%rsp
mov    %esi,(%rsp)
mov    %edx,0x4(%rsp)
mov    %rdi,0x8(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x11,%edi
xor    %eax,%eax
call   1030 <cdops_exec_cmd@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.anon = type { i32, i32, i8*, i32 }
define i32 @cdops_read_sectors_dma(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.anon
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %6
%11 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 1
store i32 %10, i32* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 2
store i8* %12, i8** %13
%14 = getelementptr inbounds %struct.anon, %struct.anon* %7, i32 0, i32 3
store i32 0, i32* %14
%15 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 17, %struct.anon* %7)
ret i32 %15
}

LLVM IR (-O2):
%struct.anon = type { i32, i32, i8*, i32 }
define i32 @cdops_read_sectors_dma(i8* %0, i32 %1, i32 %2) {
%4 = alloca %struct.anon
%5 = bitcast %struct.anon* %4 to i8*
%6 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 1
store i32 %2, i32* %7
%8 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 2
store i8* %0, i8** %8
%9 = getelementptr inbounds %struct.anon, %struct.anon* %4, i64 0, i32 3
store i32 0, i32* %9
%10 = call i32 (i32, %struct.anon*, ...) bitcast (i32 (...)* @cdops_exec_cmd to i32 (i32, %struct.anon*, ...)*)(i32 17, %struct.anon* %4)
ret i32 %10
}
/* Type definitions */
typedef float int32_t;

/* Variables and functions */
int32_t _compare_float(const void *a, const void *b) {
  return (*(float *)a - *(float *)b);
}


x86 assembly (clang, -O0):
<_compare_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_compare_float>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
ret

LLVM IR (-O0):
define float @_compare_float(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 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fsub float %7, %10
ret float %11
}

LLVM IR (-O2):
define float @_compare_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
ret float %7
}
unsigned xrop3_28_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D & T;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_28_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_28_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
xor    %ecx,%eax
not    %esi
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_28_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_28_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %5, -1
%8 = xor i32 %6, %4
%9 = and i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ nomem();
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *s2;
  if ((s2 = strdup(s)) == NULL)
    nomem();
  return (s2);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <xstrdup+0x2a>
mov    $0x0,%al
call   1030 <nomem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xstrdup+0x15>
xor    %eax,%eax
call   1030 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @nomem()
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @nomem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void tsaf_set_streampriority(uint8_t *p_ts) { p_ts[5] |= 0x20; }


x86 assembly (clang, -O0):
<tsaf_set_streampriority>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
or     $0x20,%ecx
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsaf_set_streampriority>:
orb    $0x20,0x14(%rdi)
ret

LLVM IR (-O0):
define void @tsaf_set_streampriority(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = or i32 %5, 32
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @tsaf_set_streampriority(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = or i32 %3, 32
store i32 %4, i32* %2
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};
struct fileinfo {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_get(struct genlist const *, int);
struct fileinfo *fileinfo_list_get(const struct fileinfo_list *tthis,
                                   int index) {
  return ((struct fileinfo *)genlist_get((const struct genlist *)tthis, index));
}


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

x86 assembly (clang, -O2):
<fileinfo_list_get>:
jmp    1030 <genlist_get@plt>

LLVM IR (-O0):
%struct.fileinfo = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo* @fileinfo_list_get(%struct.fileinfo_list* %0, i32 %1) {
%3 = alloca %struct.fileinfo_list*
%4 = alloca i32
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %3
store i32 %1, i32* %4
%5 = load %struct.fileinfo_list*, %struct.fileinfo_list** %3
%6 = bitcast %struct.fileinfo_list* %5 to %struct.genlist*
%7 = load i32, i32* %4
%8 = call i64 @genlist_get(%struct.genlist* %6, i32 %7)
%9 = inttoptr i64 %8 to %struct.fileinfo*
ret %struct.fileinfo* %9
}

LLVM IR (-O2):
%struct.fileinfo = type { i32 }
%struct.fileinfo_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.fileinfo* @fileinfo_list_get(%struct.fileinfo_list* %0, i32 %1) {
%3 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%4 = tail call i64 @genlist_get(%struct.genlist* %3, i32 %1)
%5 = inttoptr i64 %4 to %struct.fileinfo*
ret %struct.fileinfo* %5
}
/* Variables and functions */
int my_getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = my_getline(line, 1000)) > 0)
    if (len > 80) {
      printf("%s", line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <my_getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <my_getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <my_getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @my_getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 80
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @my_getline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ iscntrl(char);
int /*<<< orphan*/ printf(char *, char, ...);
void echoKey(char c) {
  if (iscntrl(c)) {
    printf("%d\r\n", c);
  } else {
    printf("%c (%d)\r\n", c, c);
  }
}


x86 assembly (clang, -O0):
<echoKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
je     1158 <echoKey+0x38>
lea    0xeb8(%rip),%rdi
movsbl -0x1(%rbp),%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1170 <echoKey+0x50>
mov    -0x1(%rbp),%al
movsbl -0x1(%rbp),%edx
lea    0xe9f(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echoKey>:
push   %rbx
mov    %edi,%ebx
call   1030 <iscntrl@plt>
test   %rax,%rax
je     113f <echoKey+0x1f>
movsbl %bl,%esi
lea    0xec9(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
movsbl %bl,%edx
lea    0xebc(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d\0D\0A\00"
@.str.1 = [10 x i8] c"%c (%d)\0D\0A\00"
define void @echoKey(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @iscntrl(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %7)
br label %14
9: ; preds = %1
%10 = load i8, i8* %2
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %10, i32 %12)
br label %14
14: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d\0D\0A\00"
@.str.1 = [10 x i8] c"%c (%d)\0D\0A\00"
define void @echoKey(i8 signext %0) {
%2 = tail call i64 @iscntrl(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %9
6: ; preds = %1
%7 = sext i8 %0 to i32
%8 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8 signext %0, i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
int get_arguments(int, char const **, int *);
int /*<<< orphan*/ print_characters(int *);
int main(int argc, const char *argv[]) {
  int output;
  if (get_arguments(argc, argv, &output) == -1) {
    return -1;
  }
  print_characters(&output);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <get_arguments@plt>
cmp    $0xffffffff,%eax
jne    115b <main+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <main+0x4b>
lea    -0x14(%rbp),%rdi
call   1030 <print_characters@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdx
call   1040 <get_arguments@plt>
cmp    $0xffffffff,%eax
je     113e <main+0x1e>
lea    0x4(%rsp),%rdi
call   1030 <print_characters@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @get_arguments(i32 %0, i8** %1, i32* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @print_characters(i32* %3)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
int __builtin_wasm_trunc_s_i32_f64(double);
int trunc_s_i32_f64(double f) { return __builtin_wasm_trunc_s_i32_f64(f); }


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

x86 assembly (clang, -O2):
<trunc_s_i32_f64>:
jmp    1030 <__builtin_wasm_trunc_s_i32_f64@plt>

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

LLVM IR (-O2):
define i32 @trunc_s_i32_f64(double %0) {
%2 = tail call i32 @__builtin_wasm_trunc_s_i32_f64(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ walker(char *);
int main(int argc, char *argv[]) {
  char basedir[strlen(argv[1])];
  strcpy(basedir, argv[1]);
  walker(basedir);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1050 <walker@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
call   1040 <strlen@plt>
mov    %eax,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x8(%r14),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <walker@plt>
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @strlen(i8* %10)
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %6
%14 = alloca i8, i64 %12
store i64 %12, i64* %7
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strcpy(i8* %14, i8* %17)
%19 = call i32 @walker(i8* %14)
store i32 0, i32* %3
%20 = load i8*, i8** %6
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = call i32 @walker(i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_xslt_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("xslt", " <!--comment-->"),
                            "comment", "<!--comment-->");
}


x86 assembly (clang, -O0):
<test_xslt_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xed5(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xslt_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xeda(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"xslt\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xslt_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"xslt\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xslt_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bin_prn(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
void fl_disp(char *label, unsigned int value) {
  printf("%-30s: %-7d:", label, value);
  bin_prn(value);
  printf("\n");
}


x86 assembly (clang, -O0):
<fl_disp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <bin_prn@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fl_disp>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <bin_prn@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"%-30s: %-7d:\00"
define void @fl_disp(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @bin_prn(i32 %1)
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XESetCreateFont() {
  printf("XESetCreateFont called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XESetCreateFont>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"XESetCreateFont called\0A\00"
define i32 @XESetCreateFont() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"XESetCreateFont called\00"
define i32 @XESetCreateFont() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void catch_function(int signal) {
  printf("I cought a signal. It's number is %d\n", signal);
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"I cought a signal. It's number is %d\0A\00"
define void @catch_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"I cought a signal. It's number is %d\0A\00"
define void @catch_function(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc_prn(char *);
int help_sleep(int argc, char **argv) {
  esc_prn(
      "\n{Hsleep} [{Useconds}] [{Utext}]\n"
      "  Print {Utext} and pause execution of script for {Utime} seconds.\n"
      "  If {Useconds} is zero or missing, pause until a key is pressed. \n"
      "  Default text when no parameters given: 'Press any key to continue'\n"
      "  See {Hload} [{Ufilename}]\n");
  return 1;
}


x86 assembly (clang, -O0):
<help_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <esc_prn@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_sleep>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <esc_prn@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [265 x i8] c"\0A{Hsleep} [{Useconds}] [{Utext}]\0A Print {Utext} and pause execution of script for {Utime} seconds.\0A If {Useconds} is zero or missing, pause until a key is pressed. \0A Default text when no parameters given: 'Press any key to continue'\0A See {Hload} [{Ufilename}]\0A\00"
define i32 @help_sleep(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @esc_prn(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [265 x i8] c"\0A{Hsleep} [{Useconds}] [{Utext}]\0A Print {Utext} and pause execution of script for {Utime} seconds.\0A If {Useconds} is zero or missing, pause until a key is pressed. \0A Default text when no parameters given: 'Press any key to continue'\0A See {Hload} [{Ufilename}]\0A\00"
define i32 @help_sleep(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @esc_prn(i8* getelementptr inbounds ([265 x i8], [265 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
char *get_most_common_word_after_this_word(char *word_to_find) {
  return (char *)NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @get_most_common_word_after_this_word(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_erlang_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("erlang", " %comment"),
                            "comment", "%comment");
}


x86 assembly (clang, -O0):
<test_erlang_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_erlang_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xece(%rip),%rsi
lea    0xec6(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"erlang\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"%comment\00"
define void @test_erlang_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"erlang\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"%comment\00"
define void @test_erlang_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_delay();
int /*<<< orphan*/ scl_low();
int /*<<< orphan*/ sda_low();
void i2c_start(void) {
  i2c_delay();
  i2c_delay();
  sda_low();
  i2c_delay();
  i2c_delay();
  scl_low();
  i2c_delay();
}


x86 assembly (clang, -O0):
<i2c_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <i2c_delay@plt>
mov    $0x0,%al
call   1030 <i2c_delay@plt>
mov    $0x0,%al
call   1040 <sda_low@plt>
mov    $0x0,%al
call   1030 <i2c_delay@plt>
mov    $0x0,%al
call   1030 <i2c_delay@plt>
mov    $0x0,%al
call   1050 <scl_low@plt>
mov    $0x0,%al
call   1030 <i2c_delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_start>:
push   %rax
xor    %eax,%eax
call   1030 <i2c_delay@plt>
xor    %eax,%eax
call   1030 <i2c_delay@plt>
xor    %eax,%eax
call   1040 <sda_low@plt>
xor    %eax,%eax
call   1030 <i2c_delay@plt>
xor    %eax,%eax
call   1030 <i2c_delay@plt>
xor    %eax,%eax
call   1050 <scl_low@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <i2c_delay@plt>

LLVM IR (-O0):
define void @i2c_start() {
%1 = call i32 (...) @i2c_delay()
%2 = call i32 (...) @i2c_delay()
%3 = call i32 (...) @sda_low()
%4 = call i32 (...) @i2c_delay()
%5 = call i32 (...) @i2c_delay()
%6 = call i32 (...) @scl_low()
%7 = call i32 (...) @i2c_delay()
ret void
}

LLVM IR (-O2):
define void @i2c_start() {
%1 = tail call i32 (...) @i2c_delay()
%2 = tail call i32 (...) @i2c_delay()
%3 = tail call i32 (...) @sda_low()
%4 = tail call i32 (...) @i2c_delay()
%5 = tail call i32 (...) @i2c_delay()
%6 = tail call i32 (...) @scl_low()
%7 = tail call i32 (...) @i2c_delay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%lf\n", 1.0 / 0.0);
  printf("%lf\n", 0.0 / 0.0);
  printf("%lf\n", 1 / 0);
  printf("%lf\n", 0 / 0);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 poison)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 poison)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 poison)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 poison)
ret i32 0
}
int gcd(int p, int q) {
  if (p == 0)
    return q;
  gcd(q, p % q);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <gcd+0x34>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %edi,%edi
je     111b <gcd+0x1b>
mov    %edi,%eax
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %ecx,%ecx
jne    1110 <gcd+0x10>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 returned %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %5, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 %1
}
const char *output_hash(void) {
  return "6f720a588e1159f839a5b48a1f5f36b4eb57e072896e7bdd57c97fa43a9f0e98";
}


x86 assembly (clang, -O0):
<output_hash>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_hash>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [65 x i8] c"6f720a588e1159f839a5b48a1f5f36b4eb57e072896e7bdd57c97fa43a9f0e98\00"
define i8* @output_hash() {
ret i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [65 x i8] c"6f720a588e1159f839a5b48a1f5f36b4eb57e072896e7bdd57c97fa43a9f0e98\00"
define i8* @output_hash() {
ret i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0)
}
int isblank(int c) { return ((c == ' ') || (c == '\t')); }


x86 assembly (clang, -O0):
<isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
char *foo(int bar, char *baz) {
  char *tmp;
  if (bar & 3)
    tmp = baz;
  switch (bar) {
  case 1:
    tmp[5] = 7;
    break;
  case 2:
    tmp[11] = 15;
    break;
  default:
    tmp = 0;
    break;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1122 <foo+0x22>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     1147 <foo+0x47>
jmp    1136 <foo+0x36>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     1154 <foo+0x54>
jmp    1161 <foo+0x61>
mov    -0x18(%rbp),%rax
movb   $0x7,0x5(%rax)
jmp    1169 <foo+0x69>
mov    -0x18(%rbp),%rax
movb   $0xf,0xb(%rax)
jmp    1169 <foo+0x69>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rsi,%rax
cmp    $0x1,%edi
je     1118 <foo+0x18>
cmp    $0x2,%edi
jne    1123 <foo+0x23>
mov    $0xf,%cl
mov    $0xb,%edx
mov    %cl,(%rax,%rdx,1)
ret
mov    $0x7,%cl
mov    $0x5,%edx
mov    %cl,(%rax,%rdx,1)
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @foo(i32 %0, i8* writeonly %1) {
switch i32 %0, label %8 [
i32 1, label %4
i32 2, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %2, %3
%5 = phi i64 [ 11, %3 ], [ 5, %2 ]
%6 = phi i8 [ 15, %3 ], [ 7, %2 ]
%7 = getelementptr inbounds i8, i8* %1, i64 %5
store i8 %6, i8* %7
br label %8
8: ; preds = %4, %2
%9 = phi i8* [ null, %2 ], [ %1, %4 ]
ret i8* %9
}
int my_xfree(void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @my_xfree(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t min_uint32(uint32_t a, uint32_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min_uint32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_uint32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_uint32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min_uint32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min_uint32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ scif_putc(char);
int putc(int c) {
  scif_putc(c);
  if (c == '\n') {
    scif_putc('\r');
  }
  return c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1030 <scif_putc@plt>
cmpl   $0xa,-0x4(%rbp)
jne    113a <putc+0x2a>
mov    $0xd,%edi
call   1030 <scif_putc@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
movsbl %bl,%edi
call   1030 <scif_putc@plt>
cmp    $0xa,%ebx
jne    112a <putc+0x1a>
mov    $0xd,%edi
call   1030 <scif_putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @putc(i32 returned %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @scif_putc(i8 signext %2)
%4 = icmp eq i32 %0, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @scif_putc(i8 signext 13)
br label %7
7: ; preds = %5, %1
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void progress(int p, int n, void *arg) {
  char c = 'B';
  switch (p) {
  case 0:
    c = '.';
    break;
  case 1:
    c = '+';
    break;
  case 2:
    c = '*';
    break;
  default:
    c = '\n';
    break;
  }
  fputc(c, stderr);
}


x86 assembly (clang, -O0):
<progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movb   $0x42,-0x11(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     115b <progress+0x4b>
jmp    1139 <progress+0x29>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     1164 <progress+0x54>
jmp    114a <progress+0x3a>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     116d <progress+0x5d>
jmp    1176 <progress+0x66>
movb   $0x2e,-0x11(%rbp)
jmp    117a <progress+0x6a>
movb   $0x2b,-0x11(%rbp)
jmp    117a <progress+0x6a>
movb   $0x2a,-0x11(%rbp)
jmp    117a <progress+0x6a>
movb   $0xa,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    0x2e5c(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress>:
lea    0x0(,%rdi,8),%ecx
mov    $0x2a2b2e,%eax
shr    %cl,%eax
cmp    $0x3,%edi
mov    $0xa,%ecx
cmovb  %eax,%ecx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
movsbl %cl,%edi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @progress(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store i8 66, i8* %7
%8 = load i32, i32* %4
switch i32 %8, label %12 [
i32 0, label %9
i32 1, label %10
i32 2, label %11
]
9: ; preds = %3
store i8 46, i8* %7
br label %13
10: ; preds = %3
store i8 43, i8* %7
br label %13
11: ; preds = %3
store i8 42, i8* %7
br label %13
12: ; preds = %3
store i8 10, i8* %7
br label %13
13: ; preds = %12, %11, %10, %9
%14 = load i8, i8* %7
%15 = load i32, i32* @stderr
%16 = call i32 @fputc(i8 signext %14, i32 %15)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @progress(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp ult i32 %0, 3
%5 = trunc i32 %0 to i24
%6 = shl i24 %5, 3
%7 = lshr i24 2763566, %6
%8 = trunc i24 %7 to i8
%9 = select i1 %4, i8 %8, i8 10
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputc(i8 signext %9, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void ok(int i) {
  if (i != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     113c <ok+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ok>:
push   %rax
cmp    $0x1,%edi
jne    112d <ok+0xd>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @ok(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @ok(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double atan(double);
double dmnsn_degrees(double radians) { return radians * (45.0 / atan(1.0)); }


x86 assembly (clang, -O0):
<dmnsn_degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed9(%rip),%xmm0
call   1030 <atan@plt>
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmnsn_degrees>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xee2(%rip),%xmm0
call   1030 <atan@plt>
movsd  (%rsp),%xmm0
mulsd  0xed8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dmnsn_degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @atan(double 1.000000e+00)
%5 = fdiv double 4.500000e+01, %4
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @dmnsn_degrees(double %0) {
%2 = tail call double @atan(double 1.000000e+00)
%3 = fmul double %0, 0x404CA5DC1A63C1F8
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ move(int, int);
void DrawTile(int y, int x, char tile) {
  move((int)y, (int)(x * 2));
  addch(tile);
  move((int)y, (int)(x * 2) + 1);
  addch(tile);
}


x86 assembly (clang, -O0):
<DrawTile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
call   1040 <move@plt>
movsbl -0x9(%rbp),%edi
call   1030 <addch@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
call   1040 <move@plt>
movsbl -0x9(%rbp),%edi
call   1030 <addch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawTile>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    (%rbx,%rbx,1),%esi
call   1040 <move@plt>
mov    %r14d,%edi
call   1030 <addch@plt>
lea    (%rbx,%rbx,1),%esi
add    $0x1,%esi
mov    %ebp,%edi
call   1040 <move@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <addch@plt>

LLVM IR (-O0):
define void @DrawTile(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 2
%10 = call i32 @move(i32 %7, i32 %9)
%11 = load i8, i8* %6
%12 = call i32 @addch(i8 signext %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = mul nsw i32 %14, 2
%16 = add nsw i32 %15, 1
%17 = call i32 @move(i32 %13, i32 %16)
%18 = load i8, i8* %6
%19 = call i32 @addch(i8 signext %18)
ret void
}

LLVM IR (-O2):
define void @DrawTile(i32 %0, i32 %1, i8 signext %2) {
%4 = shl nsw i32 %1, 1
%5 = tail call i32 @move(i32 %0, i32 %4)
%6 = tail call i32 @addch(i8 signext %2)
%7 = or i32 %4, 1
%8 = tail call i32 @move(i32 %0, i32 %7)
%9 = tail call i32 @addch(i8 signext %2)
ret void
}