xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ parsecmdline(int, char **);
int /*<<< orphan*/ processcontents();
int /*<<< orphan*/ readinputfile();
int /*<<< orphan*/ writesource();
int main(int argc, char *argv[]) {
  parsecmdline(argc, argv);
  if (!readinputfile())
    return EXIT_FAILURE;
  processcontents();
  writesource();
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <parsecmdline@plt>
mov    $0x0,%al
call   1040 <readinputfile@plt>
cmp    $0x0,%eax
jne    1183 <main+0x43>
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1198 <main+0x58>
mov    $0x0,%al
call   1030 <processcontents@plt>
mov    $0x0,%al
call   1060 <writesource@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <parsecmdline@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <readinputfile@plt>
test   %eax,%eax
je     1163 <main+0x23>
xor    %eax,%eax
call   1030 <processcontents@plt>
xor    %eax,%eax
call   1060 <writesource@plt>
jmp    116c <main+0x2c>
mov    0x2e76(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
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 = load i8**, i8*** %5
%8 = call i32 @parsecmdline(i32 %6, i8** %7)
%9 = call i32 (...) @readinputfile()
%10 = icmp ne i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = load i32, i32* @EXIT_FAILURE
store i32 %12, i32* %3
br label %16
13: ; preds = %2
%14 = call i32 (...) @processcontents()
%15 = call i32 (...) @writesource()
store i32 0, i32* %3
br label %16
16: ; preds = %13, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parsecmdline(i32 %0, i8** %1)
%4 = tail call i32 (...) @readinputfile()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = load i32, i32* @EXIT_FAILURE
br label %11
8: ; preds = %2
%9 = tail call i32 (...) @processcontents()
%10 = tail call i32 (...) @writesource()
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 0, %8 ], [ %7, %6 ]
ret i32 %12
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get4(const void *p) {
  const uint8_t *u = p;
  return (((uint32_t)u[0] << 24) | ((uint32_t)u[1] << 16) |
          ((uint32_t)u[2] << 8) | (uint32_t)u[3]);
}


x86 assembly (clang, -O0):
<get4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x18(%rcx),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get4>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get4(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 16
%11 = or i32 %10, %5
%12 = getelementptr inbounds i8, i8* %0, i64 16
%13 = bitcast i8* %12 to i64*
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = shl i32 %15, 8
%17 = or i32 %11, %16
%18 = getelementptr inbounds i8, i8* %0, i64 24
%19 = bitcast i8* %18 to i64*
%20 = load i64, i64* %19
%21 = trunc i64 %20 to i32
%22 = or i32 %17, %21
ret i32 %22
}
int mdp4_dsi_video_on(struct platform_device *pdev) { return 0; }


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

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

LLVM IR (-O0):
%struct.platform_device = type opaque
define i32 @mdp4_dsi_video_on(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mdp4_dsi_video_on(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
int startswith(const char *str, const char *prefix) {
  while (*str == *prefix) {
    str++, prefix++;
    if (*str == '\0')
      break;
  }
  return *prefix == '\0';
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1154 <startswith+0x54>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114f <startswith+0x4f>
jmp    1154 <startswith+0x54>
jmp    110c <startswith+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
mov    (%rdi),%cl
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rsi,%rax,1),%edx
cmp    %dl,%cl
jne    1128 <startswith+0x28>
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <startswith+0x10>
mov    (%rsi,%rax,1),%dl
xor    %eax,%eax
test   %dl,%dl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @startswith(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %10, %2
%5 = phi i8 [ %3, %2 ], [ %13, %10 ]
%6 = phi i8* [ %0, %2 ], [ %11, %10 ]
%7 = phi i8* [ %1, %2 ], [ %12, %10 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %5, %8
br i1 %9, label %10, label %17
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %10
%16 = load i8, i8* %12
br label %17
17: ; preds = %4, %15
%18 = phi i8 [ %16, %15 ], [ %8, %4 ]
%19 = icmp eq i8 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv, char **environ) {
  int i;
  while (*environ != NULL) {
    printf("%s\n", *environ);
    environ++;
  }
  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    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     115c <main+0x4c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    112a <main+0x1a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    (%rdx),%rsi
test   %rsi,%rsi
je     1144 <main+0x34>
mov    %rdx,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %11, %6 ], [ %4, %3 ]
%8 = phi i8** [ %10, %6 ], [ %2, %3 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret i32 0
}
void coord_l2g() {}


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

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

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

LLVM IR (-O2):
define void @coord_l2g() {
ret void
}
int asc(const void *a, const void *b) { return *(int *)a - *(int *)b; }


x86 assembly (clang, -O0):
<asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned int slapi_unsetbit_int(unsigned int f, unsigned int bitnum) {
  return (f & (~((unsigned int)1 << bitnum)));
}


x86 assembly (clang, -O0):
<slapi_unsetbit_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @slapi_unsetbit_int(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ INT_MIN;
int /*<<< orphan*/ printf(char *, int);
int tsub_ok(int, int /*<<< orphan*/);
int main() {
  printf("tsub_ok ? = %d\n", tsub_ok(-1, INT_MIN));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0xffffffff,%edi
call   1040 <tsub_ok@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"tsub_ok ? = %d\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @INT_MIN
%3 = call i32 @tsub_ok(i32 -1, i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"tsub_ok ? = %d\0A\00"
@INT_MIN = global i32 0
define i32 @main() {
%1 = load i32, i32* @INT_MIN
%2 = tail call i32 @tsub_ok(i32 -1, i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int myAtoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *s = "-1";
  printf("%d\n", myAtoi(s));
  char *s2 = "-123456789123";
  printf("%d\n", myAtoi(s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <myAtoi@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"-1\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [14 x i8] c"-123456789123\00"
define i32 @main() {
%1 = tail call i32 @myAtoi(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @myAtoi(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int func(int);
int main() { return func(-1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%edi
jmp    1030 <func@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @func(i32 -1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 -1)
ret i32 %1
}
/* Variables and functions */
scalar_t__ strtoul(char const *, char **, int /*<<< orphan*/);
double strtod(const char *str, char **endptr) {
  return (double)strtoul(str, endptr, 0);
}


x86 assembly (clang, -O0):
<strtod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoul@plt>
cvtsi2sd %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtod>:
push   %rax
xor    %edx,%edx
call   1030 <strtoul@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @strtod(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 i64 @strtoul(i8* %5, i8** %6, i32 0)
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @strtod(i8* %0, i8** nocapture %1) {
%3 = tail call i64 @strtoul(i8* %0, i8** %1, i32 0)
%4 = sitofp i64 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int client_out_callback(int sock, void *param) {
  printf("client out\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"client out\0A\00"
define i32 @client_out_callback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"client out\00"
define i32 @client_out_callback(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int hwlist_lcd_exterior(const char *value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hwlist_lcd_exterior(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void rpn_indent(int level) {
  int _i;
  for (_i = 0; _i < level; _i++) {
    putchar('>');
  }
  if (level > 0) {
    putchar(' ');
  }
}


x86 assembly (clang, -O0):
<rpn_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <rpn_indent+0x36>
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <rpn_indent+0x12>
cmpl   $0x0,-0x4(%rbp)
jle    115a <rpn_indent+0x4a>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_indent>:
test   %edi,%edi
jle    1144 <rpn_indent+0x34>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x3e,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1120 <rpn_indent+0x10>
test   %ebx,%ebx
lea    0x8(%rsp),%rsp
pop    %rbx
pop    %rbp
jle    1144 <rpn_indent+0x34>
mov    $0x20,%edi
jmp    1030 <putchar@plt>
ret

LLVM IR (-O0):
define void @rpn_indent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @putchar(i8 signext 62)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @putchar(i8 signext 32)
br label %18
18: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
define void @rpn_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i8 signext 62)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3
br i1 %2, label %9, label %11
9: ; preds = %8
%10 = tail call i32 @putchar(i8 signext 32)
br label %11
11: ; preds = %1, %9, %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fread(void *, int, int, int /*<<< orphan*/ *);
int getw(FILE *fp) {
  int x;
  return (fread((void *)&x, sizeof(x), 1, fp) == 1 ? x : EOF);
}


x86 assembly (clang, -O0):
<getw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1147 <getw+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <getw+0x43>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getw>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rcx
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     113b <getw+0x2b>
mov    0x2ead(%rip),%rbx
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @getw(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %4, i32 4, i32 1, i32* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %12
10: ; preds = %1
%11 = load i32, i32* @EOF
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getw(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i8* %3, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
%6 = load i32, i32* %2
%7 = load i32, i32* @EOF
%8 = select i1 %5, i32 %6, i32 %7
ret i32 %8
}
/* Variables and functions */
void *malloc(unsigned long);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, unsigned long);
void *zalloc(unsigned long size) {
  void *ret = malloc(size);
  if (ret)
    memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <zalloc+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <zalloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @zalloc(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 %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = load i64, i64* %2
%11 = call i32 @memset(i8* %9, i32 0, i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @zalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int suma(n1, n2) { return (n1 + n2); }


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

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

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

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint_fast32_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t softfloat_shiftRightJam64(uint64_t a, uint_fast32_t dist) {
  return (dist < 63) ? a >> dist | ((uint64_t)(a << (-dist & 63)) != 0)
                     : (a != 0);
}


x86 assembly (clang, -O0):
<softfloat_shiftRightJam64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x3f,-0x8(%rbp)
jge    1141 <softfloat_shiftRightJam64+0x41>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x3f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <softfloat_shiftRightJam64+0x50>
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_shiftRightJam64>:
cmp    $0x3e,%esi
jg     1119 <softfloat_shiftRightJam64+0x19>
mov    %esi,%ecx
mov    %edi,%edx
sar    %cl,%edx
neg    %cl
shl    %cl,%edi
xor    %eax,%eax
test   %edi,%edi
setne  %al
or     %edx,%eax
ret
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @softfloat_shiftRightJam64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp slt i32 %5, 63
br i1 %6, label %7, label %19
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 0, %12
%14 = and i32 %13, 63
%15 = shl i32 %11, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = or i32 %10, %17
br label %23
19: ; preds = %2
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %19, %7
%24 = phi i32 [ %18, %7 ], [ %22, %19 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @softfloat_shiftRightJam64(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 63
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = ashr i32 %0, %1
%6 = sub nsw i32 0, %1
%7 = and i32 %6, 63
%8 = shl i32 %0, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
%11 = or i32 %5, %10
br label %15
12: ; preds = %2
%13 = icmp ne i32 %0, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %4
%16 = phi i32 [ %11, %4 ], [ %14, %12 ]
ret i32 %16
}
int __ComponentCompare(int a, int b) {
  if (a == b)
    return 0;
  else if (a < b)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<__ComponentCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1122 <__ComponentCompare+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1141 <__ComponentCompare+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113a <__ComponentCompare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <__ComponentCompare+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ComponentCompare>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setge  %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__ComponentCompare(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 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 -1, i32* %3
br label %16
15: ; preds = %10
store i32 1, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @__ComponentCompare(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
int is_machine_big_endian() {
  union {
    int i;
    char c[sizeof(int)];
  } u;
  u.i = 1;
  return (u.c[0] == 0);
}


x86 assembly (clang, -O0):
<is_machine_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @is_machine_big_endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 1, i32* %2
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_machine_big_endian() {
ret i32 0
}
/* Variables and functions */
char *find_last_slash(char const *);
const char *path_basename(const char *path) {
  const char *last = find_last_slash(path);
  if (last)
    return last + 1;
  else
    return path;
}


x86 assembly (clang, -O0):
<path_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <find_last_slash@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1145 <path_basename+0x35>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114d <path_basename+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_basename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <find_last_slash@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @path_basename(i8* %0) {
%2 = tail call i8* @find_last_slash(i8* %0)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t _OneWireIntNumberGet(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = 0;
  if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
       (0x10000000 | 0x000A0000))) {
    ui32Int = 121;
  }
  return (ui32Int);
}


x86 assembly (clang, -O0):
<_OneWireIntNumberGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x100a0000,%eax
jne    112c <_OneWireIntNumberGet+0x2c>
movl   $0x79,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_OneWireIntNumberGet>:
mov    $0x70ff0000,%eax
and    0x400fe000,%eax
xor    %ecx,%ecx
cmp    $0x100a0000,%eax
mov    $0x79,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_OneWireIntNumberGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%5 = and i32 %4, 1895759872
%6 = icmp eq i32 %5, 269090816
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 121, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @_OneWireIntNumberGet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%3 = and i32 %2, 1895759872
%4 = icmp eq i32 %3, 269090816
%5 = select i1 %4, i32 121, i32 0
ret i32 %5
}
__attribute__((always_)) void raid_sse_begin(void) {}


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

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

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

LLVM IR (-O2):
define void @raid_sse_begin() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B();
int /*<<< orphan*/ C();
void setChannel(int k) {
  if (k == 1) {
    B();
    B();
    B();
    C();
  }
  if (k == 2) {
    B();
    B();
    C();
    B();
  }
}


x86 assembly (clang, -O0):
<setChannel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1151 <setChannel+0x31>
mov    $0x0,%al
call   1030 <B@plt>
mov    $0x0,%al
call   1030 <B@plt>
mov    $0x0,%al
call   1030 <B@plt>
mov    $0x0,%al
call   1040 <C@plt>
cmpl   $0x2,-0x4(%rbp)
jne    1177 <setChannel+0x57>
mov    $0x0,%al
call   1030 <B@plt>
mov    $0x0,%al
call   1030 <B@plt>
mov    $0x0,%al
call   1040 <C@plt>
mov    $0x0,%al
call   1030 <B@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setChannel>:
push   %rax
cmp    $0x2,%edi
je     1148 <setChannel+0x28>
cmp    $0x1,%edi
jne    1165 <setChannel+0x45>
xor    %eax,%eax
call   1030 <B@plt>
xor    %eax,%eax
call   1030 <B@plt>
xor    %eax,%eax
call   1030 <B@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <C@plt>
xor    %eax,%eax
call   1030 <B@plt>
xor    %eax,%eax
call   1030 <B@plt>
xor    %eax,%eax
call   1040 <C@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <B@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @setChannel(i32 %0) {
switch i32 %0, label %12 [
i32 1, label %2
i32 2, label %7
]
2: ; preds = %1
%3 = tail call i32 (...) @B()
%4 = tail call i32 (...) @B()
%5 = tail call i32 (...) @B()
%6 = tail call i32 (...) @C()
br label %12
7: ; preds = %1
%8 = tail call i32 (...) @B()
%9 = tail call i32 (...) @B()
%10 = tail call i32 (...) @C()
%11 = tail call i32 (...) @B()
br label %12
12: ; preds = %2, %1, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
void exit(int status) { syscall(60, status, 0, 0); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3c,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <syscall@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    %edi,%esi
mov    $0x3c,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <syscall@plt>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @syscall(i32 60, i32 %0, i32 0, i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __poet_fail();
int nondet(int, int);
int main(void) {
  int x = nondet(1, 5);
  if (x == 7)
    __poet_fail();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x5,%esi
call   1040 <nondet@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jne    1152 <main+0x32>
mov    $0x0,%al
call   1030 <__poet_fail@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x5,%esi
call   1040 <nondet@plt>
cmp    $0x7,%eax
jne    113c <main+0x1c>
xor    %eax,%eax
call   1030 <__poet_fail@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @nondet(i32 1, i32 5)
%2 = icmp eq i32 %1, 7
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__poet_fail()
br label %5
5: ; preds = %3, %0
ret i32 0
}
void test(int x, int y) {
  if (x = y)
    ++x;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1122 <test+0x22>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ fgetc(int /*<<< orphan*/ *);
scalar_t__ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char NESGetChrBankCount(FILE *ifile) {
  if (!ifile)
    return -1;
  if (fseek(ifile, 5, SEEK_SET) != 0) {
    return -1;
  }
  return (char)fgetc(ifile);
}


x86 assembly (clang, -O0):
<NESGetChrBankCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <NESGetChrBankCount+0x20>
movb   $0xff,-0x1(%rbp)
jmp    1176 <NESGetChrBankCount+0x56>
mov    -0x10(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%esi
call   1040 <fseek@plt>
cmp    $0x0,%rax
je     116a <NESGetChrBankCount+0x4a>
movb   $0xff,-0x1(%rbp)
jmp    1176 <NESGetChrBankCount+0x56>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NESGetChrBankCount>:
push   %r14
push   %rbx
push   %rax
mov    $0xff,%r14b
test   %rdi,%rdi
je     1152 <NESGetChrBankCount+0x32>
mov    %rdi,%rbx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
mov    $0x5,%esi
call   1040 <fseek@plt>
test   %rax,%rax
jne    1152 <NESGetChrBankCount+0x32>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %rax,%r14
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define signext i8 @NESGetChrBankCount(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 -1, i8* %2
br label %17
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* @SEEK_SET
%10 = call i64 @fseek(i32* %8, i32 5, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i8 -1, i8* %2
br label %17
13: ; preds = %7
%14 = load i32*, i32** %3
%15 = call i64 @fgetc(i32* %14)
%16 = trunc i64 %15 to i8
store i8 %16, i8* %2
br label %17
17: ; preds = %13, %12, %6
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define signext i8 @NESGetChrBankCount(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @fseek(i32* %0, i32 5, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i64 @fgetc(i32* %0)
%9 = trunc i64 %8 to i8
br label %10
10: ; preds = %3, %1, %7
%11 = phi i8 [ %9, %7 ], [ -1, %1 ], [ -1, %3 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ g3dRenderString(double, double, float *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void scnWriteScore(int score) {
  char text[30];
  float color[4] = {0.8, 0.8, 0.9, 1.0};
  sprintf(text, "Score: %i", score);
  g3dRenderString(0.1, 0.05, color, text);
}


x86 assembly (clang, -O0):
<scnWriteScore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rsi
movsd  0xe9c(%rip),%xmm0
movsd  0xe9c(%rip),%xmm1
call   1030 <g3dRenderString@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scnWriteScore>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,%edx
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee7(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
movsd  0xeb2(%rip),%xmm0
movsd  0xeb2(%rip),%xmm1
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <g3dRenderString@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.scnWriteScore.color = [4 x float] [float 0x3FE99999A0000000, float 0x3FE99999A0000000, float 0x3FECCCCCC0000000, float 1.000000e+00]
@.str = [10 x i8] c"Score: %i\00"
define void @scnWriteScore(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x i8]
%4 = alloca [4 x float]
store i32 %0, i32* %2
%5 = bitcast [4 x float]* %4 to i8*
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [4 x float], [4 x float]* %4, i64 0, i64 0
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%11 = call i32 @g3dRenderString(double 1.000000e-01, double 5.000000e-02, float* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@__const.scnWriteScore.color = [4 x float] [float 0x3FE99999A0000000, float 0x3FE99999A0000000, float 0x3FECCCCCC0000000, float 1.000000e+00]
@.str = [10 x i8] c"Score: %i\00"
define void @scnWriteScore(i32 %0) {
%2 = alloca [30 x i8]
%3 = alloca [4 x float]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = bitcast [4 x float]* %3 to i8*
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%8 = call i32 @g3dRenderString(double 1.000000e-01, double 5.000000e-02, float* %7, i8* %4)
ret void
}
void XRefreshKeyboardMapping() {}


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

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

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

LLVM IR (-O2):
define void @XRefreshKeyboardMapping() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int maze_width(char *maze) {
  char *n;
  n = strchr(maze, '\n');
  return 1 + n - maze;
}


x86 assembly (clang, -O0):
<maze_width>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maze_width>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
sub    %ebx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @maze_width(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8*, i8** %2
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @maze_width(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = ptrtoint i8* %3 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_drain() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_drain"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_stream_drain\00"
define i32 @pa_stream_drain() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void perf_pop(void) {}


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

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

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

LLVM IR (-O2):
define void @perf_pop() {
ret void
}
void file1(void) { printf("Control in function %s\n", __func__); }


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

x86 assembly (clang, -O2):
<file1>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file1 = [6 x i8] c"file1\00"
define void @file1() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file1 = [6 x i8] c"file1\00"
define void @file1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file1, i64 0, i64 0))
ret void
}