xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init() {
  freopen("${PCU_INPUT_FILE}", "r", stdin);
  freopen("${PCU_OUTPUT_FILE}", "w", stdout);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xed4(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <freopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xed7(%rip),%rdi
lea    0xee3(%rip),%rsi
pop    %rax
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"${PCU_INPUT_FILE}\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [19 x i8] c"${PCU_OUTPUT_FILE}\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = call i32 @freopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @freopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"${PCU_INPUT_FILE}\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [19 x i8] c"${PCU_OUTPUT_FILE}\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ret;
  ret = malloc(size);
  if (!ret) {
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xmalloc+0x2e>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
ret i8* %2
}
void radio_enter_powersave(void) {}


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

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

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

LLVM IR (-O2):
define void @radio_enter_powersave() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fsize(char *);
int main(int argc, char *argv[]) {
  if (argc == 1)
    fsize(".");
  else
    while (--argc > 0)
      fsize(*++argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <fsize@plt>
jmp    117a <main+0x6a>
jmp    1146 <main+0x36>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1175 <main+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <fsize@plt>
jmp    1146 <main+0x36>
jmp    117a <main+0x6a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1126 <main+0x16>
lea    0xee1(%rip),%rdi
call   1030 <fsize@plt>
jmp    1154 <main+0x44>
jle    1154 <main+0x44>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%rdi
call   1030 <fsize@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %8, label %16
6: ; preds = %2
%7 = tail call i32 @fsize(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %16
8: ; preds = %4, %8
%9 = phi i8** [ %12, %8 ], [ %1, %4 ]
%10 = phi i32 [ %11, %8 ], [ %0, %4 ]
%11 = add nsw i32 %10, -1
%12 = getelementptr inbounds i8*, i8** %9, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 @fsize(i8* %13)
%15 = icmp ugt i32 %10, 2
br i1 %15, label %8, label %16
16: ; preds = %8, %4, %6
ret i32 0
}
int max(int a, int b, int c) {
  if (a > b)
    if (a > c)
      return a;
    else
      return c;
  else if (b > c)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <max+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <max+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <max+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <max+0x58>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edx,%eax
cmp    %edx,%edi
cmovg  %edi,%eax
cmp    %esi,%eax
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp sgt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
unsigned int pong_get_version(void) { return ((1 << 16) | 0); }


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

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

LLVM IR (-O0):
define i32 @pong_get_version() {
ret i32 65536
}

LLVM IR (-O2):
define i32 @pong_get_version() {
ret i32 65536
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char const *argv[]) {
  int i = 0;
  char Rxbuf[10] = {0x55, 0xAA, 0x0E, 0xCD, 0x0C, 00, 00, 00, 0xA0, 0x3F};
  Rxbuf[4]++;
  uint8_t a;
  a = 4;
  printf("%d, %d\n", a, sizeof a);
  for (int i = 0; i < 10; ++i) {
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    0xecc(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x16(%rbp)
mov    -0x1a(%rbp),%al
add    $0x1,%al
mov    %al,-0x1a(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x4,%edx
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0xa,-0x28(%rbp)
jge    118a <main+0x7a>
jmp    117c <main+0x6c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    116d <main+0x5d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.Rxbuf = [10 x i8] c"U\AA\0E\CD\0C\00\00\00\A0?"
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [10 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = bitcast [10 x i8]* %7 to i8*
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 4
%12 = load i8, i8* %11
%13 = add i8 %12, 1
store i8 %13, i8* %11
store i32 4, i32* %8
%14 = load i32, i32* %8
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %14, i32 4)
store i32 0, i32* %9
br label %16
16: ; preds = %20, %2
%17 = load i32, i32* %9
%18 = icmp slt i32 %17, 10
br i1 %18, label %19, label %23
19: ; preds = %16
br label %20
20: ; preds = %19
%21 = load i32, i32* %9
%22 = add nsw i32 %21, 1
store i32 %22, i32* %9
br label %16
23: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
ret i32 0
}
unsigned xrop3_126_1_1(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;
  stk1 = S ^ T;
  stk2 = D ^ S;
  stk1 = stk1 | stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_126_1_1>:
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    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_126_1_1(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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = xor i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_126_1_1(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int, int);
int /*<<< orphan*/ write(int, char *, int);
void main() {
  int fd;
  fd = open("foo", O_WRONLY | O_CREAT, 0644);
  write(fd, "hello world", 11);
  close(fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
lea    0xeaf(%rip),%rdi
mov    $0x1a4,%edx
call   1050 <open@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xe9c(%rip),%rsi
mov    $0xb,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2e98(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
mov    $0x1a4,%edx
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xea7(%rip),%rsi
mov    %eax,%edi
mov    $0xb,%edx
call   1030 <write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str.1 = [12 x i8] c"hello world\00"
define void @main() {
%1 = alloca i32
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_CREAT
%4 = or i32 %2, %3
%5 = call i32 @open(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4, i32 420)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @write(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%8 = load i32, i32* %1
%9 = call i32 @close(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@.str.1 = [12 x i8] c"hello world\00"
define void @main() {
%1 = load i32, i32* @O_WRONLY
%2 = load i32, i32* @O_CREAT
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3, i32 420)
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 11)
%6 = tail call i32 @close(i32 %4)
ret void
}
int F_modeShapeQuadDrv(int p, int i, double *L, double mdrv[2]) { return 0; }


x86 assembly (clang, -O0):
<F_modeShapeQuadDrv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @F_modeShapeQuadDrv(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @F_modeShapeQuadDrv(i32 %0, i32 %1, double* nocapture readnone %2, double* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_sta();
int /*<<< orphan*/ e_writeback();
void e_sta_abs() {
  e_abs();
  e_sta();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_sta_abs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <e_abs@plt>
mov    $0x0,%al
call   1040 <e_sta@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_sta_abs>:
push   %rax
xor    %eax,%eax
call   1050 <e_abs@plt>
xor    %eax,%eax
call   1040 <e_sta@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_sta_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_sta()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_sta_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_sta()
%3 = tail call i32 (...) @e_writeback()
ret void
}
void UART9BitEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x000000A4))) |= 0x00008000;
}


x86 assembly (clang, -O0):
<UART9BitEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xa4(%rax),%rcx
or     $0x8000,%rcx
mov    %rcx,0xa4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART9BitEnable>:
orq    $0x8000,0xa4(%rdi)
ret

LLVM IR (-O0):
define void @UART9BitEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 164
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 32768
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UART9BitEnable(i64 %0) {
%2 = add i64 %0, 164
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 32768
store volatile i64 %5, i64* %3
ret void
}
int findComplement(int num) {
  if (num < 0)
    return 0;
  if (num == 0)
    return 1;
  int pad = 0;
  while (num > 0) {
    num <<= 1;
    pad++;
  }
  num = (~num) >> pad;
  return num;
}


x86 assembly (clang, -O0):
<findComplement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <findComplement+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    116f <findComplement+0x6f>
cmpl   $0x0,-0x8(%rbp)
jne    1133 <findComplement+0x33>
movl   $0x1,-0x4(%rbp)
jmp    116f <findComplement+0x6f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115b <findComplement+0x5b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <findComplement+0x3a>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findComplement>:
test   %edi,%edi
js     111e <findComplement+0x1e>
je     1121 <findComplement+0x21>
mov    %edi,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
add    %eax,%eax
add    $0x1,%ecx
test   %eax,%eax
jg     1110 <findComplement+0x10>
sar    %cl,%eax
not    %eax
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @findComplement(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %27
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %2
br label %27
12: ; preds = %8
store i32 0, i32* %4
br label %13
13: ; preds = %16, %12
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %3
%18 = shl i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %13
21: ; preds = %13
%22 = load i32, i32* %3
%23 = xor i32 %22, -1
%24 = load i32, i32* %4
%25 = ashr i32 %23, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
store i32 %26, i32* %2
br label %27
27: ; preds = %21, %11, %7
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @findComplement(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %0, %3 ]
%8 = shl nuw i32 %7, 1
%9 = add nuw nsw i32 %6, 1
%10 = icmp sgt i32 %8, 0
br i1 %10, label %5, label %11
11: ; preds = %5
%12 = ashr i32 %8, %9
%13 = xor i32 %12, -1
br label %14
14: ; preds = %3, %1, %11
%15 = phi i32 [ %13, %11 ], [ 0, %1 ], [ 1, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ internal_reset();
int /*<<< orphan*/ main(int /*<<< orphan*/);
void _reset_entry() {
  internal_reset();
  main(0);
}


x86 assembly (clang, -O0):
<_reset_entry>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <internal_reset@plt>
xor    %edi,%edi
call   1040 <main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_reset_entry>:
push   %rax
xor    %eax,%eax
call   1030 <internal_reset@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <main@plt>

LLVM IR (-O0):
define void @_reset_entry() {
%1 = call i32 (...) @internal_reset()
%2 = call i32 @main(i32 0)
ret void
}

LLVM IR (-O2):
define void @_reset_entry() {
%1 = tail call i32 (...) @internal_reset()
%2 = tail call i32 @main(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t);
int /*<<< orphan*/ read_write_data(int, int, size_t);
void recv_data(int socket, int fd, size_t size) {
  printf("receiving data of %u bytes long\n", size);
  read_write_data(socket, fd, size);
}


x86 assembly (clang, -O0):
<recv_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <read_write_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_data>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
mov    %rdx,%rsi
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <read_write_data@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"receiving data of %u bytes long\0A\00"
define void @recv_data(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i64, i64* %6
%12 = call i32 @read_write_data(i32 %9, i32 %10, i64 %11)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"receiving data of %u bytes long\0A\00"
define void @recv_data(i32 %0, i32 %1, i64 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %2)
%5 = tail call i32 @read_write_data(i32 %0, i32 %1, i64 %2)
ret void
}
int main(void) {
  int z = 0;
  for (int i = 0; i < 1000000; i++) {
    z += i;
  }
  return z % 256;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xf4240,-0xc(%rbp)
jge    113d <main+0x3d>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 224
}
const char *rc_version_string() { return "0.3.4"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0.3.4\00"
define i8* @rc_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
void f(char *d) {
  const char a[26] = {
      'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
      'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
  };
  memcpy(d, a, 20);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed4(%rip),%ax
mov    %ax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
movups 0xeef(%rip),%xmm0
movups %xmm0,0xa(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.f.a = [26 x i8] c"abcdefghijklmnopqrstuvwxyz"
define void @f(i8* %0) {
%2 = alloca i8*
%3 = alloca [26 x i8]
store i8* %0, i8** %2
%4 = bitcast [26 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 0
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 20)
ret void
}

LLVM IR (-O2):
@__const.f.a = [26 x i8] c"abcdefghijklmnopqrstuvwxyz"
define void @f(i8* %0) {
%2 = alloca [26 x i8]
%3 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%4 = call i32 @memcpy(i8* %0, i8* %3, i32 20)
ret void
}
/* Type definitions */
struct quat {
  int dummy;
};
struct matrix4 {
  int dummy;
};
struct matrix3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quat_from_matrix4(struct quat *, struct matrix4 const *);
void quat_from_matrix3(struct quat *dst, const struct matrix3 *m) {
  quat_from_matrix4(dst, (const struct matrix4 *)m);
}


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

x86 assembly (clang, -O2):
<quat_from_matrix3>:
jmp    1030 <quat_from_matrix4@plt>

LLVM IR (-O0):
%struct.quat = type { i32 }
%struct.matrix3 = type { i32 }
%struct.matrix4 = type { i32 }
define void @quat_from_matrix3(%struct.quat* %0, %struct.matrix3* %1) {
%3 = alloca %struct.quat*
%4 = alloca %struct.matrix3*
store %struct.quat* %0, %struct.quat** %3
store %struct.matrix3* %1, %struct.matrix3** %4
%5 = load %struct.quat*, %struct.quat** %3
%6 = load %struct.matrix3*, %struct.matrix3** %4
%7 = bitcast %struct.matrix3* %6 to %struct.matrix4*
%8 = call i32 @quat_from_matrix4(%struct.quat* %5, %struct.matrix4* %7)
ret void
}

LLVM IR (-O2):
%struct.quat = type { i32 }
%struct.matrix3 = type { i32 }
%struct.matrix4 = type { i32 }
define void @quat_from_matrix3(%struct.quat* %0, %struct.matrix3* %1) {
%3 = bitcast %struct.matrix3* %1 to %struct.matrix4*
%4 = tail call i32 @quat_from_matrix4(%struct.quat* %0, %struct.matrix4* %3)
ret void
}
/* Variables and functions */
int gsm_hexchar_to_int(char const);
int gsm_hex2_to_byte(const char *hex) {
  int hi = gsm_hexchar_to_int(hex[0]);
  int lo = gsm_hexchar_to_int(hex[1]);
  if (hi < 0 || lo < 0)
    return -1;
  return ((hi << 4) | lo);
}


x86 assembly (clang, -O0):
<gsm_hex2_to_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <gsm_hexchar_to_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <gsm_hexchar_to_int@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     114f <gsm_hex2_to_byte+0x3f>
cmpl   $0x0,-0x18(%rbp)
jge    115b <gsm_hex2_to_byte+0x4b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <gsm_hex2_to_byte+0x57>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm_hex2_to_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <gsm_hexchar_to_int@plt>
mov    %eax,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <gsm_hexchar_to_int@plt>
mov    %ebp,%ecx
shl    $0x4,%ecx
or     %eax,%ecx
or     %eax,%ebp
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gsm_hex2_to_byte(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @gsm_hexchar_to_int(i8 signext %2)
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = tail call i32 @gsm_hexchar_to_int(i8 signext %5)
%7 = icmp slt i32 %3, 0
%8 = icmp slt i32 %6, 0
%9 = select i1 %7, i1 true, i1 %8
%10 = shl i32 %3, 4
%11 = or i32 %6, %10
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
/* Variables and functions */
int _pause(int /*<<< orphan*/);
int pause(void) { return _pause(0); }


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <_pause@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
xor    %edi,%edi
jmp    1030 <_pause@plt>

LLVM IR (-O0):
define i32 @pause() {
%1 = call i32 @_pause(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i32 @_pause(i32 0)
ret i32 %1
}
/* Type definitions */
typedef char *__m128i;

/* Variables and functions */
char *_mm_packs_epi16(char *, char *);
__m128i __attribute__((no, unused)) test(__m128i s1, __m128i s2) {
  __asm("" : "+v"(s1), "+v"(s2));
  return _mm_packs_epi16(s1, s2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
movq   %rcx,%xmm0
movq   %rax,%xmm1
movq   %xmm1,%rax
movq   %xmm0,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <_mm_packs_epi16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movq   %rdi,%xmm0
movq   %rsi,%xmm1
movq   %xmm0,%rdi
movq   %xmm1,%rsi
jmp    1030 <_mm_packs_epi16@plt>

LLVM IR (-O0):
define i8* @test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %5, i8* %6)
%8 = extractvalue { i8*, i8* } %7, 0
%9 = extractvalue { i8*, i8* } %7, 1
store i8* %8, i8** %3
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i8* @_mm_packs_epi16(i8* %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @test(i8* %0, i8* %1) {
%3 = tail call { i8*, i8* } asm "", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i8*, i8* } %3, 0
%5 = extractvalue { i8*, i8* } %3, 1
%6 = tail call i8* @_mm_packs_epi16(i8* %4, i8* %5)
ret i8* %6
}
/* Type definitions */
struct fntfile_hdr {
  int dummy;
};

/* Variables and functions */
int get_offset(struct fntfile_hdr *, int /*<<< orphan*/);
int /*<<< orphan*/ iso8859_to_atari(int);
void font_gen_offset_table(struct fntfile_hdr *fnt, signed int *dst_otab) {
  int i;
  for (i = 0; i < 256; i++)
    dst_otab[i] = get_offset(fnt, iso8859_to_atari(i));
}


x86 assembly (clang, -O0):
<font_gen_offset_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    117a <font_gen_offset_table+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <iso8859_to_atari@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <get_offset@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <font_gen_offset_table+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<font_gen_offset_table>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    %ebx,%edi
call   1030 <iso8859_to_atari@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <get_offset@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1130 <font_gen_offset_table+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.fntfile_hdr = type { i32 }
define void @font_gen_offset_table(%struct.fntfile_hdr* %0, i32* %1) {
%3 = alloca %struct.fntfile_hdr*
%4 = alloca i32*
%5 = alloca i32
store %struct.fntfile_hdr* %0, %struct.fntfile_hdr** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 256
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load %struct.fntfile_hdr*, %struct.fntfile_hdr** %3
%11 = load i32, i32* %5
%12 = call i32 @iso8859_to_atari(i32 %11)
%13 = call i32 @get_offset(%struct.fntfile_hdr* %10, i32 %12)
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %9
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.fntfile_hdr = type { i32 }
define void @font_gen_offset_table(%struct.fntfile_hdr* %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = trunc i64 %4 to i32
%6 = tail call i32 @iso8859_to_atari(i32 %5)
%7 = tail call i32 @get_offset(%struct.fntfile_hdr* %0, i32 %6)
%8 = getelementptr inbounds i32, i32* %1, i64 %4
store i32 %7, i32* %8
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 256
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
int isdigit(int c) { return (unsigned int)c - '0' < 10; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
cmp    $0xa,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 48
%5 = icmp ult i32 %4, 10
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
char *remove_def_marker(char *line) { return line + 1 + (6); }


x86 assembly (clang, -O0):
<remove_def_marker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
add    $0x6,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_def_marker>:
lea    0x7(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @remove_def_marker(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = getelementptr inbounds i8, i8* %4, i64 6
ret i8* %5
}

LLVM IR (-O2):
define i8* @remove_def_marker(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
ret i8* %2
}
/* Variables and functions */
int M_PI;
double acos(double);
double rand_uniform(int, int);
void rand_orientation(double angles[3]) {
  angles[0] = rand_uniform(0, 2 * M_PI);
  angles[1] = acos(rand_uniform(-1, 1));
  angles[2] = rand_uniform(0, 2 * M_PI);
}


x86 assembly (clang, -O0):
<rand_orientation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
shl    $0x1,%esi
xor    %edi,%edi
call   1040 <rand_uniform@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <rand_uniform@plt>
call   1030 <acos@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
shl    $0x1,%esi
xor    %edi,%edi
call   1040 <rand_uniform@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_orientation>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eba(%rip),%r14
mov    (%r14),%esi
add    %esi,%esi
xor    %edi,%edi
call   1040 <rand_uniform@plt>
movsd  %xmm0,(%rbx)
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1040 <rand_uniform@plt>
call   1030 <acos@plt>
movsd  %xmm0,0x8(%rbx)
mov    (%r14),%esi
add    %esi,%esi
xor    %edi,%edi
call   1040 <rand_uniform@plt>
movsd  %xmm0,0x10(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@M_PI = global i32 0
define void @rand_orientation(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load i32, i32* @M_PI
%4 = mul nsw i32 2, %3
%5 = call double @rand_uniform(i32 0, i32 %4)
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
store double %5, double* %7
%8 = call double @rand_uniform(i32 -1, i32 1)
%9 = call double @acos(double %8)
%10 = load double*, double** %2
%11 = getelementptr inbounds double, double* %10, i64 1
store double %9, double* %11
%12 = load i32, i32* @M_PI
%13 = mul nsw i32 2, %12
%14 = call double @rand_uniform(i32 0, i32 %13)
%15 = load double*, double** %2
%16 = getelementptr inbounds double, double* %15, i64 2
store double %14, double* %16
ret void
}

LLVM IR (-O2):
@M_PI = global i32 0
define void @rand_orientation(double* nocapture writeonly %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = tail call double @rand_uniform(i32 0, i32 %3)
store double %4, double* %0
%5 = tail call double @rand_uniform(i32 -1, i32 1)
%6 = tail call double @acos(double %5)
%7 = getelementptr inbounds double, double* %0, i64 1
store double %6, double* %7
%8 = load i32, i32* @M_PI
%9 = shl nsw i32 %8, 1
%10 = tail call double @rand_uniform(i32 0, i32 %9)
%11 = getelementptr inbounds double, double* %0, i64 2
store double %10, double* %11
ret void
}
void test_assert() {
  (__builtin_expect(!(0 && "unreachable"), 0)
       ? __myassert_rtn(
             __func__,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/abduld/clreflect/refs/heads/master/"
             "QMOLEDEV/clang-3.1.src/test/Sema/warn-unreachable.c",
             124, "0 && \"unreachable\"")
       : (void)0);
  return;
}


x86 assembly (clang, -O0):
<test_assert>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x7c,%edx
lea    0xf8f(%rip),%rcx
mov    $0x0,%al
call   1030 <__myassert_rtn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xf98(%rip),%rcx
mov    $0x7c,%edx
xor    %eax,%eax
jmp    1030 <__myassert_rtn@plt>

LLVM IR (-O0):
@__func__.test_assert = [12 x i8] c"test_assert\00"
@.str = [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/abduld/clreflect/refs/heads/master/QMOLEDEV/clang-3.1.src/test/Sema/warn-unreachable.c\00"
@.str.1 = [19 x i8] c"0 && \22unreachable\22\00"
define void @test_assert() {
%1 = call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__myassert_rtn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.test_assert, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.test_assert = [12 x i8] c"test_assert\00"
@.str = [177 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/abduld/clreflect/refs/heads/master/QMOLEDEV/clang-3.1.src/test/Sema/warn-unreachable.c\00"
@.str.1 = [19 x i8] c"0 && \22unreachable\22\00"
define void @test_assert() {
%1 = tail call i32 (i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @__myassert_rtn to i32 (i8*, i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.test_assert, i64 0, i64 0), i8* getelementptr inbounds ([177 x i8], [177 x i8]* @.str, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pollfd {
  int dummy;
};
struct _session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ msglog(int, char *, int);
int stop_session(int, struct pollfd *, struct pollfd *, struct _session *);
int inner_closed(int sesno, struct pollfd *in_fd, struct pollfd *out_fd,
                 struct _session *sess) {
  msglog(1, "[%i.?] <session closed>\n", sesno);
  return stop_session(sesno, in_fd, out_fd, sess);
}


x86 assembly (clang, -O0):
<inner_closed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%edi
lea    0xeba(%rip),%rsi
call   1030 <msglog@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <stop_session@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inner_closed>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec7(%rip),%rsi
mov    $0x1,%edi
mov    %ebp,%edx
call   1030 <msglog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <stop_session@plt>

LLVM IR (-O0):
%struct.pollfd = type { i32 }
%struct._session = type { i32 }
@.str = [25 x i8] c"[%i.?] <session closed>\0A\00"
define i32 @inner_closed(i32 %0, %struct.pollfd* %1, %struct.pollfd* %2, %struct._session* %3) {
%5 = alloca i32
%6 = alloca %struct.pollfd*
%7 = alloca %struct.pollfd*
%8 = alloca %struct._session*
store i32 %0, i32* %5
store %struct.pollfd* %1, %struct.pollfd** %6
store %struct.pollfd* %2, %struct.pollfd** %7
store %struct._session* %3, %struct._session** %8
%9 = load i32, i32* %5
%10 = call i32 @msglog(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %5
%12 = load %struct.pollfd*, %struct.pollfd** %6
%13 = load %struct.pollfd*, %struct.pollfd** %7
%14 = load %struct._session*, %struct._session** %8
%15 = call i32 @stop_session(i32 %11, %struct.pollfd* %12, %struct.pollfd* %13, %struct._session* %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.pollfd = type { i32 }
%struct._session = type { i32 }
@.str = [25 x i8] c"[%i.?] <session closed>\0A\00"
define i32 @inner_closed(i32 %0, %struct.pollfd* %1, %struct.pollfd* %2, %struct._session* %3) {
%5 = tail call i32 @msglog(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @stop_session(i32 %0, %struct.pollfd* %1, %struct.pollfd* %2, %struct._session* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void separate(char *s) { printf("====%s\n", s); }


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

x86 assembly (clang, -O2):
<separate>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"====%s\0A\00"
define void @separate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"====%s\0A\00"
define void @separate(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double scale_h2(double, double, double);
double scale_h3(double, double, double);
double scale_Syz(double x, double y, double z, double dx, double dy,
                 double dz) {
  return scale_h2(x, y, z) * scale_h3(x, y, z) * dy * dz;
}


x86 assembly (clang, -O0):
<scale_Syz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <scale_h2@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1040 <scale_h3@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_Syz>:
sub    $0x38,%rsp
movsd  %xmm5,0x30(%rsp)
movsd  %xmm4,0x28(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <scale_h2@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
call   1040 <scale_h3@plt>
mulsd  0x20(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @scale_Syz(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = call double @scale_h2(double %13, double %14, double %15)
%17 = load double, double* %7
%18 = load double, double* %8
%19 = load double, double* %9
%20 = call double @scale_h3(double %17, double %18, double %19)
%21 = fmul double %16, %20
%22 = load double, double* %11
%23 = fmul double %21, %22
%24 = load double, double* %12
%25 = fmul double %23, %24
ret double %25
}

LLVM IR (-O2):
define double @scale_Syz(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @scale_h2(double %0, double %1, double %2)
%8 = tail call double @scale_h3(double %0, double %1, double %2)
%9 = fmul double %7, %8
%10 = fmul double %9, %4
%11 = fmul double %10, %5
ret double %11
}