xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int q2(char c) {
  if (c == 'a') {
    printf("*** state 2 ***\n");
    return 1;
  } else if (c == 'b') {
    return 0;
  }
}


x86 assembly (clang, -O0):
<q2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jne    1143 <q2+0x33>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1161 <q2+0x51>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    115c <q2+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1161 <q2+0x51>
jmp    1161 <q2+0x51>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q2>:
xor    %eax,%eax
cmp    $0x61,%dil
jne    112e <q2+0x1e>
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@str = [16 x i8] c"*** state 2 ***\00"
define i32 @q2(i8 signext %0) {
%2 = icmp eq i8 %0, 97
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 1, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int chdir(char *);
int /*<<< orphan*/ extract_dir(char *);
int lcd(char *line) {
  extract_dir(line);
  return chdir(line);
}


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

x86 assembly (clang, -O2):
<lcd>:
push   %rbx
mov    %rdi,%rbx
call   1040 <extract_dir@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <chdir@plt>

LLVM IR (-O0):
define i32 @lcd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @extract_dir(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @chdir(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @lcd(i8* %0) {
%2 = tail call i32 @extract_dir(i8* %0)
%3 = tail call i32 @chdir(i8* %0)
ret i32 %3
}
int isatty(int fd) {}


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

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

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

LLVM IR (-O2):
define i32 @isatty(i32 %0) {
ret i32 undef
}
void __elv_add_request(struct request_queue *x, struct request *y, int z,
                       int v) {
  return;
}


x86 assembly (clang, -O0):
<__elv_add_request>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.request_queue = type opaque
%struct.request = type opaque
define void @__elv_add_request(%struct.request_queue* %0, %struct.request* %1, i32 %2, i32 %3) {
%5 = alloca %struct.request_queue*
%6 = alloca %struct.request*
%7 = alloca i32
%8 = alloca i32
store %struct.request_queue* %0, %struct.request_queue** %5
store %struct.request* %1, %struct.request** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.request = type opaque
define void @__elv_add_request(%struct.request_queue* nocapture %0, %struct.request* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ flags;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int set_nodelay(int fd, void *optval, int optlen) {
  int rc;
  int flags = *(int *)optval ? 1 : 0;
  rc = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flags, sizeof(flags));
  return rc;
}


x86 assembly (clang, -O0):
<set_nodelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2e9d(%rip),%rax
mov    (%rax),%edx
lea    -0x1c(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nodelay>:
push   %rax
xor    %eax,%eax
cmpl   $0x0,(%rsi)
setne  %al
mov    %eax,0x4(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @set_nodelay(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
store i32 %14, i32* %8
%15 = load i32, i32* %4
%16 = load i32, i32* @IPPROTO_TCP
%17 = load i32, i32* @TCP_NODELAY
%18 = call i32 @setsockopt(i32 %15, i32 %16, i32 %17, i32* %8, i32 4)
store i32 %18, i32* %7
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @set_nodelay(i32 %0, i8* nocapture %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* @IPPROTO_TCP
%11 = load i32, i32* @TCP_NODELAY
%12 = call i32 @setsockopt(i32 %0, i32 %10, i32 %11, i32* %4, i32 4)
ret i32 %12
}
/* Variables and functions */
unsigned int _bzhi_u32(unsigned int, int);
unsigned int f14(unsigned int x) { return _bzhi_u32(x, 289); }


x86 assembly (clang, -O0):
<f14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x121,%esi
call   1030 <_bzhi_u32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f14>:
mov    $0x121,%esi
jmp    1030 <_bzhi_u32@plt>

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

LLVM IR (-O2):
define i32 @f14(i32 %0) {
%2 = tail call i32 @_bzhi_u32(i32 %0, i32 289)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x26() {
  Assert_real((isbdigit(38) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              195, ("isbdigit should be 0 for &"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x26>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xc3,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x26>:
push   %rax
mov    $0x26,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xc3,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for &\00"
define void @t_isbdigit_0x26() {
%1 = call i64 @isbdigit(i32 38)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for &\00"
define void @t_isbdigit_0x26() {
%1 = tail call i64 @isbdigit(i32 38)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void classStart2LBOX() {}


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

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

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

LLVM IR (-O2):
define void @classStart2LBOX() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ gettid();
int /*<<< orphan*/ tkill(int /*<<< orphan*/, int /*<<< orphan*/);
int fn(void *unused) {
  tkill(gettid(), SIGUSR1);
  return 0;
}


x86 assembly (clang, -O0):
<fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gettid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <tkill@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn>:
push   %rax
xor    %eax,%eax
call   1030 <gettid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <tkill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define i32 @fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @gettid()
%4 = load i32, i32* @SIGUSR1
%5 = call i32 @tkill(i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define i32 @fn(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @gettid()
%3 = load i32, i32* @SIGUSR1
%4 = tail call i32 @tkill(i32 %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AND_HOST_REG_L(int, int);
int TEST_HOST_REG_W(int dst_reg, int src_reg) {
  AND_HOST_REG_L(dst_reg, src_reg);
  return dst_reg;
}


x86 assembly (clang, -O0):
<TEST_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <AND_HOST_REG_L@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_HOST_REG_W>:
push   %rbx
mov    %edi,%ebx
call   1030 <AND_HOST_REG_L@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @TEST_HOST_REG_W(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 = call i32 @AND_HOST_REG_L(i32 %5, i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @TEST_HOST_REG_W(i32 returned %0, i32 %1) {
%3 = tail call i32 @AND_HOST_REG_L(i32 %0, i32 %1)
ret i32 %0
}
unsigned int buggy(unsigned int *param) {
  unsigned int accu, zero = 0, borrow;
  accu = -*param;
  borrow = -(accu > zero);
  *param += accu;
  return borrow;
}


x86 assembly (clang, -O0):
<buggy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buggy>:
xor    %eax,%eax
cmp    (%rdi),%eax
sbb    %eax,%eax
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i32 @buggy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = sub i32 0, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp ugt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = add i32 %16, %14
store i32 %17, i32* %15
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
define i32 @buggy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = sext i1 %3 to i32
store i32 0, i32* %0
ret i32 %4
}
/* Variables and functions */
long long simple_strtoull_patch(char const *, char **, unsigned int);
long long simple_strtoll_patch(const char *cp, char **endp, unsigned int base) {
  if (*cp == '-')
    return -simple_strtoull_patch(cp + 1, endp, base);
  return simple_strtoull_patch(cp, endp, base);
}


x86 assembly (clang, -O0):
<simple_strtoll_patch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1158 <simple_strtoll_patch+0x48>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <simple_strtoull_patch@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    116c <simple_strtoll_patch+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <simple_strtoull_patch@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_strtoll_patch>:
push   %rax
cmpb   $0x2d,(%rdi)
jne    1124 <simple_strtoll_patch+0x14>
add    $0x1,%rdi
call   1030 <simple_strtoull_patch@plt>
neg    %rax
pop    %rcx
ret
pop    %rax
jmp    1030 <simple_strtoull_patch@plt>

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

LLVM IR (-O2):
define i64 @simple_strtoll_patch(i8* %0, i8** %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i64 @simple_strtoull_patch(i8* %7, i8** %1, i32 %2)
%9 = sub nsw i64 0, %8
br label %12
10: ; preds = %3
%11 = tail call i64 @simple_strtoull_patch(i8* %0, i8** %1, i32 %2)
br label %12
12: ; preds = %10, %6
%13 = phi i64 [ %9, %6 ], [ %11, %10 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void errors(int value) {
  if (value != 0 && value < 100)
    if (value > 100) {
      printf("\nERROR CODE: %i\n", value);
      exit(8);
    }
}


x86 assembly (clang, -O0):
<errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1167 <errors+0x47>
cmpl   $0x64,-0x4(%rbp)
jge    1167 <errors+0x47>
cmpl   $0x64,-0x4(%rbp)
jle    1162 <errors+0x42>
mov    -0x4(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    $0x8,%edi
call   1040 <exit@plt>
jmp    1167 <errors+0x47>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @errors(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int_error(int, char *);
void gd_filetype_function(int type) {
  int_error((-1), "This copy of gnuplot cannot read png/gif/jpeg images");
}


x86 assembly (clang, -O0):
<gd_filetype_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
lea    0xed9(%rip),%rsi
call   1030 <int_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gd_filetype_function>:
lea    0xee9(%rip),%rsi
mov    $0xffffffff,%edi
jmp    1030 <int_error@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"This copy of gnuplot cannot read png/gif/jpeg images\00"
define void @gd_filetype_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @int_error(i32 -1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"This copy of gnuplot cannot read png/gif/jpeg images\00"
define void @gd_filetype_function(i32 %0) {
%2 = tail call i32 @int_error(i32 -1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int lib_func();
int main(int argc, char *argv[]) { return lib_func(); }


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    $0x0,%al
call   1030 <lib_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lib_func()
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;

/* Variables and functions */
int /*<<< orphan*/ focus_override_translations(int /*<<< orphan*/);
int /*<<< orphan*/ focus_put(int /*<<< orphan*/);
void focus_add(Widget w) {
  focus_override_translations(w);
  focus_put(w);
}


x86 assembly (clang, -O0):
<focus_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <focus_override_translations@plt>
mov    -0x4(%rbp),%edi
call   1030 <focus_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<focus_add>:
push   %rbx
mov    %edi,%ebx
call   1040 <focus_override_translations@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <focus_put@plt>

LLVM IR (-O0):
define void @focus_add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @focus_override_translations(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @focus_put(i32 %5)
ret void
}

LLVM IR (-O2):
define void @focus_add(i32 %0) {
%2 = tail call i32 @focus_override_translations(i32 %0)
%3 = tail call i32 @focus_put(i32 %0)
ret void
}
void answer_random(void) {}


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

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

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

LLVM IR (-O2):
define void @answer_random() {
ret void
}
const char *str_expr_assign_compound() { return "compound-assignment"; }


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"compound-assignment\00"
define i8* @str_expr_assign_compound() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_too_many_parameters(void) { puts("--- Too many parameters ---\n"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"--- Too many parameters ---\0A\00"
define void @print_too_many_parameters() {
%1 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"--- Too many parameters ---\0A\00"
define void @print_too_many_parameters() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct wpa_ssid {
  int dummy;
};
struct parse_data {
  int dummy;
};

/* Variables and functions */
char *wpa_config_write_wep_key(struct wpa_ssid *, int);
char *wpa_config_write_wep_key3(const struct parse_data *data,
                                struct wpa_ssid *ssid) {
  return wpa_config_write_wep_key(ssid, 3);
}


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

x86 assembly (clang, -O2):
<wpa_config_write_wep_key3>:
mov    %rsi,%rdi
mov    $0x3,%esi
jmp    1030 <wpa_config_write_wep_key@plt>

LLVM IR (-O0):
%struct.parse_data = type { i32 }
%struct.wpa_ssid = type { i32 }
define i8* @wpa_config_write_wep_key3(%struct.parse_data* %0, %struct.wpa_ssid* %1) {
%3 = alloca %struct.parse_data*
%4 = alloca %struct.wpa_ssid*
store %struct.parse_data* %0, %struct.parse_data** %3
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %4
%5 = load %struct.wpa_ssid*, %struct.wpa_ssid** %4
%6 = call i8* @wpa_config_write_wep_key(%struct.wpa_ssid* %5, i32 3)
ret i8* %6
}

LLVM IR (-O2):
%struct.parse_data = type { i32 }
%struct.wpa_ssid = type { i32 }
define i8* @wpa_config_write_wep_key3(%struct.parse_data* nocapture readnone %0, %struct.wpa_ssid* %1) {
%3 = tail call i8* @wpa_config_write_wep_key(%struct.wpa_ssid* %1, i32 3)
ret i8* %3
}
int access(const char *path, int mode) { return 0; }


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

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

LLVM IR (-O0):
define i32 @access(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @access(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int write_block(int, int, int, int /*<<< orphan*/);
int pinMode(int pin, int mode) { return write_block(5, pin, mode, 0); }


x86 assembly (clang, -O0):
<pinMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x5,%edi
xor    %ecx,%ecx
call   1030 <write_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinMode>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x5,%edi
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @pinMode(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 = call i32 @write_block(i32 5, i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pinMode(i32 %0, i32 %1) {
%3 = tail call i32 @write_block(i32 5, i32 %0, i32 %1, i32 0)
ret i32 %3
}
__attribute__((weak)) double sin(double a) { return a; }


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

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

LLVM IR (-O0):
define weak double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define weak double @sin(double %0) {
ret double %0
}
/* Type definitions */
typedef int __u64;
typedef int __u32;

/* Variables and functions */
int ntohl(int);
__u64 ntohll(__u64 a) {
  __u32 lo = a & 0xffffffff;
  __u32 hi = a >> 32U;
  lo = ntohl(lo);
  hi = ntohl(hi);
  return ((__u64)lo) << 32U | hi;
}


x86 assembly (clang, -O0):
<ntohll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohll>:
push   %rax
call   1030 <ntohl@plt>
pop    %rax
jmp    1030 <ntohl@plt>

LLVM IR (-O0):
define i32 @ntohll(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, -1
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 32
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = call i32 @ntohl(i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @ntohl(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = shl i32 %13, 32
%15 = load i32, i32* %4
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @ntohll(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = tail call i32 @ntohl(i32 poison)
ret i32 poison
}
int do_806() { return 806; }


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

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

LLVM IR (-O0):
define i32 @do_806() {
ret i32 806
}

LLVM IR (-O2):
define i32 @do_806() {
ret i32 806
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("sasha ma bea!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"sasha ma bea!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ string_contains_q(char *);
int main() {
  char expression[50];
  puts("Enter an expression to be evaluated:");
  while (string_contains_q(expression) == 0) {
    scanf("%s", expression);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
lea    -0x40(%rbp),%rdi
call   1030 <string_contains_q@plt>
cmp    $0x0,%rax
jne    1173 <main+0x43>
lea    -0x40(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1050 <scanf@plt>
jmp    114b <main+0x1b>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rdi
call   1030 <string_contains_q@plt>
test   %rax,%rax
jne    1178 <main+0x48>
lea    0xece(%rip),%r14
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <string_contains_q@plt>
test   %rax,%rax
je     1160 <main+0x30>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Enter an expression to be evaluated:\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i64 @string_contains_q(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %4
11: ; preds = %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [37 x i8] c"Enter an expression to be evaluated:\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @string_contains_q(i8* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i64 @string_contains_q(i8* %2)
%9 = icmp eq i64 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world!");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int send_actuator_data(float x, float y, float z) { return 0; }


x86 assembly (clang, -O0):
<send_actuator_data>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @send_actuator_data(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @send_actuator_data(float %0, float %1, float %2) {
ret i32 0
}
void ytht_normalize(char *buf) {
  int i = 0;
  while (buf[i]) {
    if (buf[i] == '/')
      buf[i] = ':';
    i++;
  }
}


x86 assembly (clang, -O0):
<ytht_normalize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1150 <ytht_normalize+0x50>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1142 <ytht_normalize+0x42>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x3a,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ytht_normalize+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ytht_normalize>:
jmp    1117 <ytht_normalize+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x3a,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2f,%al
je     1110 <ytht_normalize+0x10>
test   %al,%al
jne    1113 <ytht_normalize+0x13>
ret

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

LLVM IR (-O2):
define void @ytht_normalize(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 47, label %6
]
6: ; preds = %2
store i8 58, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void cvt_u8ALPHA_u8RGB(const uint8_t *src, uint8_t *dest, int w) {
  int x;
  for (x = 0; x < w; ++x) {
    *dest++ = 0;
    *dest++ = 0;
    *dest++ = 0;
  }
}


x86 assembly (clang, -O0):
<cvt_u8ALPHA_u8RGB>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116f <cvt_u8ALPHA_u8RGB+0x6f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <cvt_u8ALPHA_u8RGB+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_u8ALPHA_u8RGB>:
test   %edx,%edx
jle    112d <cvt_u8ALPHA_u8RGB+0x1d>
push   %rax
mov    %edx,%eax
shl    $0x2,%rax
lea    (%rax,%rax,2),%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @cvt_u8ALPHA_u8RGB(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i32 1
store i32* %14, i32** %5
store i32 0, i32* %13
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %5
store i32 0, i32* %15
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i32 1
store i32* %18, i32** %5
store i32 0, i32* %17
br label %19
19: ; preds = %12
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @cvt_u8ALPHA_u8RGB(i32* nocapture readnone %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = bitcast i32* %1 to i8*
%7 = zext i32 %2 to i64
%8 = mul nuw nsw i64 %7, 12
br label %9
9: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_float(float);
int /*<<< orphan*/ show_int(int);
void float_eg() {
  int x = 3490593;
  float f = (float)x;
  show_int(x);
  show_float(f);
}


x86 assembly (clang, -O0):
<float_eg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x354321,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <show_int@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <show_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_eg>:
push   %rax
mov    $0x354321,%edi
call   1040 <show_int@plt>
movss  0xecd(%rip),%xmm0
pop    %rax
jmp    1030 <show_float@plt>

LLVM IR (-O0):
define void @float_eg() {
%1 = alloca i32
%2 = alloca float
store i32 3490593, i32* %1
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to float
store float %4, float* %2
%5 = load i32, i32* %1
%6 = call i32 @show_int(i32 %5)
%7 = load float, float* %2
%8 = call i32 @show_float(float %7)
ret void
}

LLVM IR (-O2):
define void @float_eg() {
%1 = tail call i32 @show_int(i32 3490593)
%2 = tail call i32 @show_float(float 0x414AA19080000000)
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char);
scalar_t__ toupper(char);
int a_to_hex(register char ch) {
  ch = (char)toupper(ch);
  if (isdigit(ch))
    return (ch - '0');
  else
    return (ch - ('A' - 0x0a));
}


x86 assembly (clang, -O0):
<a_to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <toupper@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     115c <a_to_hex+0x3c>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <a_to_hex+0x46>
movsbl -0x5(%rbp),%eax
sub    $0x37,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_to_hex>:
push   %rbx
call   1040 <toupper@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1030 <isdigit@plt>
lea    -0x30(%rbx),%ecx
add    $0xffffffc9,%ebx
test   %rax,%rax
cmovne %ecx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a_to_hex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @toupper(i8 signext %4)
%6 = trunc i64 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = call i64 @isdigit(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
store i32 %13, i32* %2
br label %18
14: ; preds = %1
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = sub nsw i32 %16, 55
store i32 %17, i32* %2
br label %18
18: ; preds = %14, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @a_to_hex(i8 signext %0) {
%2 = tail call i64 @toupper(i8 signext %0)
%3 = trunc i64 %2 to i8
%4 = tail call i64 @isdigit(i8 signext %3)
%5 = icmp eq i64 %4, 0
%6 = sext i8 %3 to i32
%7 = select i1 %5, i32 -55, i32 -48
%8 = add nsw i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ init_emul(int, int, int);
int /*<<< orphan*/ next_year();
int /*<<< orphan*/ show_stat();
int main(int argc, char *argv[]) {
  int i;
  init_emul(2014, 20000 / 2, 20000 / 2);
  show_stat();
  for (i = 0; i < 2000; i++) {
    next_year();
    { show_stat(); }
  }
  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    $0x7de,%edi
mov    $0x2710,%edx
mov    %edx,%esi
call   1050 <init_emul@plt>
mov    $0x0,%al
call   1040 <show_stat@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x7d0,-0x14(%rbp)
jge    118e <main+0x5e>
mov    $0x0,%al
call   1030 <next_year@plt>
mov    $0x0,%al
call   1040 <show_stat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1165 <main+0x35>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x7de,%edi
mov    $0x2710,%esi
mov    $0x2710,%edx
call   1050 <init_emul@plt>
xor    %eax,%eax
call   1040 <show_stat@plt>
mov    $0x7d0,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <next_year@plt>
xor    %eax,%eax
call   1040 <show_stat@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @init_emul(i32 2014, i32 10000, i32 10000)
%8 = call i32 (...) @show_stat()
store i32 0, i32* %6
br label %9
9: ; preds = %15, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 2000
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = call i32 (...) @next_year()
%14 = call i32 (...) @show_stat()
br label %15
15: ; preds = %12
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %9
18: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @init_emul(i32 2014, i32 10000, i32 10000)
%4 = tail call i32 (...) @show_stat()
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %9, %5 ]
%7 = tail call i32 (...) @next_year()
%8 = tail call i32 (...) @show_stat()
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, 2000
br i1 %10, label %11, label %5
11: ; preds = %5
ret i32 0
}
void g_cclosure_marshal_VOID__PARAM() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__PARAM() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(int);
void strskp(char **str) {
  char *s;
  if (!str)
    return;
  s = *str;
  while (isspace((int)*s))
    s++;
  *str = s;
}


x86 assembly (clang, -O0):
<strskp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <strskp+0x1c>
jmp    1169 <strskp+0x59>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     115e <strskp+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <strskp+0x27>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strskp>:
test   %rdi,%rdi
je     114c <strskp+0x3c>
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
add    $0xffffffffffffffff,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1130 <strskp+0x20>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @strskp(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
br label %5
5: ; preds = %5, %3
%6 = phi i8* [ %4, %3 ], [ %11, %5 ]
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i64 @isspace(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %10, label %12, label %5
12: ; preds = %5
store i8* %6, i8** %0
br label %13
13: ; preds = %1, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void subrot(char *arg) {
  char s[21];
  s[20] = 0;
  memmove(s, arg, 20);
  printf("Received argument: [%s]\n", s);
}


x86 assembly (clang, -O0):
<subrot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x14,%edx
call   1040 <memmove@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subrot>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
movb   $0x0,0x14(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%edx
call   1040 <memmove@plt>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Received argument: [%s]\0A\00"
define void @subrot(i8* %0) {
%2 = alloca i8*
%3 = alloca [21 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 20
store i8 0, i8* %4
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @memmove(i8* %5, i8* %6, i32 20)
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Received argument: [%s]\0A\00"
define void @subrot(i8* %0) {
%2 = alloca [21 x i8]
%3 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 20
store i8 0, i8* %4
%5 = call i32 @memmove(i8* %3, i8* %0, i32 20)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
double sqrt(double);
double calcHypotenuse(double side1, double side2) {
  double squareHypotenuse = (side1 * side1) + (side2 * side2);
  return sqrt(squareHypotenuse);
}


x86 assembly (clang, -O0):
<calcHypotenuse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcHypotenuse>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <calcHypotenuse+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @calcHypotenuse(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = call double @llvm.fmuladd.f64(double %6, double %7, double %10)
store double %11, double* %5
%12 = load double, double* %5
%13 = call double @sqrt(double %12)
ret double %13
}

LLVM IR (-O2):
define double @calcHypotenuse(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}