xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SHUT_RD;
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ shutdown(int, int /*<<< orphan*/);
void shutdown_and_exit(int s) {
  if (shutdown(s, SHUT_RD) < 0)
    err(-1, "shutdown_and_exit: shutdown");
  exit(0);
}


x86 assembly (clang, -O0):
<shutdown_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
cmp    $0x0,%rax
jge    1167 <shutdown_and_exit+0x37>
mov    $0xffffffff,%edi
lea    0xe9e(%rip),%rsi
call   1040 <err@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<shutdown_and_exit>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
test   %rax,%rax
jns    1155 <shutdown_and_exit+0x25>
lea    0xeb5(%rip),%rsi
mov    $0xffffffff,%edi
call   1040 <err@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SHUT_RD = global i32 0
@.str = [28 x i8] c"shutdown_and_exit: shutdown\00"
define void @shutdown_and_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SHUT_RD
%5 = call i64 @shutdown(i32 %3, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err(i32 -1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SHUT_RD = global i32 0
@.str = [28 x i8] c"shutdown_and_exit: shutdown\00"
define void @shutdown_and_exit(i32 %0) {
%2 = load i32, i32* @SHUT_RD
%3 = tail call i64 @shutdown(i32 %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @exit(i32 0)
unreachable
}
void I2CMasterIntClear(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000001C))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000018))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CMasterIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0x1c(%rax)
mov    -0x8(%rbp),%rax
movq   $0x1,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntClear>:
movq   $0x1,0x1c(%rdi)
movq   $0x1,0x18(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 28
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
%6 = load i64, i64* %2
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
store volatile i64 1, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntClear(i64 %0) {
%2 = add i64 %0, 28
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
%4 = add i64 %0, 24
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ write_pngs(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                              char *);
int main(int argc, char **argv) {
  write_pngs("%04d.png", atoi(argv[1]), atoi(argv[2]), argv[3]);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atoi@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xe99(%rip),%rdi
call   1040 <write_pngs@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1030 <atoi@plt>
mov    0x18(%rbx),%rcx
lea    0xebb(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <write_pngs@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%04d.png\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 3
%16 = load i8*, i8** %15
%17 = call i32 @write_pngs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %13, i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%04d.png\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i32 @write_pngs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i8* %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x11_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x11_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x11_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x11_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x11_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, unsigned int const);
void strnsub(char *dest, const char *src, const unsigned int sindex,
             const unsigned int eindex, const unsigned int size) {
  strncpy(dest, src + sindex,
          ((eindex - sindex) > size) ? size : eindex - sindex);
}


x86 assembly (clang, -O0):
<strnsub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jbe    115a <strnsub+0x4a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    1163 <strnsub+0x53>
mov    -0x18(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnsub>:
mov    %edx,%eax
add    %rax,%rsi
sub    %edx,%ecx
cmp    %r8d,%ecx
cmova  %r8d,%ecx
mov    %ecx,%edx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @strnsub(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = zext i32 %2 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
%8 = sub i32 %3, %2
%9 = icmp ugt i32 %8, %4
%10 = select i1 %9, i32 %4, i32 %8
%11 = tail call i32 @strncpy(i8* %0, i8* %7, i32 %10)
ret void
}
int tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_encrypted_extensions_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
char *getExecutablePath();
char *mkString(char *, char *);
int /*<<< orphan*/ run(char *, int /*<<< orphan*/, int /*<<< orphan*/ *, int,
                       char **);
int main(int argc, char **argv) {
  char *binDir;
  char *exePath;
  binDir = getExecutablePath();
  exePath = mkString("%s/ghc.exe", binDir);
  run(exePath, 0, NULL, argc - 1, argv + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getExecutablePath@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1050 <mkString@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%r8
add    $0x8,%r8
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <run@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getExecutablePath@plt>
lea    0xeba(%rip),%rdi
mov    %rax,%rsi
call   1050 <mkString@plt>
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %ebp,%ecx
mov    %rbx,%r8
call   1040 <run@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s/ghc.exe\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i8* (...) @getExecutablePath()
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i8* @mkString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = load i8**, i8*** %4
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = call i32 @run(i8* %10, i32 0, i32* null, i32 %12, i8** %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s/ghc.exe\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i8* (...) @getExecutablePath()
%4 = tail call i8* @mkString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = add nsw i32 %0, -1
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = tail call i32 @run(i8* %4, i32 0, i32* null, i32 %5, i8** %6)
ret i32 0
}
long long int wbt_mq_msg_status_delayed() { return 0; }


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

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

LLVM IR (-O0):
define i64 @wbt_mq_msg_status_delayed() {
ret i64 0
}

LLVM IR (-O2):
define i64 @wbt_mq_msg_status_delayed() {
ret i64 0
}
int organizational_parameters_valid(rows, cols, Ndwl, Ndbl, Nspd, Ntwl, Ntbl,
                                    Ntspd)
int rows, cols, Ndwl, Ndbl, Nspd, Ntwl, Ntbl, Ntspd;
{
  if (Ndwl * Ndbl > 8)
    return (0);
  if (Ntwl * Ntbl > 8)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<organizational_parameters_valid>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cmp    $0x8,%eax
jle    113a <organizational_parameters_valid+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    115d <organizational_parameters_valid+0x5d>
mov    -0x1c(%rbp),%eax
imul   0x10(%rbp),%eax
cmp    $0x8,%eax
jle    1156 <organizational_parameters_valid+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <organizational_parameters_valid+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<organizational_parameters_valid>:
imul   %ecx,%edx
cmp    $0x9,%edx
setl   %al
imul   0x8(%rsp),%r9d
cmp    $0x9,%r9d
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @organizational_parameters_valid(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = mul nsw i32 %3, %2
%10 = icmp slt i32 %9, 9
%11 = mul nsw i32 %6, %5
%12 = icmp slt i32 %11, 9
%13 = select i1 %10, i1 %12, i1 false
%14 = zext i1 %13 to i32
ret i32 %14
}
void ExttMySQLAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttMySQLAuxTable() {
ret void
}
float obdConvert_22(unsigned int A, unsigned int B, unsigned int C,
                    unsigned int D) {
  return ((float)A * 256.0f + (float)B) * 0.079f;
}


x86 assembly (clang, -O0):
<obdConvert_22>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm1
movss  0xedc(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xec8(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obdConvert_22>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
mov    %esi,%eax
cvtsi2ss %rax,%xmm1
mulss  0xeea(%rip),%xmm0
addss  %xmm1,%xmm0
mulss  0xee2(%rip),%xmm0
ret

LLVM IR (-O0):
define float @obdConvert_22(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = uitofp i32 %9 to float
%11 = load i32, i32* %6
%12 = uitofp i32 %11 to float
%13 = call float @llvm.fmuladd.f32(float %10, float 2.560000e+02, float %12)
%14 = fmul float %13, 0x3FB4395820000000
ret float %14
}

LLVM IR (-O2):
define float @obdConvert_22(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %0 to float
%6 = uitofp i32 %1 to float
%7 = tail call float @llvm.fmuladd.f32(float %5, float 2.560000e+02, float %6)
%8 = fmul float %7, 0x3FB4395820000000
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ quicksort(int *, int /*<<< orphan*/, int);
int main(void) {
  int a[] = {500, 7, 899, 9, 9, 9, 9, 9, 9, 20, 60, 80};
  quicksort(a, 0, sizeof(a) / sizeof(a[0]) - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <quicksort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0xb,%edx
call   1030 <quicksort@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [12 x i32] [i32 500, i32 7, i32 899, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 20, i32 60, i32 80]
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i32]
store i32 0, i32* %1
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 @quicksort(i32* %4, i32 0, i32 11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [12 x i32] [i32 500, i32 7, i32 899, i32 9, i32 9, i32 9, i32 9, i32 9, i32 9, i32 20, i32 60, i32 80]
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @quicksort(i32* %3, i32 0, i32 11)
ret i32 0
}
int Bematech_FI_DescricaoTotalizadoresNaoFiscais(Var, Retorno) {
  return Formata("\x1b|35|25|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_DescricaoTotalizadoresNaoFiscais>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_DescricaoTotalizadoresNaoFiscais>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|25|\1B\00"
define i32 @Bematech_FI_DescricaoTotalizadoresNaoFiscais(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 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|25|\1B\00"
define i32 @Bematech_FI_DescricaoTotalizadoresNaoFiscais(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
void pcilog(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @pcilog(i8* nocapture %0, ...) {
ret void
}
unsigned short fnSetBit(unsigned short uVal, unsigned short uPos) {
  unsigned short uMask = 1;
  uMask = uMask << (uPos - 1);
  uVal = uVal | uMask;
  return uVal;
}


x86 assembly (clang, -O0):
<fnSetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x4(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x6(%rbp),%ecx
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnSetBit>:
mov    %edi,%eax
add    $0xff,%sil
bts    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @fnSetBit(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
store i16 1, i16* %5
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %9, 1
%11 = shl i32 %7, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %5
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = load i16, i16* %5
%16 = zext i16 %15 to i32
%17 = or i32 %14, %16
%18 = trunc i32 %17 to i16
store i16 %18, i16* %3
%19 = load i16, i16* %3
ret i16 %19
}

LLVM IR (-O2):
define zeroext i16 @fnSetBit(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = add nsw i32 %3, -1
%5 = shl nuw i32 1, %4
%6 = trunc i32 %5 to i16
%7 = or i16 %6, %0
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned int f5(unsigned int x) {
  unsigned int r = x + -2U;
  if (r > x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    1137 <f5+0x27>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%edi
ja     111f <f5+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
add    $0xfffffffe,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f5(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, -2
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp ugt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @foo(i32 0)
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @f5(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @foo(i32 0)
br label %5
5: ; preds = %3, %1
%6 = add i32 %0, -2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void bar(int x, double *y) {
  if (x || *y != 1.0)
    abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114e <bar+0x3e>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xec7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    114e <bar+0x3e>
jp     114e <bar+0x3e>
jmp    1155 <bar+0x45>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
test   %edi,%edi
jne    1127 <bar+0x17>
movsd  (%rsi),%xmm0
ucomisd 0xedf(%rip),%xmm0
jne    1127 <bar+0x17>
jp     1127 <bar+0x17>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
store i32 %0, i32* %3
store double* %1, double** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = fcmp une double %9, 1.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %7, %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0, double* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load double, double* %1
%6 = fcmp une double %5, 1.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %4, %2
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %4
ret void
}
void test_string() {}


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

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

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

LLVM IR (-O2):
define void @test_string() {
ret void
}
void edi_write_cmd(unsigned char *cmd, unsigned short address,
                   unsigned char data) {
  cmd[0] = 0x40;
  cmd[1] = 0x00;
  cmd[2] = (address >> 8) & 0xff;
  cmd[3] = (address >> 0) & 0xff;
  cmd[4] = data;
}


x86 assembly (clang, -O0):
<edi_write_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x40,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<edi_write_cmd>:
mov    %esi,%eax
movw   $0x40,(%rdi)
mov    %ah,0x2(%rdi)
mov    %al,0x3(%rdi)
mov    %dl,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @edi_write_cmd(i8* nocapture writeonly %0, i16 zeroext %1, i8 zeroext %2) {
store i8 64, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %4
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = trunc i16 %1 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %2, i8* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prs_idchar(char);
bool prs_isid_correct(char *id) {
  for (char *c = id; *c; c++) {
    if (!prs_idchar(*c))
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<prs_isid_correct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <prs_isid_correct+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <prs_idchar@plt>
cmp    $0x0,%eax
jne    1152 <prs_isid_correct+0x42>
movl   $0x0,-0x4(%rbp)
jmp    116f <prs_isid_correct+0x5f>
jmp    1157 <prs_isid_correct+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <prs_isid_correct+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prs_isid_correct>:
push   %rbx
mov    (%rdi),%cl
test   %cl,%cl
je     1140 <prs_isid_correct+0x30>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %cl,%edi
call   1030 <prs_idchar@plt>
test   %eax,%eax
je     1137 <prs_isid_correct+0x27>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1120 <prs_isid_correct+0x10>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
jmp    1145 <prs_isid_correct+0x35>
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @prs_isid_correct(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @prs_idchar(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4
%14 = xor i1 %11, true
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 1, %1 ], [ %15, %13 ]
ret i32 %17
}
void *VoidPtr2VoidPtr(void *payload) { return payload; }


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

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

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

LLVM IR (-O2):
define i8* @VoidPtr2VoidPtr(i8* readnone returned %0) {
ret i8* %0
}
int fun1395() { return 1395; }


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

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

LLVM IR (-O0):
define i32 @fun1395() {
ret i32 1395
}

LLVM IR (-O2):
define i32 @fun1395() {
ret i32 1395
}
void gtk_toggle_tool_button_new_from_stock() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toggle_tool_button_new_from_stock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
size_t dec(void **mem) {
  size_t *cnt = (size_t *)((*mem) - sizeof(size_t));
  if (*cnt > 0)
    return --(*cnt);
  free((void *)(*mem) - sizeof(size_t));
  *mem = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jbe    1150 <dec+0x40>
mov    -0x18(%rbp),%rcx
mov    (%rcx),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,(%rcx)
mov    %rax,-0x8(%rbp)
jmp    1173 <dec+0x63>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    -0x8(%rdi),%rax
add    $0xfffffffffffffff8,%rdi
test   %rax,%rax
je     112d <dec+0x1d>
add    $0xffffffffffffffff,%rax
mov    %rax,(%rdi)
pop    %rbx
ret
call   1030 <free@plt>
movq   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @dec(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr i8, i8* %2, i64 -8
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = add i64 %5, -1
store i64 %8, i64* %4
br label %11
9: ; preds = %1
%10 = tail call i32 @free(i8* %3)
store i8* null, i8** %0
br label %11
11: ; preds = %9, %7
%12 = phi i64 [ %8, %7 ], [ 0, %9 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    printf("%2d: %s\n", i, argv[i]);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%2d: %s\0A\00"
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
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%2d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ outchar(char);
void _out_char(char character, void *buffer, size_t idx, size_t maxlen) {
  (void)buffer;
  (void)idx;
  (void)maxlen;
  if (character) {
    outchar(character);
  }
}


x86 assembly (clang, -O0):
<_out_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113d <_out_char+0x2d>
movsbl -0x1(%rbp),%edi
call   1030 <outchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_out_char>:
test   %dil,%dil
je     111e <_out_char+0xe>
movsbl %dil,%edi
jmp    1030 <outchar@plt>
ret

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

LLVM IR (-O2):
define void @_out_char(i8 signext %0, i8* nocapture readnone %1, i64 %2, i64 %3) {
%5 = icmp eq i8 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @outchar(i8 signext %0)
br label %8
8: ; preds = %6, %4
ret void
}
void incC(__attribute__((unused)) void **alloc,
          __attribute__((unused)) void **in,
          __attribute__((unused)) void **inout,
          __attribute__((unused)) void **out) {
  unsigned *v = inout[0];
  v[2]++;
}


x86 assembly (clang, -O0):
<incC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<incC>:
mov    (%rdx),%rax
addl   $0x1,0x8(%rax)
ret

LLVM IR (-O0):
define void @incC(i8** %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%10 = load i8**, i8*** %7
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %9
%14 = load i32*, i32** %9
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = add i32 %16, 1
store i32 %17, i32* %15
ret void
}

LLVM IR (-O2):
define void @incC(i8** nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = bitcast i8** %2 to i32**
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 2
%8 = load i32, i32* %7
%9 = add i32 %8, 1
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
void output_label_prefix(void) { output_byte('$'); }


x86 assembly (clang, -O0):
<output_label_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1030 <output_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_label_prefix>:
mov    $0x24,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @output_label_prefix() {
%1 = call i32 @output_byte(i8 signext 36)
ret void
}

LLVM IR (-O2):
define void @output_label_prefix() {
%1 = tail call i32 @output_byte(i8 signext 36)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *sc(char *);
main() {
  char data1[] = "abbccc";
  char data2[] = "abbcccddddee";
  printf("%s\n", data1);
  printf("%s\n", sc(data1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x14(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x7(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x7(%rbp),%rdi
call   1040 <sc@plt>
mov    %rax,%rsi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x636363,0x3(%rsp)
movl   $0x63626261,(%rsp)
lea    0xecd(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <sc@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.data1 = [7 x i8] c"abbccc\00"
@__const.main.data2 = [13 x i8] c"abbcccddddee\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [13 x i8]
%3 = bitcast [7 x i8]* %1 to i8*
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%8 = call i8* @sc(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.data1 = [7 x i8] c"abbccc\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @sc(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned long pcm_prng(unsigned long);
int pcm_volume_dither(void) {
  static unsigned long state;
  uint32_t r;
  r = state = pcm_prng(state);
  return (r & 511) - ((r >> 9) & 511);
}


x86 assembly (clang, -O0):
<pcm_volume_dither>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f11(%rip),%rdi
call   1030 <pcm_prng@plt>
mov    %rax,0x2f05(%rip)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1ff,%eax
mov    -0x4(%rbp),%ecx
sar    $0x9,%ecx
and    $0x1ff,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcm_volume_dither>:
push   %rax
mov    0x2f18(%rip),%rdi
call   1030 <pcm_prng@plt>
mov    %rax,0x2f0c(%rip)
mov    %eax,%ecx
and    $0x1ff,%ecx
shr    $0x9,%eax
and    $0x1ff,%eax
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@pcm_volume_dither.state = internal global i64 0
define i32 @pcm_volume_dither() {
%1 = alloca i32
%2 = load i64, i64* @pcm_volume_dither.state
%3 = call i64 @pcm_prng(i64 %2)
store i64 %3, i64* @pcm_volume_dither.state
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = and i32 %5, 511
%7 = load i32, i32* %1
%8 = ashr i32 %7, 9
%9 = and i32 %8, 511
%10 = sub nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
@pcm_volume_dither.state = internal unnamed_addr global i64 0
define i32 @pcm_volume_dither() {
%1 = load i64, i64* @pcm_volume_dither.state
%2 = tail call i64 @pcm_prng(i64 %1)
store i64 %2, i64* @pcm_volume_dither.state
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 511
%5 = lshr i32 %3, 9
%6 = and i32 %5, 511
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ XSegment;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XSegment(void) {
  XSegment *_p = (XSegment *)malloc(sizeof(XSegment));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XSegment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XSegment+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XSegment>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XSegment+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XSegment() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XSegment() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Type definitions */
struct string_node {
  int dummy;
};
struct object {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
struct object *object_new(int /*<<< orphan*/);
int /*<<< orphan*/ string_node_class_get();
int /*<<< orphan*/ string_node_init(struct string_node *, char const *);
struct node *string_node_new(const char *text) {
  struct object *node = object_new(string_node_class_get());
  string_node_init(((struct string_node *)(node)), text);
  return ((struct node *)(node));
}


x86 assembly (clang, -O0):
<string_node_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <string_node_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <string_node_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_node_new>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <string_node_class_get@plt>
mov    %eax,%edi
call   1040 <object_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <string_node_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.node = type { i32 }
%struct.object = type { i32 }
%struct.string_node = type { i32 }
define %struct.node* @string_node_new(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.object*
store i8* %0, i8** %2
%4 = call i32 (...) @string_node_class_get()
%5 = call %struct.object* @object_new(i32 %4)
store %struct.object* %5, %struct.object** %3
%6 = load %struct.object*, %struct.object** %3
%7 = bitcast %struct.object* %6 to %struct.string_node*
%8 = load i8*, i8** %2
%9 = call i32 @string_node_init(%struct.string_node* %7, i8* %8)
%10 = load %struct.object*, %struct.object** %3
%11 = bitcast %struct.object* %10 to %struct.node*
ret %struct.node* %11
}

LLVM IR (-O2):
%struct.node = type { i32 }
%struct.object = type { i32 }
%struct.string_node = type { i32 }
define %struct.node* @string_node_new(i8* %0) {
%2 = tail call i32 (...) @string_node_class_get()
%3 = tail call %struct.object* @object_new(i32 %2)
%4 = bitcast %struct.object* %3 to %struct.string_node*
%5 = tail call i32 @string_node_init(%struct.string_node* %4, i8* %0)
%6 = bitcast %struct.object* %3 to %struct.node*
ret %struct.node* %6
}
void sanity_check_zero(void) {
  do {
    if (!(0 == 0)) {
      char buf[200];
      snprintf(buf, sizeof(buf), "%s:%d:%s(): %s",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/ShobhitSharma/chao/refs/"
               "heads/master/tests/tests_example.c",
               6, __func__, "Zero failed to be equal to zero.");
      test_failed(buf);
    } else {
      test_succeeded();
    }
  } while (0);
}


x86 assembly (clang, -O0):
<sanity_check_zero>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <sanity_check_zero+0x9>
mov    $0x0,%al
call   1030 <test_succeeded@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sanity_check_zero() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @test_succeeded()
br label %3
3: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @sanity_check_zero() {
%1 = tail call i32 (...) @test_succeeded()
ret void
}