xunge/DecIR huggingface dataset:
/* Variables and functions */
int GetLine(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  int max;
  char line[1000];
  char longest[1000];
  max = 0;
  while ((len = GetLine(line, 1000)) > 0) {
    if (len > 80) {
      printf("%s", line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <GetLine@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1178 <main+0x58>
cmpl   $0x50,-0x8(%rbp)
jle    1173 <main+0x53>
lea    -0x400(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetLine(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @GetLine(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
int get_SubCenter(unsigned char *pds) { return pds[26]; }


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

x86 assembly (clang, -O2):
<get_SubCenter>:
movzbl 0x1a(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_SubCenter(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 26
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
ret i32 %4
}
int test_imm_8Dint32_mem(int *val) {
  return ((*val) & (0x8D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Dint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x8d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Dint32_mem>:
testb  $0x8d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_8Dint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 141
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_8Dint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 141
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, int);
void yaffs_load_name_from_oh(struct yaffs_dev *dev, char *name,
                             const char *oh_name, int buff_size) {
  (void)dev;
  { strncpy(name, oh_name, buff_size - 1); }
}


x86 assembly (clang, -O0):
<yaffs_load_name_from_oh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_load_name_from_oh>:
mov    %rsi,%rdi
lea    -0x1(%rcx),%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define void @yaffs_load_name_from_oh(%struct.yaffs_dev* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.yaffs_dev*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.yaffs_dev* %0, %struct.yaffs_dev** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct.yaffs_dev*, %struct.yaffs_dev** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = sub nsw i32 %12, 1
%14 = call i32 @strncpy(i8* %10, i8* %11, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define void @yaffs_load_name_from_oh(%struct.yaffs_dev* nocapture readnone %0, i8* %1, i8* %2, i32 %3) {
%5 = add nsw i32 %3, -1
%6 = tail call i32 @strncpy(i8* %1, i8* %2, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("X = %d\n", a + b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [8 x i8] c"X = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("Runnning ps with system");
  system("ps ax &");
  printf("Done .\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <system@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Runnning ps with system\00"
@.str.1 = [8 x i8] c"ps ax &\00"
@.str.2 = [8 x i8] c"Done .\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"Runnning ps with system\00"
@.str.1 = [8 x i8] c"ps ax &\00"
@str = [7 x i8] c"Done .\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
int head_version(irafheader)
char *irafheader;
{
  if (irafncmp(irafheader, "imhdr", 5) != 0) {
    if (strncmp(irafheader, "imhv2", 5) != 0)
      return (0);
    else
      return (2);
  } else
    return (1);
}


x86 assembly (clang, -O0):
<head_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x5,%edx
mov    $0x0,%al
call   1040 <irafncmp@plt>
cmp    $0x0,%eax
je     1182 <head_version+0x62>
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
je     1176 <head_version+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1189 <head_version+0x69>
movl   $0x2,-0x4(%rbp)
jmp    1189 <head_version+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<head_version>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <irafncmp@plt>
test   %eax,%eax
je     115c <head_version+0x3c>
lea    0xec4(%rip),%rsi
mov    $0x5,%edx
mov    %rbx,%rdi
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"imhdr\00"
@.str.1 = [6 x i8] c"imhv2\00"
define i32 @head_version(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @irafncmp to i32 (i8*, i8*, i32, ...)*)(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5)
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %2
br label %14
12: ; preds = %7
store i32 2, i32* %2
br label %14
13: ; preds = %1
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"imhdr\00"
@.str.1 = [6 x i8] c"imhv2\00"
define i32 @head_version(i8* %0) {
%2 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @irafncmp to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 5)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 0
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 1, %1 ]
ret i32 %9
}
void CRYPTO_mem_leaks(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_mem_leaks() {
ret void
}
/* Variables and functions */
int getPower();
int monitoringPower(int state) {
  if (getPower() < 200) {
    return 9U;
  }
  return state;
}


x86 assembly (clang, -O0):
<monitoringPower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getPower@plt>
cmp    $0xc8,%eax
jge    1139 <monitoringPower+0x29>
movl   $0x9,-0x4(%rbp)
jmp    113f <monitoringPower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitoringPower>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getPower@plt>
cmp    $0xc8,%eax
mov    $0x9,%eax
cmovge %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @monitoringPower(i32 %0) {
%2 = tail call i32 (...) @getPower()
%3 = icmp slt i32 %2, 200
%4 = select i1 %3, i32 9, i32 %0
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *json_parser_on_alloc(void *ctx, size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<json_parser_on_alloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @json_parser_on_alloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
define noalias i8* @json_parser_on_alloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
int test_imm_7Duint8_mem(unsigned char *val) {
  return ((*val) & (0x7D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Duint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x7d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Duint8_mem>:
testb  $0x7d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Duint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 125
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_7Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 125
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void avcodec_get_context_defaults3() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_get_context_defaults3() {
ret void
}
unsigned long hugetlb_total_pages(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @hugetlb_total_pages() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ wd_check(char *);
int /*<<< orphan*/ wd_sys_reboot();
void wd_timer() {
  while (true) {
    if (!wd_check("dpt-breakout-server")) {
      wd_sys_reboot();
    }
    if (!wd_check("dpt-connector")) {
      wd_sys_reboot();
    }
    sleep(10);
  }
}


x86 assembly (clang, -O0):
<wd_timer>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <wd_timer+0x9>
lea    0xec0(%rip),%rdi
call   1030 <wd_check@plt>
cmp    $0x0,%eax
jne    1155 <wd_timer+0x25>
mov    $0x0,%al
call   1040 <wd_sys_reboot@plt>
lea    0xeb8(%rip),%rdi
call   1030 <wd_check@plt>
cmp    $0x0,%eax
jne    1171 <wd_timer+0x41>
mov    $0x0,%al
call   1040 <wd_sys_reboot@plt>
mov    $0xa,%edi
call   1050 <sleep@plt>
jmp    1139 <wd_timer+0x9>

x86 assembly (clang, -O2):
<wd_timer>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0xed2(%rip),%rbx
jmp    115a <wd_timer+0x2a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1050 <sleep@plt>
mov    %r14,%rdi
call   1030 <wd_check@plt>
test   %eax,%eax
jne    116d <wd_timer+0x3d>
xor    %eax,%eax
call   1040 <wd_sys_reboot@plt>
mov    %rbx,%rdi
call   1030 <wd_check@plt>
test   %eax,%eax
jne    1150 <wd_timer+0x20>
xor    %eax,%eax
call   1040 <wd_sys_reboot@plt>
jmp    1150 <wd_timer+0x20>

LLVM IR (-O0):
@.str = [20 x i8] c"dpt-breakout-server\00"
@.str.1 = [14 x i8] c"dpt-connector\00"
define void @wd_timer() {
br label %1
1: ; preds = %0, %11
%2 = call i32 @wd_check(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = call i32 (...) @wd_sys_reboot()
br label %6
6: ; preds = %4, %1
%7 = call i32 @wd_check(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = call i32 (...) @wd_sys_reboot()
br label %11
11: ; preds = %9, %6
%12 = call i32 @sleep(i32 10)
br label %1
}

LLVM IR (-O2):
@.str = [20 x i8] c"dpt-breakout-server\00"
@.str.1 = [14 x i8] c"dpt-connector\00"
define void @wd_timer() {
br label %1
1: ; preds = %0, %11
%2 = tail call i32 @wd_check(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @wd_sys_reboot()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @wd_check(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 (...) @wd_sys_reboot()
br label %11
11: ; preds = %9, %6
%12 = tail call i32 @sleep(i32 10)
br label %1
}
/* Variables and functions */
int syscall(int, int);
int epoll_create(int size) { return syscall(250, size); }


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

x86 assembly (clang, -O2):
<epoll_create>:
mov    %edi,%esi
mov    $0xfa,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @epoll_create(i32 %0) {
%2 = tail call i32 @syscall(i32 250, i32 %0)
ret i32 %2
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strnlen(char const *, size_t);
char *strndup(const char *src, size_t max) {
  size_t len = strnlen(src, max);
  char *dup;
  dup = malloc(len + 1);
  if (dup) {
    memcpy(dup, src, len);
    dup[len] = '\0';
  }
  return dup;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     118a <strndup+0x5a>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <strndup+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
%9 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %9
br label %10
10: ; preds = %7, %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ atm_header_create(unsigned char *, int, int, int, int);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
void atm_cell_create(unsigned char *cell, unsigned char *data, int vpi, int vci,
                     int pti, int clp) {
  memmove(cell + 5, data, 48);
  atm_header_create(cell, vpi, vci, pti, clp);
}


x86 assembly (clang, -O0):
<atm_cell_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x5,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x30,%edx
call   1030 <memmove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1040 <atm_header_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atm_cell_create>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%ebp
mov    %rdi,%rbx
add    $0x5,%rdi
mov    $0x30,%edx
call   1030 <memmove@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <atm_header_create@plt>

LLVM IR (-O0):
define void @atm_cell_create(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = getelementptr inbounds i8, i8* %13, i64 5
%15 = load i8*, i8** %8
%16 = call i32 @memmove(i8* %14, i8* %15, i32 48)
%17 = load i8*, i8** %7
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = call i32 @atm_header_create(i8* %17, i32 %18, i32 %19, i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @atm_cell_create(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = getelementptr inbounds i8, i8* %0, i64 5
%8 = tail call i32 @memmove(i8* %7, i8* %1, i32 48)
%9 = tail call i32 @atm_header_create(i8* %0, i32 %2, i32 %3, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *message) { fprintf(stderr, "%s: %s\n", "faifa", message); }


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xed0(%rip),%rsi
lea    0xed1(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xede(%rip),%rdx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [6 x i8] c"faifa\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int Overload1() { return 1; }


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

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

LLVM IR (-O0):
define i32 @Overload1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Overload1() {
ret i32 1
}
void wrap_init() {}


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

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

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

LLVM IR (-O2):
define void @wrap_init() {
ret void
}
/* Type definitions */
struct vty {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vty_out(struct vty *, char *);
void show_separator(struct vty *vty) {
  vty_out(vty, "-----------------------------\r\n");
}


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

x86 assembly (clang, -O2):
<show_separator>:
lea    0xee9(%rip),%rsi
jmp    1030 <vty_out@plt>

LLVM IR (-O0):
%struct.vty = type { i32 }
@.str = [32 x i8] c"-----------------------------\0D\0A\00"
define void @show_separator(%struct.vty* %0) {
%2 = alloca %struct.vty*
store %struct.vty* %0, %struct.vty** %2
%3 = load %struct.vty*, %struct.vty** %2
%4 = call i32 @vty_out(%struct.vty* %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.vty = type { i32 }
@.str = [32 x i8] c"-----------------------------\0D\0A\00"
define void @show_separator(%struct.vty* %0) {
%2 = tail call i32 @vty_out(%struct.vty* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
int arch_handle_signal(int sig, union uml_pt_regs *regs) { return 0; }


x86 assembly (clang, -O0):
<arch_handle_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.uml_pt_regs = type opaque
define i32 @arch_handle_signal(i32 %0, %union.uml_pt_regs* %1) {
%3 = alloca i32
%4 = alloca %union.uml_pt_regs*
store i32 %0, i32* %3
store %union.uml_pt_regs* %1, %union.uml_pt_regs** %4
ret i32 0
}

LLVM IR (-O2):
%union.uml_pt_regs = type opaque
define i32 @arch_handle_signal(i32 %0, %union.uml_pt_regs* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ _run_atexits();
void exit(int code) {
  _run_atexits();
  _exit(code);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_run_atexits@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_run_atexits@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @_run_atexits()
%3 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ m_free(void *);
void m_hash_free(void *ptr) { m_free(ptr); }


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

x86 assembly (clang, -O2):
<m_hash_free>:
jmp    1030 <m_free@plt>

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

LLVM IR (-O2):
define void @m_hash_free(i8* %0) {
%2 = tail call i32 @m_free(i8* %0)
ret void
}
int test_imm_4Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x4F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Fuint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x4f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Fuint8_mem>:
testb  $0x4f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Fuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 79
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_4Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 79
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int i8080_hal_memory_read_byte(int);
int i8080_hal_memory_read_word(int addr) {
  return (i8080_hal_memory_read_byte(addr + 1) << 8) |
         i8080_hal_memory_read_byte(addr);
}


x86 assembly (clang, -O0):
<i8080_hal_memory_read_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <i8080_hal_memory_read_byte@plt>
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <i8080_hal_memory_read_byte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8080_hal_memory_read_word>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1030 <i8080_hal_memory_read_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
call   1030 <i8080_hal_memory_read_byte@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i8080_hal_memory_read_word(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @i8080_hal_memory_read_byte(i32 %4)
%6 = shl i32 %5, 8
%7 = load i32, i32* %2
%8 = call i32 @i8080_hal_memory_read_byte(i32 %7)
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @i8080_hal_memory_read_word(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @i8080_hal_memory_read_byte(i32 %2)
%4 = shl i32 %3, 8
%5 = tail call i32 @i8080_hal_memory_read_byte(i32 %0)
%6 = or i32 %4, %5
ret i32 %6
}
int d_gt_cr1(double a1) { return (((100) > (a1))); }


x86 assembly (clang, -O0):
<d_gt_cr1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_gt_cr1>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @d_gt_cr1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double 1.000000e+02, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @d_gt_cr1(double %0) {
%2 = fcmp olt double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_string(char *string) { free(string); }


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

x86 assembly (clang, -O2):
<free_string>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_string(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int /*<<< orphan*/ pw_uid;
};

/* Variables and functions */
struct passwd *getpwnam(char const *);
int get_user_uid(const char *username, uid_t *uid) {
  struct passwd *password;
  if ((password = getpwnam(username)) == NULL) {
    return -1;
  }
  *uid = password->pw_uid;
  return 0;
}


x86 assembly (clang, -O0):
<get_user_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1143 <get_user_uid+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <get_user_uid+0x46>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_uid>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getpwnam@plt>
test   %rax,%rax
je     1126 <get_user_uid+0x16>
mov    (%rax),%eax
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
define i32 @get_user_uid(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca %struct.passwd*
store i8* %0, i8** %4
store i32* %1, i32** %5
%7 = load i8*, i8** %4
%8 = call %struct.passwd* @getpwnam(i8* %7)
store %struct.passwd* %8, %struct.passwd** %6
%9 = icmp eq %struct.passwd* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %16
11: ; preds = %2
%12 = load %struct.passwd*, %struct.passwd** %6
%13 = getelementptr inbounds %struct.passwd, %struct.passwd* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
store i32 0, i32* %3
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @get_user_uid(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call %struct.passwd* @getpwnam(i8* %0)
%4 = icmp eq %struct.passwd* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds %struct.passwd, %struct.passwd* %3, i64 0, i32 0
%7 = load i32, i32* %6
store i32 %7, i32* %1
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int getpid();
int get_current_pid(void) { return getpid(); }


x86 assembly (clang, -O0):
<get_current_pid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_current_pid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_current_pid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
char *get_argument_str(char *);
char *get_callback() {
  char *result = "";
  result = get_argument_str("callback");
  return result;
}


x86 assembly (clang, -O0):
<get_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee9(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <get_argument_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [9 x i8] c"callback\00"
define i8* @get_callback() {
%1 = alloca i8*
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = call i8* @get_argument_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"callback\00"
define i8* @get_callback() {
%1 = tail call i8* @get_argument_str(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mod1_say(void) { printf("mod1: Hello World\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"mod1: Hello World\0A\00"
define void @mod1_say() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"mod1: Hello World\00"
define void @mod1_say() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_ACuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xAC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ACuint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xac,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ACuint64_lowword_mem>:
testb  $0xac,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ACuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 172
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_ACuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 172
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strncasecmp(char *, char *, int);
void strncasecmp_diff_length_5() {
  char *x = "abcde";
  char *y = "aBd";
  if (strncasecmp(x, y, 3) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0xffffffff,%eax
je     1149 <strncasecmp_diff_length_5+0x39>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
@.str.1 = [4 x i8] c"aBd\00"
define void @strncasecmp_diff_length_5() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 3)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strncasecmp_diff_length_5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ run();
int main() {
  printf("Drive display (assumes GPIO #61 and #44 are output and 1)\n");
  run();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"Drive display (assumes GPIO and are output and 1)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @run()
ret i32 0
}

LLVM IR (-O2):
@str = [58 x i8] c"Drive display (assumes GPIO and are output and 1)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_call(int);
void write_call_table(void) {
  int i;
  for (i = 0; i < 60; i++)
    write_call(i);
}


x86 assembly (clang, -O0):
<write_call_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3c,-0x4(%rbp)
jge    113f <write_call_table+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <write_call@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <write_call_table+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_call_table>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <write_call@plt>
add    $0x1,%ebx
cmp    $0x3c,%ebx
jne    1120 <write_call_table+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @write_call_table() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @write_call(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 60
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
void main() {
  int x;
  int y;
  int a, b;
  int e = 3, f, g = 5, h, i = 6;
  e = g + 4;
  f = h * 5;
  x = 5 - 6;
  y = 200 / e;
  i = 4 * x + y - 3;
  int r;
  r = h % 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x14(%rbp)
movl   $0x5,-0x1c(%rbp)
movl   $0x6,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
imul   $0x5,-0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    $0xc8,%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x8(%rbp),%eax
sub    $0x3,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 3, i32* %5
store i32 5, i32* %7
store i32 6, i32* %9
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 4
store i32 %12, i32* %5
%13 = load i32, i32* %8
%14 = mul nsw i32 %13, 5
store i32 %14, i32* %6
store i32 -1, i32* %1
%15 = load i32, i32* %5
%16 = sdiv i32 200, %15
store i32 %16, i32* %2
%17 = load i32, i32* %1
%18 = mul nsw i32 4, %17
%19 = load i32, i32* %2
%20 = add nsw i32 %18, %19
%21 = sub nsw i32 %20, 3
store i32 %21, i32* %9
%22 = load i32, i32* %8
%23 = srem i32 %22, 2
store i32 %23, i32* %10
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displays_string_equal_failed(char const *, char const *,
                                                char const *, int);
void Displayer_display_string_equal_failed(const char *exp, const char *act,
                                           const char *file, int line) {
  displays_string_equal_failed(exp, act, file, line);
}


x86 assembly (clang, -O0):
<Displayer_display_string_equal_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <displays_string_equal_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Displayer_display_string_equal_failed>:
jmp    1030 <displays_string_equal_failed@plt>

LLVM IR (-O0):
define void @Displayer_display_string_equal_failed(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @displays_string_equal_failed(i8* %9, i8* %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Displayer_display_string_equal_failed(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @displays_string_equal_failed(i8* %0, i8* %1, i8* %2, i32 %3)
ret void
}
float area_triangulo(int base, int altura) {
  float res;
  res = (base * altura) / 2.0;
  return res;
}


x86 assembly (clang, -O0):
<area_triangulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_triangulo>:
imul   %esi,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @area_triangulo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 2.000000e+00
%11 = fptrunc double %10 to float
store float %11, float* %5
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
define float @area_triangulo(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 5.000000e-01
%6 = fptrunc double %5 to float
ret float %6
}